easy-install.pth is a volatile file as installed eggs are registered in
it for sys.path handling. Create a default version on install time and remove it when done. Also install a small script which allows registering and unregistering of eggs installed via packages. Bump revision.
This commit is contained in:
parent
0cb8140a00
commit
8a65589d2e
5 changed files with 61 additions and 6 deletions
10
devel/py24-setuptools/DEINSTALL
Normal file
10
devel/py24-setuptools/DEINSTALL
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: DEINSTALL,v 1.1 2006/11/03 13:56:46 joerg Exp $
|
||||
#
|
||||
|
||||
case $STAGE in
|
||||
DEINSTALL)
|
||||
${RM} @PYSITELIB@/easy-install.pth
|
||||
;;
|
||||
esac
|
14
devel/py24-setuptools/INSTALL
Normal file
14
devel/py24-setuptools/INSTALL
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: INSTALL,v 1.1 2006/11/03 13:56:46 joerg Exp $
|
||||
#
|
||||
|
||||
case $STAGE in
|
||||
POST-INSTALL)
|
||||
cat > @PYSITELIB@/easy-install.pth << EOF
|
||||
import sys; sys.__plen = len(sys.path)
|
||||
./setuptools-0.6c1-py2.4.egg
|
||||
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)
|
||||
EOF
|
||||
;;
|
||||
esac
|
|
@ -1,31 +1,42 @@
|
|||
# $NetBSD: Makefile,v 1.3 2006/07/24 22:51:32 wiz Exp $
|
||||
# $NetBSD: Makefile,v 1.4 2006/11/03 13:56:46 joerg Exp $
|
||||
#
|
||||
|
||||
DISTNAME= setuptools-0.6c1-py2.4.egg
|
||||
PKGNAME= py24-setuptools-0.6c1
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= http://cheeseshop.python.org/packages/2.4/s/setuptools/
|
||||
EXTRACT_SUFX= # empty
|
||||
|
||||
MAINTAINER= pkgsrc-users@NetBSD.org
|
||||
MAINTAINER= joerg@NetBSD.org
|
||||
HOMEPAGE= http://peak.telecommunity.com/DevCenter/setuptools
|
||||
COMMENT= New Python packaging system
|
||||
|
||||
WRKSRC= ${WRKDIR}
|
||||
NO_BUILD= yes
|
||||
PYTHON_VERSIONS_ACCEPTED= 24
|
||||
PY_PATCHPLIST= yes
|
||||
PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX:Q}
|
||||
PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX:Q} PYPKGPREFIX=${PYPKGPREFIX}
|
||||
TMPSCRIPT= ${WRKSRC}
|
||||
INSTCMD= import sys; \
|
||||
sys.path.insert(0,"${DISTNAME}"); \
|
||||
from setuptools.command.easy_install import main; \
|
||||
main(["-s", "${TMPSCRIPT}", "${DISTNAME}"])
|
||||
|
||||
CHECK_FILES_SKIP+= ${PREFIX}/${PYSITELIB}/easy-install.pth
|
||||
|
||||
FILES_SUBST+= PYSITELIB=${PREFIX}/${PYSITELIB}
|
||||
|
||||
do-build:
|
||||
${SED} -e 's,@PYTHON@,${PYTHONBIN},' \
|
||||
-e 's,@PYPREFIX@,${PYPKGPREFIX},' \
|
||||
-e 's,@PYSITELIB@,${PREFIX}/${PYSITELIB},' \
|
||||
${FILESDIR}/manage-eggs.py > ${WRKSRC}/manage-eggs.py
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC} && ${PYTHONBIN} -c ${INSTCMD:Q}
|
||||
${INSTALL_SCRIPT} ${TMPSCRIPT}/easy_install \
|
||||
${PREFIX}/bin/easy_install${PYVERSSUFFIX}
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/manage-eggs.py ${PREFIX}/bin/${PYPKGPREFIX}-manage-eggs
|
||||
|
||||
.include "../../lang/python/extension.mk"
|
||||
.include "../../mk/bsd.pkg.mk"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@comment $NetBSD: PLIST,v 1.2 2006/07/24 22:51:32 wiz Exp $
|
||||
@comment $NetBSD: PLIST,v 1.3 2006/11/03 13:56:46 joerg Exp $
|
||||
bin/easy_install${PYVERSSUFFIX}
|
||||
${PYSITELIB}/easy-install.pth
|
||||
bin/${PYPKGPREFIX}-manage-eggs
|
||||
${PYSITELIB}/setuptools-${PKGVERSION}-py2.4.egg/EGG-INFO/PKG-INFO
|
||||
${PYSITELIB}/setuptools-${PKGVERSION}-py2.4.egg/EGG-INFO/SOURCES.txt
|
||||
${PYSITELIB}/setuptools-${PKGVERSION}-py2.4.egg/EGG-INFO/dependency_links.txt
|
||||
|
|
20
devel/py24-setuptools/files/manage-eggs.py
Normal file
20
devel/py24-setuptools/files/manage-eggs.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!@PYTHON@
|
||||
|
||||
import sys
|
||||
|
||||
from setuptools.command.easy_install import PthDistributions
|
||||
from pkg_resources import find_distributions
|
||||
|
||||
usage = "@PYPREFIX@-manage-eggs [ register | unregister ] egg\n"
|
||||
|
||||
if len(sys.argv) != 3 or sys.argv[1] not in ("register", "unregister"):
|
||||
sys.stderr.write(usage)
|
||||
sys.exit(1)
|
||||
|
||||
pth = PthDistributions("@PYSITELIB@/easy-install.pth")
|
||||
distrib = find_distributions(sys.argv[2], True).next()
|
||||
if sys.argv[1] == "register":
|
||||
pth.add(distrib)
|
||||
elif sys.argv[1] == "unregister":
|
||||
pth.remove(distrib)
|
||||
pth.save()
|
Loading…
Reference in a new issue