summaryrefslogtreecommitdiff
path: root/devel/py-setuptools
diff options
context:
space:
mode:
authorjoerg <joerg>2006-11-14 13:33:29 +0000
committerjoerg <joerg>2006-11-14 13:33:29 +0000
commitac4e3b680edaeeb1a46ae68a05475edbbc2b6f13 (patch)
tree2902320d4916265a57ca2082bee272e2a161fa2f /devel/py-setuptools
parente858e7f17749a0cc658fb93a1a2615024b74548e (diff)
downloadpkgsrc-ac4e3b680edaeeb1a46ae68a05475edbbc2b6f13.tar.gz
Reimport devel/py24-setuptools as devel/py-setuptools. This is in
principle usable on Python 2.3 as well, but not tested yet.
Diffstat (limited to 'devel/py-setuptools')
-rw-r--r--devel/py-setuptools/DEINSTALL10
-rw-r--r--devel/py-setuptools/DESCR3
-rw-r--r--devel/py-setuptools/INSTALL14
-rw-r--r--devel/py-setuptools/Makefile58
-rw-r--r--devel/py-setuptools/PLIST116
-rw-r--r--devel/py-setuptools/distinfo5
-rw-r--r--devel/py-setuptools/files/easy_install.py9
-rw-r--r--devel/py-setuptools/files/manage-eggs.py20
8 files changed, 235 insertions, 0 deletions
diff --git a/devel/py-setuptools/DEINSTALL b/devel/py-setuptools/DEINSTALL
new file mode 100644
index 00000000000..749c93472fc
--- /dev/null
+++ b/devel/py-setuptools/DEINSTALL
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1.1.1 2006/11/14 13:33:29 joerg Exp $
+#
+
+case $STAGE in
+DEINSTALL)
+ ${RM} @PYSITELIB@/easy-install.pth
+ ;;
+esac
diff --git a/devel/py-setuptools/DESCR b/devel/py-setuptools/DESCR
new file mode 100644
index 00000000000..ef3528c5049
--- /dev/null
+++ b/devel/py-setuptools/DESCR
@@ -0,0 +1,3 @@
+setuptools is a collection of enhancements to the Python distutils
+that allow you to more easily build and distribute Python packages,
+especially ones that have dependencies on other packages.
diff --git a/devel/py-setuptools/INSTALL b/devel/py-setuptools/INSTALL
new file mode 100644
index 00000000000..436c8ac5d4e
--- /dev/null
+++ b/devel/py-setuptools/INSTALL
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1.1.1 2006/11/14 13:33:29 joerg Exp $
+#
+
+case $STAGE in
+POST-INSTALL)
+ cat > @PYSITELIB@/easy-install.pth << EOF
+import sys; sys.__plen = len(sys.path)
+./setuptools-0.6c1-py@PYVERSSUFFIX@.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
diff --git a/devel/py-setuptools/Makefile b/devel/py-setuptools/Makefile
new file mode 100644
index 00000000000..824cf049411
--- /dev/null
+++ b/devel/py-setuptools/Makefile
@@ -0,0 +1,58 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/11/14 13:33:29 joerg Exp $
+#
+
+DISTNAME= setuptools-0.6c1-py2.4.egg
+PKGNAME= ${PYPKGPREFIX}-setuptools-0.6c1
+PKGVERSION_NOREV= 0.6c1
+PKGREVISION= 1
+CATEGORIES= devel python
+MASTER_SITES= http://cheeseshop.python.org/packages/2.4/s/setuptools/
+EXTRACT_SUFX= # empty
+
+MAINTAINER= joerg@NetBSD.org
+HOMEPAGE= http://peak.telecommunity.com/DevCenter/setuptools
+COMMENT= New Python packaging system
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+PYTHON_VERSIONS_ACCEPTED= 24
+USE_TOOLS+= unzip
+
+PY_PATCHPLIST= yes
+PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX} PYPKGPREFIX=${PYPKGPREFIX}
+PYCOMPILEALL= ${BUILDLINK_PREFIX.${PYPACKAGE}}/${PYLIB}/compileall.py
+
+CHECK_FILES_SKIP+= ${PREFIX}/${PYSITELIB}/easy-install.pth
+
+FILES_SUBST+= PYSITELIB=${PREFIX}/${PYSITELIB}
+FILES_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX}
+
+INSTALLATION_DIRS= bin
+
+EGG_NAME= ${DISTNAME:S/2.4/${PYVERSSUFFIX}/}
+TARGET_NAME= ${PREFIX}/${PYSITELIB}/${EGG_NAME}
+
+do-extract:
+ ${MKDIR} ${WRKSRC}
+ ${TOOLS_CMD.unzip} -d ${WRKSRC} ${DISTDIR}/${DISTNAME}
+
+do-build:
+ ${SED} -e 's,@PYTHON@,${PYTHONBIN},' \
+ -e 's,@PYPREFIX@,${PYPKGPREFIX},' \
+ -e 's,@PYSITELIB@,${PREFIX}/${PYSITELIB},' \
+ ${FILESDIR}/manage-eggs.py > ${WRKDIR}/manage-eggs.py
+ ${SED} -e 's,@PYTHON@,${PYTHONBIN},' \
+ -e 's,@PKGVERSION@,${PKGVERSION_NOREV},' \
+ ${FILESDIR}/easy_install.py > ${WRKDIR}/easy_install.py
+ ${PYTHONBIN} ${PYCOMPILEALL} -f -d ${TARGET_NAME} ${WRKSRC}
+ ${PYTHONBIN} -O ${PYCOMPILEALL} -f -d ${TARGET_NAME} ${WRKSRC}
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/easy_install.py \
+ ${DESTDIR}${PREFIX}/bin/easy_install${PYVERSSUFFIX}
+ ${INSTALL_SCRIPT} ${WRKDIR}/manage-eggs.py ${DESTDIR}${PREFIX}/bin/${PYPKGPREFIX}-manage-eggs
+ cd ${WRKSRC} && pax -rw -pm . ${DESTDIR}${TARGET_NAME}
+ ${ECHO} ./${EGG_NAME} > ${DESTDIR}${PREFIX}/${PYSITELIB}/setuptools.pth
+
+.include "../../lang/python/extension.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/py-setuptools/PLIST b/devel/py-setuptools/PLIST
new file mode 100644
index 00000000000..9c53958b73e
--- /dev/null
+++ b/devel/py-setuptools/PLIST
@@ -0,0 +1,116 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/11/14 13:33:29 joerg Exp $
+bin/easy_install${PYVERSSUFFIX}
+bin/${PYPKGPREFIX}-manage-eggs
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/PKG-INFO
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/SOURCES.txt
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/dependency_links.txt
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/entry_points.txt
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/not-zip-safe
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO/top_level.txt
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/easy_install.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/easy_install.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/easy_install.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/pkg_resources.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/pkg_resources.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/pkg_resources.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/__init__.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/__init__.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/__init__.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/archive_util.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/archive_util.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/archive_util.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/cli.exe
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/__init__.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/__init__.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/__init__.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/alias.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/alias.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/alias.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_egg.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_egg.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_egg.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_rpm.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_rpm.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/bdist_rpm.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_ext.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_ext.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_ext.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_py.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_py.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/build_py.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/develop.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/develop.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/develop.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/easy_install.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/easy_install.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/easy_install.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/egg_info.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/egg_info.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/egg_info.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_egg_info.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_egg_info.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_egg_info.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_lib.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_lib.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_lib.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_scripts.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_scripts.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/install_scripts.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/register.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/register.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/register.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/rotate.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/rotate.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/rotate.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/saveopts.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/saveopts.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/saveopts.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/sdist.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/sdist.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/sdist.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/setopt.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/setopt.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/setopt.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/test.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/test.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/test.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/upload.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/upload.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command/upload.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/depends.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/depends.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/depends.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/dist.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/dist.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/dist.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/extension.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/extension.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/extension.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/gui.exe
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/package_index.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/package_index.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/package_index.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/sandbox.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/sandbox.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/sandbox.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/__init__.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/__init__.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/__init__.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/doctest.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/doctest.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/doctest.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/test_resources.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/test_resources.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests/test_resources.pyo
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/site.py
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/site.pyc
+${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/site.pyo
+${PYSITELIB}/setuptools.pth
+@dirrm ${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/tests
+@dirrm ${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools/command
+@dirrm ${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/setuptools
+@dirrm ${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg/EGG-INFO
+@dirrm ${PYSITELIB}/setuptools-${PKGVERSION}-py${PYVERSSUFFIX}.egg
diff --git a/devel/py-setuptools/distinfo b/devel/py-setuptools/distinfo
new file mode 100644
index 00000000000..ba983063311
--- /dev/null
+++ b/devel/py-setuptools/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/11/14 13:33:29 joerg Exp $
+
+SHA1 (setuptools-0.6c1-py2.4.egg) = c2aeea554bfb5a16af345ae2ca9530d1d2c0b508
+RMD160 (setuptools-0.6c1-py2.4.egg) = 39d05d56a1a64422114bf3e2c52798f72679fbf9
+Size (setuptools-0.6c1-py2.4.egg) = 489615 bytes
diff --git a/devel/py-setuptools/files/easy_install.py b/devel/py-setuptools/files/easy_install.py
new file mode 100644
index 00000000000..4c8c38b7d51
--- /dev/null
+++ b/devel/py-setuptools/files/easy_install.py
@@ -0,0 +1,9 @@
+#!@PYTHON@
+# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==@PKGVERSION@','console_scripts','easy_install'
+__requires__ = 'setuptools==@PKGVERSION@'
+import sys
+from pkg_resources import load_entry_point
+
+sys.exit(
+ load_entry_point('setuptools==@PKGVERSION@', 'console_scripts', 'easy_install')()
+)
diff --git a/devel/py-setuptools/files/manage-eggs.py b/devel/py-setuptools/files/manage-eggs.py
new file mode 100644
index 00000000000..6d6db67c3af
--- /dev/null
+++ b/devel/py-setuptools/files/manage-eggs.py
@@ -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()