Hi,

Attached is a port of "setuptools" for Python. setuptools is a 
mostly-compatible replacement for the standard distutils library
that lots of packages are starting to require.

It also provides a CPAN-like "easy_install" program to locate and
install Python modules, though (also like CPAN) packages installed
using this method will not be registered with the OpenBSD package
database.

Also attached is a patch to lang/python/python.port.mk that adds the
bits necessary to use setuptools in ports Makefiles. It is needed
to build the setuptools port itself.

Comments? Ok?

-d
Index: lang/python/python.port.mk
===================================================================
RCS file: /cvs/ports/lang/python/python.port.mk,v
retrieving revision 1.12
diff -u -p -r1.12 python.port.mk
--- lang/python/python.port.mk  3 Jun 2006 09:14:04 -0000       1.12
+++ lang/python/python.port.mk  28 Aug 2006 09:38:58 -0000
@@ -12,6 +12,13 @@ BUILD_DEPENDS+=              ${_MODPY_BUILD_DEPENDS}
 .endif
 RUN_DEPENDS+=          ${_MODPY_BUILD_DEPENDS}
 
+# The setuptools module provides a package locator (site.py) that is
+# often required at runtime
+.if defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
+_MODPY_LIB_DEPENDS?=   :py-setuptools-*:devel/py-setuptools
+LIB_DEPENDS+=          ${_MODPY_LIB_DEPENDS}
+.endif
+
 .if !defined(NO_SHARED_LIBS) || ${NO_SHARED_LIBS:U} != YES
 MODPY_EXPAT_DEPENDS=   
:python-expat-${MODPY_VERSION}*:lang/python/${MODPY_VERSION},-expat     
 MODPY_TKINTER_DEPENDS= 
:python-tkinter-${MODPY_VERSION}*:lang/python/${MODPY_VERSION},-tkinter
@@ -27,7 +34,14 @@ MODPY_SETUP?=                setup.py
 
 # build or build_ext are commonly used
 MODPY_DISTUTILS_BUILD?=                build --build-base=${WRKSRC}
+
+.if defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
+MODPY_DISTUTILS_INSTALL?=      install --prefix=${LOCALBASE} \
+                               --root=${DESTDIR} \
+                               --single-version-externally-managed
+.else
 MODPY_DISTUTILS_INSTALL?=      install --prefix=${PREFIX}
+.endif
 
 MAKE_ENV+=     CC=${CC}
 
@@ -49,4 +63,12 @@ do-install:
        ${_MODPY_CMD} ${MODPY_DISTUTILS_BUILD} ${MODPY_DISTUTILS_BUILDARGS} \
                ${MODPY_DISTUTILS_INSTALL} ${MODPY_DISTUTILS_INSTALLARGS}
 .  endif
+
+# setuptools supports regress testing from setup.py using a standard target
+.  if !target(do-regress) && \
+      defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
+do-regress:
+       ${_MODPY_CMD} test
+.  endif
+
 .endif

Attachment: py-setuptools.tgz
Description: Binary data

Reply via email to