Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2012 17:52:47 +0000 (UTC)
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r309444 - in head: Mk lang/python26 lang/python27 lang/python31 lang/python32 lang/python33
Message-ID:  <201212231752.qBNHqlKM039907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lwhsu
Date: Sun Dec 23 17:52:46 2012
New Revision: 309444
URL: http://svnweb.freebsd.org/changeset/ports/309444

Log:
  - 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/

Modified:
  head/Mk/bsd.python.mk
  head/lang/python26/Makefile
  head/lang/python26/pkg-plist
  head/lang/python27/Makefile
  head/lang/python27/pkg-plist
  head/lang/python31/Makefile
  head/lang/python31/pkg-plist
  head/lang/python32/Makefile
  head/lang/python32/pkg-plist
  head/lang/python33/Makefile
  head/lang/python33/pkg-plist

Modified: head/Mk/bsd.python.mk
==============================================================================
--- head/Mk/bsd.python.mk	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/Mk/bsd.python.mk	Sun Dec 23 17:52:46 2012	(r309444)
@@ -87,6 +87,12 @@ Python_Include_MAINTAINER=	python@FreeBS
 #					  in case you want to use an older version as a default.
 #					  default: python2.7
 #
+# PYTHON3_DEFAULT_VERSION
+#					- Version of the default python binary in your ${PATH}, in
+#					  the format "python3.2". Set this in your /etc/make.conf
+#					  in case you want to use an older version as a default.
+#					  default: python3.3
+#
 # PYTHON_MAJOR_VER	- Python version major number. 2 for python-2.x,
 #					  3 for python-3.x and so on.
 #
@@ -274,6 +280,12 @@ _PYTHON_DEFAULT_VERSION=	${_PYTHON_PORTB
 PYTHON_DEFAULT_VERSION=		python${_PYTHON_DEFAULT_VERSION}
 .endif
 
+.if ${PYTHON_DEFAULT_VERSION:R} == "python3"
+PYTHON3_DEFAULT_VERSION=	${PYTHON_DEFAULT_VERSION}
+.else
+PYTHON3_DEFAULT_VERSION=	python3.3
+.endif
+
 .if defined(PYTHON_VERSION)
 _PYTHON_VERSION:=	${PYTHON_VERSION:S/^python//}
 _PYTHON_CMD=		${LOCALBASE}/bin/${PYTHON_VERSION}

Modified: head/lang/python26/Makefile
==============================================================================
--- head/lang/python26/Makefile	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python26/Makefile	Sun Dec 23 17:52:46 2012	(r309444)
@@ -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.
 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 p
 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
 

Modified: head/lang/python26/pkg-plist
==============================================================================
--- head/lang/python26/pkg-plist	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python26/pkg-plist	Sun Dec 23 17:52:46 2012	(r309444)
@@ -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

Modified: head/lang/python27/Makefile
==============================================================================
--- head/lang/python27/Makefile	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python27/Makefile	Sun Dec 23 17:52:46 2012	(r309444)
@@ -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=	python27
 PORTVERSION=	2.7.3
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -48,9 +44,11 @@ PLATFORMS=	plat-freebsd6 plat-freebsd7 p
 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
@@ -75,7 +73,7 @@ SEM_MSG=	"@comment "
 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
@@ -159,7 +157,6 @@ CONFIGURE_ARGS+=	--disable-ipv6
 CONFIGURE_ARGS+=	--with-fpectl
 .endif
 
-
 CONFIGURE_ENV+=	OPT="${CFLAGS} ${_PTH_CPPFLAGS}"
 
 post-extract:
@@ -178,7 +175,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' \
@@ -274,17 +271,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
 

Modified: head/lang/python27/pkg-plist
==============================================================================
--- head/lang/python27/pkg-plist	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python27/pkg-plist	Sun Dec 23 17:52:46 2012	(r309444)
@@ -1,21 +1,27 @@
 libdata/pkgconfig/python-2.7.pc
 %%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
-bin/python%%PYMAJOR%%
+%%IF_DEFAULT%%bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
-bin/python%%PYMAJOR%%-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

Modified: head/lang/python31/Makefile
==============================================================================
--- head/lang/python31/Makefile	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python31/Makefile	Sun Dec 23 17:52:46 2012	(r309444)
@@ -1,13 +1,8 @@
-# New ports collection makefile for:    python31
-# Date created:         2009-06-28
-# Whom:                 Li-Wen Hsu <lwhsu@FreeBSD.org>
-#
 # $FreeBSD$
-#
 
 PORTNAME=	python31
 PORTVERSION=	3.1.5
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -37,6 +32,7 @@ SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.
 PLIST=		${WRKDIR}/PLIST
 PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
+		PYMAJOR=${PYTHON_MAJOR_VER} \
 		PYVER_WITHPAT=${PORTVERSION:S/.rc/rc/}
 EXAMPLESDIR=	${PREFIX}/share/examples/${PYTHON_VERSION}
 DATADIR=	${PREFIX}/share/${PYTHON_VERSION}
@@ -58,13 +54,19 @@ NLS_DESC=	Enable Gettext support for the
 
 .include <bsd.port.pre.mk>
 
-.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
 PLIST_SUB+=	IF_DEFAULT="@comment "
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
+PLIST_SUB+=	IF_DEFAULT_MAJOR=""
+.else
+PLIST_SUB+=	IF_DEFAULT_MAJOR="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MNLS}
 USE_GETTEXT=	yes
 # XXX do not set any LDFLAGS or CFLAGS - this causes pyexpat to fail building
@@ -216,13 +218,19 @@ post-install:
 	${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; \
+		cd ${PREFIX}/bin && ${LN} -sf $$TARGET $$f; \
 	done
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
+.for file in python python-config
+	cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR_VER}/}
+.endfor
+.endif
+
 .if !defined(NOPORTDATA)
 	@${MKDIR} ${DATADIR}
 	@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \

Modified: head/lang/python31/pkg-plist
==============================================================================
--- head/lang/python31/pkg-plist	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python31/pkg-plist	Sun Dec 23 17:52:46 2012	(r309444)
@@ -5,8 +5,10 @@ bin/idle3-%%PYVER%%
 %%IF_DEFAULT%%bin/pydoc3
 bin/pydoc3-%%PYVER%%
 %%IF_DEFAULT%%bin/python
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%-config
 bin/python%%PYVER%%-config
 %%IF_DEFAULT%%bin/python-shared
 bin/python-shared%%PYVER%%

Modified: head/lang/python32/Makefile
==============================================================================
--- head/lang/python32/Makefile	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python32/Makefile	Sun Dec 23 17:52:46 2012	(r309444)
@@ -1,13 +1,8 @@
-# New ports collection makefile for:    python31
-# Date created:         2009-06-28
-# Whom:                 Li-Wen Hsu <lwhsu@FreeBSD.org>
-#
 # $FreeBSD$
-#
 
 PORTNAME=	python32
 PORTVERSION=	3.2.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -37,6 +32,7 @@ PYABIVER=	# default empty, for after app
 
 SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.shared
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
+		PYMAJOR=${PYTHON_MAJOR_VER} \
 		PYVER_WITHPAT=${PORTVERSION:S/.rc/rc/} \
 		PYABIVER=${PYABIVER}
 EXAMPLESDIR=	${PREFIX}/share/examples/${PYTHON_VERSION}
@@ -59,13 +55,19 @@ NLS_DESC=	Enable Gettext support for the
 
 .include <bsd.port.pre.mk>
 
-.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
 PLIST_SUB+=	IF_DEFAULT="@comment "
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
+PLIST_SUB+=	IF_DEFAULT_MAJOR=""
+.else
+PLIST_SUB+=	IF_DEFAULT_MAJOR="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MNLS}
 USE_GETTEXT=	yes
 # XXX do not set any LDFLAGS or CFLAGS - this causes pyexpat to fail building
@@ -209,13 +211,19 @@ post-install:
 	${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; \
+		cd ${PREFIX}/bin && ${LN} -sf $$TARGET $$f; \
 	done
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
+.for file in python python-config
+	cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR_VER}/}
+.endfor
+.endif
+
 .if !defined(NOPORTDATA)
 	@${MKDIR} ${DATADIR}
 	@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \

Modified: head/lang/python32/pkg-plist
==============================================================================
--- head/lang/python32/pkg-plist	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python32/pkg-plist	Sun Dec 23 17:52:46 2012	(r309444)
@@ -5,8 +5,10 @@ bin/idle3-%%PYVER%%
 %%IF_DEFAULT%%bin/pydoc3
 bin/pydoc3-%%PYVER%%
 %%IF_DEFAULT%%bin/python
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%-config
 bin/python%%PYVER%%-config
 %%IF_DEFAULT%%bin/python-shared
 bin/python-shared%%PYVER%%

Modified: head/lang/python33/Makefile
==============================================================================
--- head/lang/python33/Makefile	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python33/Makefile	Sun Dec 23 17:52:46 2012	(r309444)
@@ -1,13 +1,8 @@
-# New ports collection makefile for:    python31
-# Date created:         2009-06-28
-# Whom:                 Li-Wen Hsu <lwhsu@FreeBSD.org>
-#
 # $FreeBSD$
-#
 
 PORTNAME=	python33
 PORTVERSION=	3.3.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -61,19 +56,19 @@ NLS_DESC=	Enable Gettext support for the
 
 .include <bsd.port.pre.mk>
 
-.if ${OSVERSION} < 800505
-BUILD_DEPENDS+=	xz>0:${PORTSDIR}/archivers/xz	# Needed for lzma support
-LDFLAGS+=	"-L${LOCALBASE}/lib"
-CFLAGS+=	"-I${LOCALBASE}/include"
-.endif
-
-.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
 PLIST_SUB+=	IF_DEFAULT="@comment "
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
+PLIST_SUB+=	IF_DEFAULT_MAJOR=""
+.else
+PLIST_SUB+=	IF_DEFAULT_MAJOR="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MNLS}
 USE_GETTEXT=	yes
 # XXX do not set any LDFLAGS or CFLAGS - this causes pyexpat to fail building
@@ -212,16 +207,18 @@ post-install:
 	${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; \
+		cd ${PREFIX}/bin && ${LN} -sf $$TARGET $$f; \
 	done
 .endif
 
+.if ${PYTHON_VERSION} == ${PYTHON3_DEFAULT_VERSION}
 .for file in python python-config
 	cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR_VER}/}
 .endfor
+.endif
 
 .if !defined(NOPORTDATA)
 	@${MKDIR} ${DATADIR}

Modified: head/lang/python33/pkg-plist
==============================================================================
--- head/lang/python33/pkg-plist	Sun Dec 23 17:52:24 2012	(r309443)
+++ head/lang/python33/pkg-plist	Sun Dec 23 17:52:46 2012	(r309444)
@@ -5,10 +5,10 @@ bin/idle3-%%PYVER%%
 %%IF_DEFAULT%%bin/pydoc3
 bin/pydoc3-%%PYVER%%
 %%IF_DEFAULT%%bin/python
-bin/python%%PYMAJOR%%
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
-bin/python%%PYMAJOR%%-config
+%%IF_DEFAULT_MAJOR%%bin/python%%PYMAJOR%%-config
 bin/python%%PYVER%%-config
 %%IF_DEFAULT%%bin/python-shared
 bin/python-shared%%PYVER%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212231752.qBNHqlKM039907>