Index: Mk/bsd.python.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.python.mk,v retrieving revision 1.95 diff -u -r1.95 bsd.python.mk --- Mk/bsd.python.mk 26 Feb 2007 07:32:02 -0000 1.95 +++ Mk/bsd.python.mk 10 Mar 2007 12:26:10 -0000 @@ -81,6 +81,12 @@ # want to build extensions with an older binary. # default: depends on the version of your python binary # +# PYTHON_DEFAULT_VERSION +# - Version of the default python binary in your ${PATH}, in +# the format "python2.5". Set this in your /etc/make.conf +# in case you want to use an older version as a default. +# default: python2.5 +# # PYTHON_WRKSRC - The ${WRKSRC} for your python version. Needed for # extensions like Tkinter, py-gdbm and py-expat, which # are built from sources contained in the Python @@ -122,6 +128,17 @@ # USE_PYDISTUTILS - Use distutils as do-configure, do-build and do-install # targets. # +# PYSETUP - Name of the setup script used by the distutils package. +# default: setup.py +# +# PYDISTUTILS_PKGNAME +# - Internal name in the distutils for egg-info. +# default: ${PORTNAME} +# +# PYDISTUTILS_PKGVERSION +# - Internal version in the distutils for egg-info. +# default: ${PORTVERSION} +# # PYDISTUTILS_CONFIGURE_TARGET # - Pass this command to distutils on configure stage. # default: config @@ -146,8 +163,32 @@ # - Arguments to install with distutils. # default: -c -O1 --prefix=${PREFIX} # -# PYSETUP - Name of the setup script used by the distutils package. -# default: setup.py +# PYDISTUTILS_EGGINFO +# - Canonical name for egg-info. +# default: ${PYDISTUTILS_PKGNAME:S/-/_/g}-${PYDISTUTILS_PKGVERSION}-${PYTHON_VERSION:S/thon//}.egg-info +# +# PYDISTUTILS_NOEGGINFO +# - Skip an egg-info entry from plist when defined. +# +# PYEASYINSTALL_EGGNAME +# - Canonical directory name for easy_install egg packages. +# default: ${PYDISTUTILS_PKGNAME:S/-/_/g}-${PYDISTUTILS_PKGVERSION}-${PYTHON_VERSION:S/thon//}${PYEASYINSTALL_OSARCH}.egg +# +# PYEASYINSATLL_OSARCH +# - Platform identifier for easy_install. +# default: -${OPSYS:L}-${_OSRELEASE}-${ARCH} +# if PYEASYINSTALL_ARCHDEP is defined. +# +# PYEASYINSTALL_CMD - Full file path to easy_install command. +# default: ${LOCALBASE}/bin/easy_install-${PYTHON_VER} +# +# PYEASYINSTALL_INSTALL_ARGS +# - Arguments to easy_install command for egg installation. +# default: -q -N -S ${PYTHON_SITELIBDIR} ${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION} +# +# PYEASYINSTALL_UNINSTALL_ARGS +# - Arguments to easy_install command for egg uninstallation. +# default: -q -m -S ${PYTHON_SITELIBDIR} ${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION} # # USE_TWISTED - If this option is just yes then build and run # the dependence to twistedCore is added. Alternatively @@ -173,8 +214,8 @@ # specific version of zope. # -_PYTHON_PORTBRANCH= 2.4 -_PYTHON_ALLBRANCHES= 2.4 2.5 2.3 # preferred first +_PYTHON_PORTBRANCH= 2.5 +_PYTHON_ALLBRANCHES= 2.5 2.4 2.3 # preferred first _ZOPE_PORTBRANCH= 2.7 _ZOPE_ALLBRANCHES= 2.7 2.8 2.9 2.10 3.2 @@ -237,22 +278,24 @@ # Determine version number of Python to use +.if !defined(PYTHON_DEFAULT_VERSION) +. if exists(${LOCALBASE}/bin/python) +_PYTHON_DEFAULT_VERSION!= (${LOCALBASE}/bin/python -c \ + 'import sys; print sys.version[:3]' 2> /dev/null \ + || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1 +. else +_PYTHON_DEFAULT_VERSION= ${_PYTHON_PORTBRANCH} +. endif +PYTHON_DEFAULT_VERSION= python${_PYTHON_DEFAULT_VERSION} +.endif + .if defined(PYTHON_VERSION) _PYTHON_VERSION:= ${PYTHON_VERSION:S/^python//} _PYTHON_CMD= ${LOCALBASE}/bin/${PYTHON_VERSION} .else -# Determine the currently installed version. If Python is not installed, a -# default version number is substituted and the corresponding Python -# distribution will be built through the dependency processing. -.if defined(PYTHON_CMD) -_PYTHON_CMD= ${PYTHON_CMD} -.else -_PYTHON_CMD= ${LOCALBASE}/bin/python -.endif -_PYTHON_VERSION!= (${_PYTHON_CMD} -c \ - 'import sys; print sys.version[:3]' 2> /dev/null \ - || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1 -.endif # defined(PYTHON_VERSION) +_PYTHON_VERSION:= ${PYTHON_DEFAULT_VERSION:S/^python//} +_PYTHON_CMD= ${LOCALBASE}/bin/${PYTHON_DEFAULT_VERSION} +.endif .if !defined(USE_PYTHON) .if defined(USE_PYTHON_BUILD) @@ -360,8 +403,8 @@ @${ECHO} "Makefile error: bad value for PYTHON_VERSION: ${PYTHON_VERSION}." @${ECHO} "Legal values are:" @${ECHO} " python2.3" - @${ECHO} " python2.4 (default)" - @${ECHO} " python2.5" + @${ECHO} " python2.4" + @${ECHO} " python2.5 (default)" @${FALSE} .endif @@ -381,10 +424,53 @@ PYTHONPREFIX_LIBDIR= ${PYTHON_LIBDIR:S;${PYTHONBASE};${PREFIX};} PYTHONPREFIX_SITELIBDIR= ${PYTHON_SITELIBDIR:S;${PYTHONBASE};${PREFIX};} +# setuptools support +.if defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install" +BUILD_DEPENDS+= ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools +RUN_DEPENDS+= ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools + +PYDISTUTILS_BUILD_TARGET?= bdist_egg +PYDISTUTILS_INSTALL_TARGET?= easy_install +PYDISTUTILS_INSTALLARGS?= -O 1 -N -S ${PYTHON_SITELIBDIR} ${WRKSRC}/dist/${PYEASYINSTALL_EGGNAME} + +.if defined(PYEASYINSTALL_ARCHDEP) +_OSRELEASE!= ${UNAME} -r +PYEASYINSTALL_OSARCH?= -${OPSYS:L}-${_OSRELEASE}-${ARCH} +.endif +PYEASYINSTALL_EGGNAME?= ${PYDISTUTILS_PKGNAME:S/-/_/g}-${PYDISTUTILS_PKGVERSION}-${PYTHON_VERSION:S/thon//}${PYEASYINSTALL_OSARCH}.egg +PYEASYINSTALL_CMD?= ${LOCALBASE}/bin/easy_install-${PYTHON_VER} +PYEASYINSTALL_INSTALLARGS?= -q -N -S ${PYTHON_SITELIBDIR} \ + ${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION} +PYEASYINSTALL_UNINSTALLARGS?= -q -m -S ${PYTHON_SITELIBDIR} \ + ${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION} + +PLIST_SUB+= PYEASYINSTALL_EGG=${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;}/${PYEASYINSTALL_EGGNAME} + +add-plist-post: add-plist-easyinstall +add-plist-easyinstall: + @# @unexec line must be located before any other line while @exec must not. + @${CAT} ${TMPPLIST} > ${TMPPLIST}.pei_tmp + @${ECHO_CMD} "@unexec ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_UNINSTALLARGS}" \ + > ${TMPPLIST} + @${CAT} ${TMPPLIST}.pei_tmp >> ${TMPPLIST} + @${ECHO_CMD} "@exec ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_INSTALLARGS}" \ + >> ${TMPPLIST} +.endif # defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install" + +# distutils support PYSETUP?= setup.py PYDISTUTILS_CONFIGUREARGS?= PYDISTUTILS_BUILDARGS?= PYDISTUTILS_INSTALLARGS?= -c -O1 --prefix=${PREFIX} +PYDISTUTILS_PKGNAME?= ${PORTNAME} +PYDISTUTILS_PKGVERSION?=${PORTVERSION} +PYDISTUTILS_EGGINFO?= ${PYDISTUTILS_PKGNAME:S/-/_/g}-${PYDISTUTILS_PKGVERSION}-${PYTHON_VERSION:S/thon//}.egg-info + +.if !defined(PYDISTUTILS_NOEGGINFO) && defined(USE_PYDISTUTILS) && \ + ${USE_PYDISTUTILS} != "easy_install" && \ + defined(PYTHON_REL) && ${PYTHON_REL} >= 250 +PLIST_FILES+= ${PYTHON_SITELIBDIR:S;${PYTHONBASE}/;;}/${PYDISTUTILS_EGGINFO} +.endif # Fix for programs that build python from a GNU auto* enviornment CONFIGURE_ENV+= PYTHON="${PYTHON_CMD}" ? lang/python/m ? lang/python/work ? lang/python23/work ? lang/python24/work ? lang/python25/work Index: lang/python/Makefile =================================================================== RCS file: /home/pcvs/ports/lang/python/Makefile,v retrieving revision 1.159 diff -u -r1.159 Makefile --- lang/python/Makefile 14 Feb 2007 06:07:29 -0000 1.159 +++ lang/python/Makefile 10 Mar 2007 12:26:15 -0000 @@ -6,43 +6,44 @@ # PORTNAME= python -PORTVERSION= 2.4.4 -PORTEPOCH= 1 +PORTVERSION= ${PYTHON_VER} +PORTEPOCH= 2 CATEGORIES= lang python ipv6 MASTER_SITES= # empty DISTFILES= # empty EXTRACT_ONLY= # empty MAINTAINER= python@FreeBSD.org -COMMENT= The "meta-port" for the stable version of Python interpreter +COMMENT= The "meta-port" for the default version of Python interpreter USE_PYTHON_RUN= yes -PYTHON_VERSION= python2.4 +PYTHON_VERSION= ${PYTHON_DEFAULT_VERSION} NO_BUILD= yes -do-install: # empty +do-install: + @${DO_NADA} # Major upgrade support PORTUPGRADE?= ${LOCALBASE}/sbin/portupgrade PKG_WHICH?= ${LOCALBASE}/sbin/pkg_which upgrade-site-packages: - @if [ -x ${PORTUPGRADE} ]; then \ - for ver in 2.1 2.2 2.3 2.5; do \ - if [ -d ${PREFIX}/lib/python$$ver ]; then \ - UPD=`${FIND} ${PREFIX}/lib/python$$ver \ - -type f -print0 | \ - ${XARGS} -0 ${PKG_WHICH} | \ - ${GREP} -Fv '?' | \ - ${EGREP} -v '^python2?[0-5]?-2' | \ - ${SORT} -u`; \ - if [ "$$UPD" ]; then \ - ${PORTUPGRADE} -f $$UPD; \ - fi; \ - fi; \ - done; \ - else \ + @if [ ! -x ${PORTUPGRADE} ]; then \ ${ECHO_MSG} "Please install ports-mgmt/portupgrade."; \ ${FALSE}; \ fi + @for ver in `echo ${_PYTHON_ALLBRANCHES}|${SED} 's/${PYTHON_VER}//'`; do \ + if [ -d ${PREFIX}/lib/python$$ver ]; then \ + UPD=`${FIND} ${PREFIX}/lib/python$$ver \ + -type f -print0 | \ + ${XARGS} -0 ${PKG_WHICH} | \ + ${GREP} -Fv '?' | \ + ${EGREP} -v '^python2?[0-5]?-2' | \ + ${SORT} -u`; \ + if [ "$$UPD" ]; then \ + ${PORTUPGRADE} -f $$UPD; \ + fi; \ + fi; \ + done \ + .include Index: lang/python23/Makefile =================================================================== RCS file: /home/pcvs/ports/lang/python23/Makefile,v retrieving revision 1.146 diff -u -r1.146 Makefile --- lang/python23/Makefile 9 Oct 2006 14:29:17 -0000 1.146 +++ lang/python23/Makefile 10 Mar 2007 12:26:15 -0000 @@ -7,7 +7,7 @@ PORTNAME= python23 PORTVERSION= 2.3.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang python ipv6 MASTER_SITES= ${PYTHON_MASTER_SITES} MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR} @@ -16,7 +16,6 @@ MAINTAINER= python@FreeBSD.org COMMENT?= An interpreted object-oriented programming language -CONFLICTS= stackless_python-* DIST_SUBDIR= python WRKSRC= ${PYTHON_WRKSRC} GNU_CONFIGURE= yes @@ -38,6 +37,9 @@ DEMODIR= ${PREFIX}/share/examples/${PYTHON_VERSION} TOOLSDIR= ${PREFIX}/share/${PYTHON_VERSION} +BIN_SCRIPTS= idle pydoc python python-shared +BINLINKS_SUB= -e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},' + OPTIONS= THREADS "Enable thread support" on \ HUGE_STACK_SIZE "Use a larger thread stack" off \ UCS4 "Use UCS4 for unicode support" on \ @@ -46,6 +48,13 @@ .include +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} +MLINKS= ${PYTHON_VERSION}.1 python.1 +PLIST_SUB+= IF_DEFAULT="" +.else +PLIST_SUB+= IF_DEFAULT="@comment " +.endif + .if !defined(WITHOUT_THREADS) CONFIGURE_ARGS+= --with-threads CFLAGS+= ${PTHREAD_CFLAGS} @@ -171,6 +180,13 @@ ${INSTALL_SCRIPT} ${WRKDIR}/pydoc2.3 ${WRKDIR}/idle2.3 \ ${PREFIX}/bin +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} + for f in ${BIN_SCRIPTS}; do \ + TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \ + cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \ + done +.endif + .if !defined(NOPORTDOCS) @${MKDIR} ${TOOLSDIR} @cd ${WRKSRC}; tar -c --exclude='*CVS*' -f - Tools | \ Index: lang/python23/pkg-plist =================================================================== RCS file: /home/pcvs/ports/lang/python23/pkg-plist,v retrieving revision 1.57 diff -u -r1.57 pkg-plist --- lang/python23/pkg-plist 28 Jul 2005 07:05:20 -0000 1.57 +++ lang/python23/pkg-plist 10 Mar 2007 12:26:16 -0000 @@ -1,6 +1,10 @@ +%%IF_DEFAULT%%bin/idle bin/idle%%PYVER%% +%%IF_DEFAULT%%bin/pydoc bin/pydoc%%PYVER%% +%%IF_DEFAULT%%bin/python bin/python%%PYVER%% +%%IF_DEFAULT%%bin/python-shared bin/python-shared%%PYVER%% include/%%PYTHON_VERSION%%/Python.h include/%%PYTHON_VERSION%%/abstract.h Index: lang/python24/Makefile =================================================================== RCS file: /home/pcvs/ports/lang/python24/Makefile,v retrieving revision 1.156 diff -u -r1.156 Makefile --- lang/python24/Makefile 14 Feb 2007 06:07:29 -0000 1.156 +++ lang/python24/Makefile 10 Mar 2007 12:26:16 -0000 @@ -7,12 +7,13 @@ PORTNAME= python24 PORTVERSION= 2.4.4 +PORTREVISION= 1 CATEGORIES= lang python ipv6 MASTER_SITES= ${PYTHON_MASTER_SITES} MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR} DISTFILES= ${PYTHON_DISTFILE} -MAINTAINER= perky@FreeBSD.org +MAINTAINER= python@FreeBSD.org COMMENT?= An interpreted object-oriented programming language DIST_SUBDIR= python @@ -22,8 +23,8 @@ CONFIGURE_ENV= OPT="${CFLAGS}" MAKE_ENV= VPATH="${WRKSRC}" USE_LDCONFIG= yes -INSTALL_TARGET= install -MAN1= python.1 ${PYTHON_VERSION}.1 +INSTALL_TARGET= altinstall +MAN1= ${PYTHON_VERSION}.1 USE_PYTHON= yes PYTHON_VERSION= python2.4 @@ -35,11 +36,9 @@ DEMODIR= ${PREFIX}/share/examples/${PYTHON_VERSION} TOOLSDIR= ${PREFIX}/share/${PYTHON_VERSION} -.if !exists(/usr/bin/ypcat) # the world with NO_NIS -PLISTCAT= ${GREP} -v 'nis.so$$' ${PKGDIR}/pkg-plist -.else -PLISTCAT= ${CAT} ${PKGDIR}/pkg-plist -.endif +BIN_SCRIPTS= idle pydoc python python-shared smtpd.py +BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \ + -e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},' OPTIONS= THREADS "Enable thread support" on \ HUGE_STACK_SIZE "Use a larger thread stack" off \ @@ -50,6 +49,13 @@ .include +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} +MLINKS= ${PYTHON_VERSION}.1 python.1 +PLIST_SUB+= IF_DEFAULT="" +.else +PLIST_SUB+= IF_DEFAULT="@comment " +.endif + # workaround for a bug in base curses.h. CFLAGS+= -D__wchar_t=wchar_t @@ -91,6 +97,12 @@ CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900 .endif +.if !exists(/usr/bin/ypcat) # the world with NO_NIS +PLIST_SUB+= NO_NIS="@comment " +.else +PLIST_SUB+= NO_NIS="" +.endif + .if !defined(WITHOUT_IPV6) && ${OSVERSION} >= 400014 CONFIGURE_ARGS+= --enable-ipv6 .else @@ -166,9 +178,9 @@ .endfor pre-install: - ${PLISTCAT} | ${AWK} '{ print $$0; } \ - /LIBDIR.*\.py$$/ && !/\/bad/ { print $$0 "o"; print $$0 "c"; }' \ - > ${PLIST} + ${AWK} '{ print $$0; } \ + /LIBDIR.*\.py$$/ && !/\/bad/ { print $$0 "o"; print $$0 "c"; }' \ + ${PKGDIR}/pkg-plist > ${PLIST} post-install: @# shared version of executable and library @@ -180,8 +192,6 @@ ${INSTALL_PROGRAM} \ ${SHARED_WRKSRC}/${PYTHON_VERSION:S/thon/thon-shared/} \ ${PREFIX}/bin - cd ${PREFIX}/bin; \ - ${LN} -f ${PYTHON_VERSION:S/thon/thon-shared/} python-shared @# additional files installing by ports @${MKDIR} ${MANPREFIX}/man/man1 @@ -190,6 +200,13 @@ ${INSTALL_SCRIPT} ${WRKDIR}/pydoc2.4 ${WRKDIR}/idle2.4 \ ${WRKDIR}/smtpd2.4.py ${PREFIX}/bin +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} + for f in ${BIN_SCRIPTS}; do \ + TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \ + cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \ + done +.endif + .if !defined(NOPORTDOCS) @${MKDIR} ${TOOLSDIR} @cd ${WRKSRC}; tar -c --exclude='*CVS*' -f - Tools | \ Index: lang/python24/pkg-plist =================================================================== RCS file: /home/pcvs/ports/lang/python24/pkg-plist,v retrieving revision 1.62 diff -u -r1.62 pkg-plist --- lang/python24/pkg-plist 14 Feb 2007 06:07:29 -0000 1.62 +++ lang/python24/pkg-plist 10 Mar 2007 12:26:16 -0000 @@ -1,13 +1,13 @@ -bin/idle +%%IF_DEFAULT%%bin/idle bin/idle%%PYVER%% -bin/pydoc +%%IF_DEFAULT%%bin/pydoc bin/pydoc%%PYVER%% -bin/python +%%IF_DEFAULT%%bin/python bin/python%%PYVER%% -bin/python-shared +%%IF_DEFAULT%%bin/python-shared bin/python-shared%%PYVER%% +%%IF_DEFAULT%%bin/smtpd.py bin/smtpd%%PYVER%%.py -bin/smtpd.py %%PYTHON_INCLUDEDIR%%/Python.h %%PYTHON_INCLUDEDIR%%/Python-ast.h %%PYTHON_INCLUDEDIR%%/abstract.h @@ -574,7 +574,7 @@ %%PYTHON_LIBDIR%%/lib-dynload/math.so %%PYTHON_LIBDIR%%/lib-dynload/md5.so %%PYTHON_LIBDIR%%/lib-dynload/mmap.so -%%PYTHON_LIBDIR%%/lib-dynload/nis.so +%%NO_NIS%%%%PYTHON_LIBDIR%%/lib-dynload/nis.so %%PYTHON_LIBDIR%%/lib-dynload/operator.so %%PYTHON_LIBDIR%%/lib-dynload/ossaudiodev.so %%PYTHON_LIBDIR%%/lib-dynload/parser.so Index: lang/python24/files/patch-setup.py =================================================================== RCS file: /home/pcvs/ports/lang/python24/files/patch-setup.py,v retrieving revision 1.11 diff -u -r1.11 patch-setup.py --- lang/python24/files/patch-setup.py 14 Feb 2007 06:07:29 -0000 1.11 +++ lang/python24/files/patch-setup.py 10 Mar 2007 12:26:16 -0000 @@ -27,3 +27,13 @@ curses_libs = ['ncursesw'] # Bug 1464056: If _curses.so links with ncursesw, # _curses_panel.so must link with panelw. +@@ -1187,8 +1187,7 @@ + ext_modules=[Extension('struct', ['structmodule.c'])], + + # Scripts to install +- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', +- 'Lib/smtpd.py'] ++ scripts = [] + ) + + # --install-platlib Index: lang/python25/Makefile =================================================================== RCS file: /home/pcvs/ports/lang/python25/Makefile,v retrieving revision 1.143 diff -u -r1.143 Makefile --- lang/python25/Makefile 13 Oct 2006 07:16:45 -0000 1.143 +++ lang/python25/Makefile 10 Mar 2007 12:26:16 -0000 @@ -39,11 +39,10 @@ DEMODIR= ${PREFIX}/share/examples/${PYTHON_VERSION} TOOLSDIR= ${PREFIX}/share/${PYTHON_VERSION} -.if !exists(/usr/bin/ypcat) # the world with NO_NIS -PLIST_EXCLUDE= 'nis.so$$' -.else -PLIST_EXCLUDE= '^$$' # nothing -.endif +BIN_SCRIPTS= idle pydoc python python-shared smtpd.py python-config \ + python-shared-config +BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \ + -e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},' OPTIONS= THREADS "Enable thread support" on \ HUGE_STACK_SIZE "Use a larger thread stack" off \ @@ -54,6 +53,13 @@ .include +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} +MLINKS= ${PYTHON_VERSION}.1 python.1 +PLIST_SUB+= IF_DEFAULT="" +.else +PLIST_SUB+= IF_DEFAULT="@comment " +.endif + # workaround for a bug in base curses.h. CFLAGS+= -D__wchar_t=wchar_t @@ -95,6 +101,12 @@ CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900 .endif +.if !exists(/usr/bin/ypcat) # the world with NO_NIS +PLIST_SUB+= NO_NIS="@comment " +.else +PLIST_SUB+= NO_NIS="" +.endif + .if ${OSVERSION} < 400000 LIB_DEPENDS+= ncurses.5:${PORTSDIR}/devel/ncurses CFLAGS+= -I${LOCALBASE}/include/ncurses -I${LOCALBASE}/include @@ -180,8 +192,7 @@ .endfor pre-install: - ${EGREP} -v ${PLIST_EXCLUDE} ${PLIST_TEMPLATE} | \ - ${AWK} '{ print $$0; } \ + ${CAT} ${PLIST_TEMPLATE} | ${AWK} '{ print $$0; } \ /LIBDIR.*\.py$$/ && !/\/bad/ { print $$0 "o"; print $$0 "c"; }' > ${PLIST} @# if openssl 0.9.8 is detected, _sha{256,512} module won't be installed @@ -211,6 +222,13 @@ ${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \ ${MANPREFIX}/man/man1/${PYTHON_VERSION}.1 +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} + for f in ${BIN_SCRIPTS}; do \ + TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \ + cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \ + done +.endif + .if !defined(NOPORTDOCS) @${MKDIR} ${TOOLSDIR} @cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \ Index: lang/python25/pkg-plist =================================================================== RCS file: /home/pcvs/ports/lang/python25/pkg-plist,v retrieving revision 1.68 diff -u -r1.68 pkg-plist --- lang/python25/pkg-plist 13 Oct 2006 07:16:45 -0000 1.68 +++ lang/python25/pkg-plist 10 Mar 2007 12:26:17 -0000 @@ -1,9 +1,16 @@ +%%IF_DEFAULT%%bin/idle bin/idle%%PYVER%% +%%IF_DEFAULT%%bin/pydoc bin/pydoc%%PYVER%% +%%IF_DEFAULT%%bin/python bin/python%%PYVER%% +%%IF_DEFAULT%%bin/python-config bin/python%%PYVER%%-config +%%IF_DEFAULT%%bin/python-shared bin/python-shared%%PYVER%% +%%IF_DEFAULT%%bin/python-shared-config bin/python-shared%%PYVER%%-config +%%IF_DEFAULT%%bin/smtpd.py bin/smtpd%%PYVER%%.py %%PYTHON_INCLUDEDIR%%/Python-ast.h %%PYTHON_INCLUDEDIR%%/Python.h @@ -670,7 +677,7 @@ %%PYTHON_LIBDIR%%/lib-dynload/itertools.so %%PYTHON_LIBDIR%%/lib-dynload/math.so %%PYTHON_LIBDIR%%/lib-dynload/mmap.so -%%PYTHON_LIBDIR%%/lib-dynload/nis.so +%%NO_NIS%%%%PYTHON_LIBDIR%%/lib-dynload/nis.so %%PYTHON_LIBDIR%%/lib-dynload/operator.so %%PYTHON_LIBDIR%%/lib-dynload/ossaudiodev.so %%PYTHON_LIBDIR%%/lib-dynload/parser.so