Bug#369335: [Build-common-hackers] Bug#369335: python-distutils.mk: does not honour DEB_PYTHON_COMPILE_VERSION when calling dh_python

Vincent Danjean Vincent.Danjean at ens-lyon.org
Mon Jun 5 18:45:40 UTC 2006


Peter Eisentraut wrote:
> Vincent Danjean wrote:
>> When using DEB_PYTHON_COMPILE_VERSION to compile with a specific
>> python interpreter, dh_python is not called with this version. So its
>> call does not do anything (and no scripts are generated to compile
>> and remove optimized modules)
> 
> I can't reproduce that.  Can you show an example?

Sure. Try with my package mercurial.
apt-get source mercurial  => get the source of the (current) 0.9-4
version and build it with debuild. No postinst/postrm will be generated.

Then apply the patch in attachment (or get the diff of the 0.9-5 that
apply this patch on my web page [1]) and try again to recompile the
package. A correct postinst/postrm will be generated (but I need to
workaround python-distutils.mk so that dh_python is called with -V 2.4)

  Best regards,
    Vincent

[1]: http://dept-info.labri.fr/~danjean/deb.html#mercurial



-------------- next part --------------
diff -u mercurial-0.9/debian/changelog mercurial-0.9/debian/changelog
--- mercurial-0.9/debian/changelog
+++ mercurial-0.9/debian/changelog
@@ -1,3 +1,9 @@
+mercurial (0.9-5) unstable; urgency=low
+
+  * call dh_python with -V 2.4 argument
+
+ -- Vincent Danjean <Vincent.Danjean at ens-lyon.org>  Mon, 29 May 2006 09:18:53 +0200
+
 mercurial (0.9-4) unstable; urgency=low
 
   * [debian/copyright] add copyright for Debian packaging
diff -u mercurial-0.9/debian/rules mercurial-0.9/debian/rules
--- mercurial-0.9/debian/rules
+++ mercurial-0.9/debian/rules
@@ -1,9 +1,14 @@
 #!/usr/bin/make -f
 # -*- mode: makefile; coding: utf-8 -*-
 
+# including python-distutils BEFORE debhelper.mk ...
+include /usr/share/cdbs/1/class/python-distutils.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/patchsys-quilt.mk
-include /usr/share/cdbs/1/class/python-distutils.mk
+
+# ... so that we can personnalize the call to dh_python
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
+	dh_python -p$(cdbs_curpkg) -V 2.4
 
 DEB_INSTALL_MANPAGES_mercurial=doc/hg.1 doc/hgmerge.1 doc/hgrc.5
 DEB_PYTHON_COMPILE_VERSION=2.4


More information about the Build-common-hackers mailing list