[csw-maintainers] Python 2.7

Peter FELECAN pfelecan at opencsw.org
Mon Jul 29 14:37:41 CEST 2013


"Maciej (Matchek) Bliziński" <maciej at opencsw.org> writes:

> 2013/7/29 Peter FELECAN <pfelecan at opencsw.org>:
>> What we should do is to supply the compiled files in the package, for
>> each version for which the maintainer thinks that it's
>> adequate. Simpler and leaner, isn't it?
>
> You certainly have a point.
>
> I talked to folks on the #debian-python channel and asked them about
> the reasons behind this policy decision. They didn't know of any
> failure modes, it boiled down to saving mirror disk space and
> bandwidth.

Yeah. Exactly the arguments when wrangling on similar issues with Philip
Brown. Consequently, we should change our ways...

On the other hand, I changed the following files in .buildsys/v2,
following your proposal:

Index: v2/categories/python/category.mk
===================================================================
--- v2/categories/python/category.mk	(revision 21547)
+++ v2/categories/python/category.mk	(working copy)
@@ -1,5 +1,5 @@
 # Add a dependency to CSWpython
-_EXTRA_GAR_PKGS += CSWpython
+_EXTRA_GAR_PKGS += $(PYTHON_PACKAGE)
 
 # For the record, do not include the following line:
 # _MERGE_EXCLUDE_CATEGORY += .*\.egg-info.*
@@ -28,11 +28,11 @@
 LICENSE ?= PKG-INFO
 SPKG_SOURCEURL ?= http://pypi.python.org/pypi/$(NAME)
 MASTER_SITES ?= $(PYPI_MIRROR)
-PACKAGES ?= CSWpy-$(DASHED_NAME)
+PACKAGES ?= $(PYTHON_MODULE_PACKAGE_PREFIX)$(DASHED_NAME)
 
 # for use in any references by specific recipes so it can be replaced easily
 # across the tree.  this could later be parameterized for use by multiple
 # versions of python too.
-SITE_PACKAGES = $(libdir)/python2.6/site-packages
+SITE_PACKAGES = $(PYTHON_SITE_PACKAGES)
 
 include gar/gar.mk

Index: v2/gar.conf.mk
===================================================================
--- v2/gar.conf.mk	(revision 21547)
+++ v2/gar.conf.mk	(working copy)
@@ -869,6 +869,31 @@
 
 INSTALL_SCRIPTS   ?= $(WORKSRC)/Makefile
 
+#
+# Python configuration
+
+PYTHON_VERSION ?= 2_6
+
+PYTHON_EXECUTABLE_2_6 = /opt/csw/bin/python2.6
+PYTHON_EXECUTABLE_2_7 = /opt/csw/bin/python2.7
+PYTHON_EXECUTABLE_3_3 = /opt/csw/bin/python3.3
+PYTHON_EXECUTABLE = $(PYTHON_EXECUTABLE_$(PYTHON_VERSION))
+
+PYTHON_PACKAGE_2_6 = CSWpython
+PYTHON_PACKAGE_2_7 = CSWpython27
+PYTHON_PACKAGE_3_3 = CSWpython33
+PYTHON_PACKAGE = $(PYTHON_PACKAGE_$(PYTHON_VERSION))
+
+PYTHON_SITE_PACKAGES_2_6 = $(libdir)/python2.6/site-packages
+PYTHON_SITE_PACKAGES_2_7 = $(libdir)/python2.7/site-packages
+PYTHON_SITE_PACKAGES_3_3 = $(libdir)/python3.3/site-packages
+PYTHON_SITE_PACKAGES = $(PYTHON_SITE_PACKAGES_$(PYTHON_VERSION))
+
+PYTHON_MODULE_PACKAGE_PREFIX_2_6 = CSWpy-
+PYTHON_MODULE_PACKAGE_PREFIX_2_7 = CSWpy-
+PYTHON_MODULE_PACKAGE_PREFIX_3_3 = CSWpy33-
+PYTHON_MODULE_PACKAGE_PREFIX = $(PYTHON_MODULE_PACKAGE_PREFIX_$(PYTHON_VERSION))
+
 # Global environment
 export PATH PKG_CONFIG_PATH
 

Index: v2/gar.lib.mk
===================================================================
--- v2/gar.lib.mk	(revision 21547)
+++ v2/gar.lib.mk	(working copy)
@@ -910,7 +910,7 @@
 PYBUILD_CMD ?= build
 build-%/setup.py:
 	@echo " ==> Running setup.py $(PYBUILD_TYPE) in $*"
-	@( cd $* ; $(BUILD_ENV) python ./setup.py $(PYBUILD_CMD) $(BUILD_ARGS) )
+	@( cd $* ; $(BUILD_ENV) $(PYTHON_EXECUTABLE) ./setup.py $(PYBUILD_CMD) $(BUILD_ARGS) )
 	@$(MAKECOOKIE)
 
 #################### CLEAN RULES ####################
@@ -988,6 +988,7 @@
 test-%/setup.py:
 	@echo " ==> Running setup.py test in $*"
 	@( cd $* ; cd $(OBJDIR) ; $(TEST_ENV) python ./setup.py test $(TEST_ARGS) )
+	@( cd $* ; cd $(OBJDIR) ; $(TEST_ENV) $(PYTHON_EXECUTABLE) ./setup.py test $(TEST_ARGS) )
 	@$(MAKECOOKIE)
 
 ################# INSTALL RULES ####################
@@ -1035,7 +1036,7 @@
 PYINSTALL_CMD ?= install
 install-%/setup.py:
 	@echo " ==> Running setup.py $(PYINSTALL_CMD) in $*"
-	@( cd $* ; $(INSTALL_ENV) python ./setup.py $(PYINSTALL_CMD) $(INSTALL_ARGS) )
+	@( cd $* ; $(INSTALL_ENV) $(PYTHON_EXECUTABLE) ./setup.py $(PYINSTALL_CMD) $(INSTALL_ARGS) )
 	@$(MAKECOOKIE)
 
 # pkg-config scripts

the only omission is using a different prefix for 2.6 and 2.7 packages.

Tested it thoroughly and everything seems alright.

Do you mind if I commit these changes? This way we have a necessary and
sufficient set of changes to support our new toy...
-- 
Peter


More information about the maintainers mailing list