summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2002-01-15 17:18:01 +0000
committerdrochner <drochner@pkgsrc.org>2002-01-15 17:18:01 +0000
commit654df296a8c5cb5e7d4d89a078930d59e63de080 (patch)
tree76eb96be3a0202dd5dc1cb5cd68ef2534da04169 /lang/python
parent79aa8807f5749f9e67ccb9ada6a9489b3181a9dc (diff)
downloadpkgsrc-654df296a8c5cb5e7d4d89a078930d59e63de080.tar.gz
-protect against multiple inclusion
-know about Python-2.2 -add a way to override the version selection by a variable "PYTHON_VERSION_REQD"
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/pyversion.mk24
1 files changed, 21 insertions, 3 deletions
diff --git a/lang/python/pyversion.mk b/lang/python/pyversion.mk
index 636f2f0c957..1ce573dd0ab 100644
--- a/lang/python/pyversion.mk
+++ b/lang/python/pyversion.mk
@@ -1,9 +1,12 @@
-# $NetBSD: pyversion.mk,v 1.1 2002/01/10 20:44:16 drochner Exp $
+# $NetBSD: pyversion.mk,v 1.2 2002/01/15 17:18:01 drochner Exp $
+
+.if !defined(PYTHON_PYVERSION_MK)
+PYTHON_PYVERSION_MK= defined
.include "../../mk/bsd.prefs.mk"
PYTHON_VERSION_DEFAULT?= 21
-PYTHON_VERSIONS_ACCEPTED?= 21 20
+PYTHON_VERSIONS_ACCEPTED?= 22 21 20
# transform the list into individual variables
.for pv in ${PYTHON_VERSIONS_ACCEPTED}
@@ -11,6 +14,9 @@ _PYTHON_VERSION_${pv}_OK= yes
.endfor
# check what is installed
+.if exists(${LOCALBASE}/bin/python2.2)
+_PYTHON_VERSION_22_INSTALLED= yes
+.endif
.if exists(${LOCALBASE}/bin/python2.1)
_PYTHON_VERSION_21_INSTALLED= yes
.endif
@@ -22,12 +28,18 @@ _PYTHON_VERSION_20_INSTALLED= yes
# choose a python version where to add,
# try to be intelligent
#
+# if a version is explicitely required, take it
+.if defined(PYTHON_VERSION_REQD)
+_PYTHON_VERSION= ${PYTHON_VERSION_REQD}
+.endif
# if the default is already installed, it is first choice
+.if !defined(_PYTHON_VERSION)
.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_INSTALLED)
_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
.endif
.endif
+.endif
# prefer an already installed version, in order of "accepted"
.if !defined(_PYTHON_VERSION)
.for pv in ${PYTHON_VERSIONS_ACCEPTED}
@@ -53,7 +65,11 @@ _PYTHON_VERSION= ${_PYTHON_VERSION_FIRSTACCEPTED}
#
# set variables for the version we decided to use
#
-.if ${_PYTHON_VERSION} == "21"
+.if ${_PYTHON_VERSION} == "22"
+DEPENDS+= python22>=2.2:../../lang/python22
+PYTHONBIN= ${LOCALBASE}/bin/python2.2
+PYPKGPREFIX= py22
+.elif ${_PYTHON_VERSION} == "21"
DEPENDS+= python21>=2.1:../../lang/python21
PYTHONBIN= ${LOCALBASE}/bin/python2.1
PYPKGPREFIX= py21
@@ -63,3 +79,5 @@ DEPENDS+= python-2.0.1:../../lang/python
PYTHONBIN= ${LOCALBASE}/bin/python2.0
PYPKGPREFIX= py20
.endif
+
+.endif # PYTHON_PYVERSION_MK