From owner-freebsd-python@FreeBSD.ORG Mon Oct 11 21:54:06 2010 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0EC1065694 for ; Mon, 11 Oct 2010 21:54:06 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta05.emeryville.ca.mail.comcast.net (qmta05.emeryville.ca.mail.comcast.net [76.96.30.48]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE668FC12 for ; Mon, 11 Oct 2010 21:54:06 +0000 (UTC) Received: from omta20.emeryville.ca.mail.comcast.net ([76.96.30.87]) by qmta05.emeryville.ca.mail.comcast.net with comcast id HQfV1f0031smiN4A5ZgvJU; Mon, 11 Oct 2010 21:40:55 +0000 Received: from comcast.net ([98.203.142.76]) by omta20.emeryville.ca.mail.comcast.net with comcast id HZgt1f00J1f6R9u8gZguJS; Mon, 11 Oct 2010 21:40:55 +0000 Received: by comcast.net (sSMTP sendmail emulation); Mon, 11 Oct 2010 14:40:53 -0700 Date: Mon, 11 Oct 2010 14:40:53 -0700 From: Charlie Kester To: freebsd-python@FreeBSD.org Message-ID: <20101011214052.GC1130@comcast.net> Mail-Followup-To: freebsd-python@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Mailer: Mutt 1.5.20 X-Composer: Vim 7.2 User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: When to use PYTHONPREFIX_SITELIBDIR? X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:54:06 -0000 A port I maintain, multimedia/gpodder, needs to install a set of Python modules from another distfile called mygpoclient. Here are the pertinent excerpts from the port Makefile, as I inherited it from the previous maintainer: DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:DEFAULT \ ${MGC_DISTNAME}${EXTRACT_SUFX}:mygpoclient ... MGC_DISTNAME= mygpoclient-1.4 MGC_WRKSRC= ${WRKDIR}/${MGC_DISTNAME}/mygpoclient ... pre-build: @${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${MGC_WRKSRC} @${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${MGC_WRKSRC} pre-install: @${MKDIR} ${PYTHON_SITELIBDIR}/mygpoclient @(cd ${MGC_WRKSRC} && ${COPYTREE_SHARE} . ${PYTHON_SITELIBDIR}/mygpoclient) The pkg-plist then contains multiple lines of the following form, to delete the files installed in the pre-install step: ... %%PYTHON_SITELIBDIR%%/mygpoclient/api.py %%PYTHON_SITELIBDIR%%/mygpoclient/api.pyc ... I've submitted a PR to update gpodder to 2.8 (and now 2.9), but the committers are reporting plist errors related to these mygpoclient files. The files are not being removed when gpodder is pkg-deleted. While researching this, I ran some simple tests using ports-mgmt/genplist and noticed that the mygpoclient files were being installed under /usr/local/lib and NOT under the tmp prefix as expected. ("genplist create /tmp/portname" sets PREFIX to /tmp/portname and installs the port there. I like to use it as a quick-and-dirty test of the install.) So I tried using PYTHONPREFIX_SITELIBDIR in the pre-install commands, and this seemed to work here on my own machine, testing with both genplist and tinderbox. (The pkg-plist lines were unchanged.) Today, however, I got another report of a plist failure. I'm not sure if the version tested was using PYTHONPREFIX_SITELIBDIR and will ask the committer about that. But I would like to get some advice from this list: is my approach correct? Is there a better way to accomplish the goal?