aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python31/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python31/Makefile')
-rw-r--r--lang/python31/Makefile26
1 files changed, 17 insertions, 9 deletions
diff --git a/lang/python31/Makefile b/lang/python31/Makefile
index 59c32c55ffea..7709a6ffc311 100644
--- a/lang/python31/Makefile
+++ b/lang/python31/Makefile
@@ -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.shared
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 locale module
.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 | \