20674483 change Userland Python default version from 2.6 to 2.7
authorJohn Beck <John.Beck@Oracle.COM>
Thu, 12 Mar 2015 07:59:21 -0700
changeset 3936 c344422ee38b
parent 3934 eb6d9a880b40
child 3937 11d6d96320f9
20674483 change Userland Python default version from 2.6 to 2.7
components/apache2-modules/mod_wsgi/Makefile
components/lcms/Makefile
components/libxml2/Makefile
components/libxslt/Makefile
components/net-snmp/Makefile
components/openscap/Makefile
components/python/ipython/Makefile
make-rules/shared-macros.mk
--- a/components/apache2-modules/mod_wsgi/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/apache2-modules/mod_wsgi/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -46,7 +46,7 @@
 VARIANT_AP_22_PY26 = $(BUILD_DIR)/apache22-python26
 VARIANT_AP_22_PY27 = $(BUILD_DIR)/apache22-python27
 VARIANT_AP_22_PY34 = $(BUILD_DIR)/apache22-python34
-VARIANT_AP_24_PY26 = $(BUILD_DIR)/apache24-pytohn26
+VARIANT_AP_24_PY26 = $(BUILD_DIR)/apache24-python26
 VARIANT_AP_24_PY27 = $(BUILD_DIR)/apache24-python27
 VARIANT_AP_24_PY34 = $(BUILD_DIR)/apache24-python34
 
--- a/components/lcms/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/lcms/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -61,6 +61,10 @@
 CXXFLAGS += -features=extensions,nestedaccess,tmplrefstatic
 CXXFLAGS += -template=geninlinefuncs
 
+# When 2.6 goes away, we can remove the version line below, as well as the
+# COMPONENT_POST_{CONFIGURE,INSTALL_ACTION} lines below.
+PYTHON_VERSION=2.6
+
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_ENV += PYTHON="$(PYTHON)"
--- a/components/libxml2/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/libxml2/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -53,6 +53,9 @@
 CFLAGS +=	$(CPP_LARGEFILES)
 LDFLAGS +=	$(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
 
+# Once Python 2.6 goes away, the various POST_*_ACTIONs below can be simplified.
+PYTHON_VERSION=2.6
+
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-threads
--- a/components/libxslt/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/libxslt/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -49,6 +49,10 @@
 CFLAGS +=	$(CPP_LARGEFILES)
 LDFLAGS +=	$(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
 
+# When 2.6 goes away, we can remove the version line below, as well as the
+# COMPONENT_POST_{CONFIGURE,INSTALL_ACTION} lines below.
+PYTHON_VERSION=2.6
+
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
--- a/components/net-snmp/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/net-snmp/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -90,6 +90,11 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
 
+# After Python 2.6 goes away, the COMPONENT_POST_{CONFIGURE,INSTALL}_ACTIONs
+# below can go away as well (for INSTALL_ACTION, 32-bit goes away; 64-bit
+# remains).
+PYTHON_VERSION=2.6
+
 # After we have configured, make a copy of the python bits so we
 # can build separate python 2.7 support.
 COMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7)
--- a/components/openscap/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/openscap/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -42,7 +42,10 @@
 CFLAGS+=		-DNDEBUG
 CFLAGS+=		-DOSCAP_THREAD_SAFE
 
-PYTHON_VERSIONS=	2.7 2.6
+# When Python 2.6 goes away, the _VERSION (singular) line below can go as well,
+# as can the COMPONENT_POST_CONFIGURE_ACTION and possibly more.
+PYTHON_VERSION=		2.6
+PYTHON_VERSIONS=	$(PYTHON2_VERSIONS)
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/configure.mk
--- a/components/python/ipython/Makefile	Wed Mar 11 08:28:16 2015 -0700
+++ b/components/python/ipython/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -38,31 +38,29 @@
 TPNO=			9640
 
 # Syntax issues: not Python 3 ready.
-PYTHON_VERSIONS = 2.7 2.6
+PYTHON_VERSIONS = $(PYTHON2_VERSIONS)
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/setup.py.mk
 include $(WS_MAKE_RULES)/ips.mk
 
-# Replace "#!/usr/bin/env ..." shebang lines with properly versioned ones.
-COMPONENT_PRE_BUILD_ACTION = \
-	/usr/bin/find $(SOURCE_DIR) -name *.py \
-		-exec $(GSED) -i -e 's/env python/python$(PYTHON_VERSION)/' "{}" \; ;
-
 # Unpack the ipython man pages.
 COMPONENT_POST_UNPACK_ACTION = \
 	(cd $(SOURCE_DIR)/docs/man; /usr/bin/gunzip * )
 
+# Replace "#!/usr/bin/env ..." shebang lines with properly versioned ones.
+COMPONENT_POST_INSTALL_ACTION = \
+	/usr/bin/find $(PROTOUSRLIBDIR)/python$(PYTHON_VERSION) -name *.py \
+		-exec $(GSED) -i -e 's|env python|python$(PYTHON_VERSION)|' "{}" \; ;
+
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-# common targets
 build:          $(BUILD_32)
 
 install:        $(INSTALL_32)
 
 test:           $(NO_TESTS)
 
-
 REQUIRED_PACKAGES += library/python/python-twisted-26
 REQUIRED_PACKAGES += library/python/python-twisted-27
 REQUIRED_PACKAGES += library/python/setuptools-26
--- a/make-rules/shared-macros.mk	Wed Mar 11 08:28:16 2015 -0700
+++ b/make-rules/shared-macros.mk	Thu Mar 12 07:59:21 2015 -0700
@@ -94,12 +94,9 @@
 COMPILER ?=		studio
 BITS =			32
 
-# If we are building multiple versions of python, make sure that python 2.6
-# is installed last and is the canonical version.  When we change defaults,
-# the new default should go last.  For now, this is most easily done by
-# listing version in descending order.
-PYTHON_VERSION =	2.6
-PYTHON2_VERSIONS =	2.7 2.6
+# The default version should go last.
+PYTHON_VERSION =	2.7
+PYTHON2_VERSIONS =	2.6 2.7
 PYTHON3_VERSIONS =	3.4
 PYTHON_VERSIONS =	$(PYTHON3_VERSIONS) $(PYTHON2_VERSIONS)