]> git.donarmstrong.com Git - debhelper.git/commitdiff
Build for all supported Pythons if installed.
authorBernd Zeimetz <bernd@bzed.de>
Sun, 19 Jul 2009 00:21:06 +0000 (02:21 +0200)
committerBernd Zeimetz <bernd@bzed.de>
Sun, 19 Jul 2009 01:51:18 +0000 (03:51 +0200)
python_distutils buildsystem: Build for all supported Python
versions in case they're installed. Ensure that correct
shebangs are created by using `python' first during build
and install. Closes: #520834

Debian/Debhelper/Buildsystem/python_distutils.pm
debian/changelog

index cca000d6f5f616881a4d390ffe7e151f1154f6f6..a54b6483af59fbc28280f1d302595ea68f9e8cc9 100644 (file)
@@ -82,7 +82,19 @@ sub pre_building_step {
 sub setup_py {
        my $this=shift;
        my $act=shift;
+       my $python_default = `pyversions -d`;
+       $python_default =~ s/^\s+//;
+       $python_default =~ s/\s+$//;
+
+       # We need to to run setup.py with the default python first
+       # as distutils/setuptools modifies the shebang lines of scripts.
+       # This ensures that #!/usr/bin/python is used and not pythonX.Y
        $this->doit_in_sourcedir("python", "setup.py", $act, @_);
+       for my $python (grep(!/^$python_default/, (split ' ', `pyversions -r 2>/dev/null`))) {
+               if (-x "/usr/bin/" . $python) {
+                       $this->doit_in_sourcedir($python, "setup.py", $act, @_);
+               }
+       }
 }
 
 sub build {
index ac78030dc8af9a7fa39e7fcab6831d06481727fa..8e70d28f1867f6b4cab784b84e122d4db1a0a82a 100644 (file)
@@ -1,3 +1,12 @@
+debhelper (7.3.5) experimental; urgency=low
+
+  * python_distutils buildsystem: Build for all supported Python
+    versions in case they're installed. Ensure that correct
+    shebangs are created by using `python' first during build
+    and install. Closes: #520834
+
+ -- Bernd Zeimetz <bzed@debian.org>  Sun, 19 Jul 2009 03:45:23 +0200
+
 debhelper (7.3.4) experimental; urgency=low
 
   * Merged debhelper 7.2.24.