tag 628820 + patch
thanks

Hi Jakub (2011.06.01_17:57:11_+0200)
> silo-llnl tries to build Python extension modules for all supported
> Python versions, but it doesn't build-depend on python-all-dev,
> which is needed to do that.

That's not the only thing missing. It also doesn't clean tools/python
before building for the next version, and it only runs the test suite
for one Python version.

Attached is a patch to build (but *not* test) for all python versions.
It only tests for the last python version built, which probably isn't
ideal.

Note that now the tests will fail due to:
https://visitbugs.ornl.gov/issues/744

And if the test suite was run under Python 2.6, it would fail due to:
https://visitbugs.ornl.gov/issues/747

I assume the Python2.7 incompatibility issue above is the reason this
bug hasn't been touched, but I'd already looked at it and prepared a
patch, so here it is.

It may be preferable to only build the extensions & test for the default
Python version. Or to copy the entire build tree before building for the
next python version, so that all Python versions can have tests run
against them.

The patch also:
* Removes an invalid X-Python-Version (it's used in the source block),
  containing an invalid value ("all" is not supported).
* Removes an unnecessary ${python:Provides}
* Sets -e (Closes: #628818)
* Installs into the normal distutils destination (using the py_libdir_sh
  make macro) instead of directly into pyshared (which is not what
  dh_python2 expects)

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  H: +27 21 465 6908 C: +27 72 419 8559  UCT: x3127
diff -Nru silo-llnl-4.8/debian/control silo-llnl-4.8/debian/control
--- silo-llnl-4.8/debian/control	2011-04-11 03:05:51.000000000 +0200
+++ silo-llnl-4.8/debian/control	2011-07-03 14:27:32.000000000 +0200
@@ -2,7 +2,7 @@
 Section: science
 Priority: optional
 Maintainer: Alastair McKinstry <mckins...@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), libreadline-dev, libhdf5-serial-dev | libhdf5-dev, zlib1g-dev, libqt4-dev, gfortran, python-dev, chrpath
+Build-Depends: debhelper (>= 7.0.50~), libreadline-dev, libhdf5-serial-dev | libhdf5-dev, zlib1g-dev, libqt4-dev, gfortran, python-all-dev, chrpath
 Build-Conflicts: qt3-dev-tools
 Standards-Version: 3.9.2
 Homepage:  https://wci.llnl.gov/codes/silo
@@ -77,8 +77,6 @@
 Package: python-silo
 Section: python
 Architecture: any
-X-Python-Version: all
 Depends: ${python:Depends}, ${misc:Depends}, ${shlibs:Depends}, libsilo0 (=${binary:Version})
-Provides: ${python:Provides}
 Description: Python interface to the SILO Scientific I/O library
  This is a python interface to SILO, a scientific I/O library.
diff -Nru silo-llnl-4.8/debian/rules silo-llnl-4.8/debian/rules
--- silo-llnl-4.8/debian/rules	2011-04-11 06:00:28.000000000 +0200
+++ silo-llnl-4.8/debian/rules	2011-07-03 14:58:15.000000000 +0200
@@ -3,32 +3,33 @@
 # Uncomment this to turn on verbose mode.
 export DH_VERBOSE=1
 
-
 # magic debhelper rule
 %:
 	dh  --with python2 $@
 
-PYVERS:= `pyversions -s`
+include /usr/share/python/python.mk
+PYVERS:= $(shell pyversions -r)
 
 override_dh_auto_configure:
 	dh_auto_configure -- --enable-pythonmodule --enable-silex --with-qt=/usr --enable-pythonmodule --enable-silex --with-qt-bin=/usr/bin --with-qt-lib=/usr/lib  --with-qt-include=/usr/include/qt4 --with-hdf5=/usr/include,/usr/lib
 
 override_dh_auto_build:
 	dh_auto_build
+	set -e; \
 	for p in $(PYVERS) ; do   \
 		 dh_auto_configure -- --enable-pythonmodule --enable-silex --with-qt=/usr --enable-pythonmodule --enable-silex --with-qt-bin=/usr/bin --with-qt-lib=/usr/lib  --with-qt-include=/usr/include/qt4 --with-hdf5=/usr/include,/usr/lib PYTHON=$$p ; \
-		$(MAKE) -C tools/python; \
-		mkdir -p  debian/tmp/usr/lib/pyshared/$$p ;  \
-		cp tools/python/.libs/Silo.so debian/Silo.so.$$p  ; \
+		$(MAKE) -C tools/python clean all; \
+		cp tools/python/.libs/Silo.so debian/Silo.so.$$p; \
+		chrpath -d debian/Silo.so.$$p; \
 	done
 
 override_dh_auto_install:
 	dh_auto_install
 	# move the python modules to where dh_pysupport will spot them ...
+	set -e; \
 	for p in $(PYVERS); do \
-		mkdir -p debian/python-silo/usr/lib/$$p/site-packages ; \
-		chrpath -d debian/Silo.so.$$p ; \
-		cp debian/Silo.so.$$p debian/python-silo/usr/lib/$$p/site-packages/Silo.so ; \
+		mkdir -p debian/python-silo/$(call py_libdir_sh, $$p); \
+		cp debian/Silo.so.$$p debian/python-silo/$(call py_libdir_sh, $$p)/Silo.so; \
 	done
 
 override_dh_auto_clean:

Reply via email to