diff options
author | lwhsu <lwhsu@FreeBSD.org> | 2012-12-24 01:52:46 +0800 |
---|---|---|
committer | lwhsu <lwhsu@FreeBSD.org> | 2012-12-24 01:52:46 +0800 |
commit | 159b6f81ef3041b1f3ac02317185100f0155986b (patch) | |
tree | 7b7863a91726bf0c0cdaa1808b76f78087314103 /lang/python26 | |
parent | 0941203f470bc1cb0633aa70f65b53561df81f82 (diff) | |
download | freebsd-ports-gnome-159b6f81ef3041b1f3ac02317185100f0155986b.tar.gz freebsd-ports-gnome-159b6f81ef3041b1f3ac02317185100f0155986b.tar.zst freebsd-ports-gnome-159b6f81ef3041b1f3ac02317185100f0155986b.zip |
- Remove "first-installed-win" logic for automatically setting
${PYTHON_DEFAULT_VERSION}, this generates conflicting packages.
- Create symbolic links as PEP 394 [1] suggests. ${PYTHON_DEFAULT_VERSION}
will create python and python${MAJOR_VERSION} links. In current default,
lang/python27 will create: python -> python2 -> python2.7
- Introduce ${PYTHON3_DEFAULT_VERSION}, which will handle bin/python3 link.
At this point, lang/python33 will create python3 -> python3.3
- Minor cleanups
* Trim Makefile headers
* Remove ${OSVERSION} detection for xz, whihc is done by USE_XZ
[1] http://www.python.org/dev/peps/pep-0394/
Diffstat (limited to 'lang/python26')
-rw-r--r-- | lang/python26/Makefile | 33 | ||||
-rw-r--r-- | lang/python26/pkg-plist | 8 |
2 files changed, 25 insertions, 16 deletions
diff --git a/lang/python26/Makefile b/lang/python26/Makefile index 2adcaa387949..7ef43154d4a2 100644 --- a/lang/python26/Makefile +++ b/lang/python26/Makefile @@ -1,13 +1,9 @@ -# New ports collection makefile for: python26 -# Date created: 3 July 2003 -# Whom: Hye-Shik Chang <perky@FreeBSD.org> -# +# Created by: Hye-Shik Chang <perky@FreeBSD.org> # $FreeBSD$ -# PORTNAME= python26 PORTVERSION= 2.6.8 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= lang python ipv6 MASTER_SITES= ${PYTHON_MASTER_SITES} MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR} @@ -37,6 +33,7 @@ SHARED_WRKSRC= ${PYTHON_WRKSRC}/portbld.shared PLIST= ${WRKDIR}/PLIST PLIST_TEMPLATE?=${PKGDIR}/pkg-plist PLIST_SUB= PYVER=${PYTHON_VERSION:S/python//} \ + PYMAJOR=${PYTHON_MAJOR_VER} \ PYVER_WITHPAT=${PORTVERSION:S/.c/c/} EXAMPLESDIR= ${PREFIX}/share/examples/${PYTHON_VERSION} DATADIR= ${PREFIX}/share/${PYTHON_VERSION} @@ -47,9 +44,11 @@ PLATFORMS= plat-freebsd6 plat-freebsd7 plat-freebsd8 plat-freebsd9 \ BIN_SCRIPTS= 2to3 idle pydoc smtpd.py BIN_FILES= python python-shared python-config python-shared-config \ ${BIN_SCRIPTS} -BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \ - -e 's,2to3,2to3-${PYTHON_VER},' \ - -e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},' +BINLINKS_SUB_TMPL= -e 's,smtpd,smtpd%%VERSION%%,' \ + -e 's,2to3,2to3-%%VERSION%%,' \ + -e 's,(idle|pydoc|python-shared|python),\1%%VERSION%%,' +BINLINKS_SUB_PYTHON_VER= ${BINLINKS_SUB_TMPL:S/%%VERSION%%/${PYTHON_VER}/g} +BINLINKS_SUB_PYTHON_MAJOR_VER= ${BINLINKS_SUB_TMPL:S/%%VERSION%%/${PYTHON_MAJOR_VER}/g} OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES NLS OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6 @@ -67,14 +66,14 @@ SEM_MSG= "" .else IGNORE= POSIX semaphore support only works in FreeBSD 7-STABLE and later .endif # ${OSVERSION} >= 701106 -.else +.else SEM_MSG= "@comment " .endif SUB_FILES= pkg-message SUB_LIST= SEM=${SEM_MSG} -.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python) +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} MLINKS= ${PYTHON_VERSION}.1 python.1 PLIST_SUB+= IF_DEFAULT="" .else @@ -161,7 +160,7 @@ pre-patch: .for script in ${BIN_SCRIPTS} ${SED} -e '1s,^.*$$,#!${PREFIX}/bin/${PYTHON_VERSION},' \ ${PATCH_WRKSRC}/Tools/scripts/${script} \ - > ${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB}` + > ${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB_PYTHON_VER}` .endfor ${REINPLACE_CMD} -e \ 's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \ @@ -257,17 +256,19 @@ post-install: @# additional files installing by ports .for script in ${BIN_SCRIPTS} ${INSTALL_SCRIPT} \ - ${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB}` \ + ${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB_PYTHON_VER}` \ ${PREFIX}/bin .endfor @${MKDIR} ${MANPREFIX}/man/man1 ${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \ ${MANPREFIX}/man/man1/${PYTHON_VERSION}.1 -.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python) +.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} for f in ${BIN_FILES}; do \ - TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \ - cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \ + TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB_PYTHON_VER}`; \ + TARGET_MAJOR=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB_PYTHON_MAJOR_VER}`; \ + cd ${PREFIX}/bin && ${LN} -sf $$TARGET $$TARGET_MAJOR; \ + cd ${PREFIX}/bin && ${LN} -sf $$TARGET_MAJOR $$f; \ done .endif diff --git a/lang/python26/pkg-plist b/lang/python26/pkg-plist index df1d65348528..d44b076734c0 100644 --- a/lang/python26/pkg-plist +++ b/lang/python26/pkg-plist @@ -1,18 +1,26 @@ %%IF_DEFAULT%%bin/2to3 +%%IF_DEFAULT%%bin/2to3-%%PYMAJOR%% bin/2to3-%%PYVER%% %%IF_DEFAULT%%bin/idle +%%IF_DEFAULT%%bin/idle%%PYMAJOR%% bin/idle%%PYVER%% %%IF_DEFAULT%%bin/pydoc +%%IF_DEFAULT%%bin/pydoc%%PYMAJOR%% bin/pydoc%%PYVER%% %%IF_DEFAULT%%bin/python +%%IF_DEFAULT%%bin/python%%PYMAJOR%% bin/python%%PYVER%% %%IF_DEFAULT%%bin/python-config +%%IF_DEFAULT%%bin/python%%PYMAJOR%%-config bin/python%%PYVER%%-config %%IF_DEFAULT%%bin/python-shared +%%IF_DEFAULT%%bin/python-shared%%PYMAJOR%% bin/python-shared%%PYVER%% %%IF_DEFAULT%%bin/python-shared-config +%%IF_DEFAULT%%bin/python-shared%%PYMAJOR%%-config bin/python-shared%%PYVER%%-config %%IF_DEFAULT%%bin/smtpd.py +%%IF_DEFAULT%%bin/smtpd%%PYMAJOR%%.py bin/smtpd%%PYVER%%.py %%PYTHON_INCLUDEDIR%%/Python-ast.h %%PYTHON_INCLUDEDIR%%/Python.h |