summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2002-01-10 20:44:16 +0000
committerdrochner <drochner@pkgsrc.org>2002-01-10 20:44:16 +0000
commit74c274b5a6cc5062f5cce93719133dccba3ca3d9 (patch)
tree9498155451ee5b8c49ed9fa1c7b41b80a553d301 /lang/python
parentb862099d23ce8ad2de3631cd4bdd56e7e6c310cb (diff)
downloadpkgsrc-74c274b5a6cc5062f5cce93719133dccba3ca3d9.tar.gz
split out the python version logics into a separate file, for use by
other buildlink-style files
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/extension.buildlink.mk67
-rw-r--r--lang/python/pyversion.mk65
2 files changed, 67 insertions, 65 deletions
diff --git a/lang/python/extension.buildlink.mk b/lang/python/extension.buildlink.mk
index 2110376cbcb..9f1aa2fe15d 100644
--- a/lang/python/extension.buildlink.mk
+++ b/lang/python/extension.buildlink.mk
@@ -1,69 +1,6 @@
-# $NetBSD: extension.buildlink.mk,v 1.4 2001/12/07 19:47:13 jmc Exp $
-
-.include "../../mk/bsd.prefs.mk"
-
-PYTHON_VERSION_DEFAULT?= 21
-PYTHON_VERSIONS_ACCEPTED?= 21 20
-
-# transform the list into individual variables
-.for pv in ${PYTHON_VERSIONS_ACCEPTED}
-_PYTHON_VERSION_${pv}_OK= yes
-.endfor
-
-# check what is installed
-.if exists(${LOCALBASE}/bin/python2.1)
-_PYTHON_VERSION_21_INSTALLED= yes
-.endif
-.if exists(${LOCALBASE}/bin/python2.0)
-_PYTHON_VERSION_20_INSTALLED= yes
-.endif
-
-#
-# choose a python version where to add,
-# try to be intelligent
-#
-# if the default is already installed, it is first choice
-.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
-.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_INSTALLED)
-_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
-.endif
-.endif
-# prefer an already installed version, in order of "accepted"
-.if !defined(_PYTHON_VERSION)
-.for pv in ${PYTHON_VERSIONS_ACCEPTED}
-.if defined(_PYTHON_VERSION_${pv}_INSTALLED)
-_PYTHON_VERSION?= ${pv}
-.else
-# keep information as last resort - see below
-_PYTHON_VERSION_FIRSTACCEPTED?= ${pv}
-.endif
-.endfor
-.endif
-# if the default is OK for the addon pkg, take this
-.if !defined(_PYTHON_VERSION)
-.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
-_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
-.endif
-.endif
-# take the first one accepted by the package
-.if !defined(_PYTHON_VERSION)
-_PYTHON_VERSION= ${_PYTHON_VERSION_FIRSTACCEPTED}
-.endif
-
-#
-# set variables for the version we decided to use
-#
-.if ${_PYTHON_VERSION} == "21"
-DEPENDS+= python21>=2.1:../../lang/python21
-PYTHONBIN= ${LOCALBASE}/bin/python2.1
-PYPKGPREFIX= py21
-.elif ${_PYTHON_VERSION} == "20"
-#DEPENDS+= python20>=2.0:../../lang/python20
-DEPENDS+= python-2.0.1:../../lang/python
-PYTHONBIN= ${LOCALBASE}/bin/python2.0
-PYPKGPREFIX= py20
-.endif
+# $NetBSD: extension.buildlink.mk,v 1.5 2002/01/10 20:44:16 drochner Exp $
+.include "../../lang/python/pyversion.mk"
#
# below is what used to be in bsd.python.mk
diff --git a/lang/python/pyversion.mk b/lang/python/pyversion.mk
new file mode 100644
index 00000000000..636f2f0c957
--- /dev/null
+++ b/lang/python/pyversion.mk
@@ -0,0 +1,65 @@
+# $NetBSD: pyversion.mk,v 1.1 2002/01/10 20:44:16 drochner Exp $
+
+.include "../../mk/bsd.prefs.mk"
+
+PYTHON_VERSION_DEFAULT?= 21
+PYTHON_VERSIONS_ACCEPTED?= 21 20
+
+# transform the list into individual variables
+.for pv in ${PYTHON_VERSIONS_ACCEPTED}
+_PYTHON_VERSION_${pv}_OK= yes
+.endfor
+
+# check what is installed
+.if exists(${LOCALBASE}/bin/python2.1)
+_PYTHON_VERSION_21_INSTALLED= yes
+.endif
+.if exists(${LOCALBASE}/bin/python2.0)
+_PYTHON_VERSION_20_INSTALLED= yes
+.endif
+
+#
+# choose a python version where to add,
+# try to be intelligent
+#
+# if the default is already installed, it is first choice
+.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
+.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_INSTALLED)
+_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
+.endif
+.endif
+# prefer an already installed version, in order of "accepted"
+.if !defined(_PYTHON_VERSION)
+.for pv in ${PYTHON_VERSIONS_ACCEPTED}
+.if defined(_PYTHON_VERSION_${pv}_INSTALLED)
+_PYTHON_VERSION?= ${pv}
+.else
+# keep information as last resort - see below
+_PYTHON_VERSION_FIRSTACCEPTED?= ${pv}
+.endif
+.endfor
+.endif
+# if the default is OK for the addon pkg, take this
+.if !defined(_PYTHON_VERSION)
+.if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
+_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
+.endif
+.endif
+# take the first one accepted by the package
+.if !defined(_PYTHON_VERSION)
+_PYTHON_VERSION= ${_PYTHON_VERSION_FIRSTACCEPTED}
+.endif
+
+#
+# set variables for the version we decided to use
+#
+.if ${_PYTHON_VERSION} == "21"
+DEPENDS+= python21>=2.1:../../lang/python21
+PYTHONBIN= ${LOCALBASE}/bin/python2.1
+PYPKGPREFIX= py21
+.elif ${_PYTHON_VERSION} == "20"
+#DEPENDS+= python20>=2.0:../../lang/python20
+DEPENDS+= python-2.0.1:../../lang/python
+PYTHONBIN= ${LOCALBASE}/bin/python2.0
+PYPKGPREFIX= py20
+.endif