summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Buildsystem/python_distutils.pm
diff options
context:
space:
mode:
authorBernd Zeimetz <bernd@bzed.de>2009-07-19 02:21:06 +0200
committerBernd Zeimetz <bernd@bzed.de>2009-07-19 03:51:18 +0200
commitab10d851eb3cab5c08980bfecec35453c45745a6 (patch)
tree49d8e7dd738a688535233b067511e1e94b84aad6 /Debian/Debhelper/Buildsystem/python_distutils.pm
parentd92a7906608dcf6c697e912f73376c7f6b030fa8 (diff)
Build for all supported Pythons if installed.
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
Diffstat (limited to 'Debian/Debhelper/Buildsystem/python_distutils.pm')
-rw-r--r--Debian/Debhelper/Buildsystem/python_distutils.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Debian/Debhelper/Buildsystem/python_distutils.pm b/Debian/Debhelper/Buildsystem/python_distutils.pm
index cca000d..a54b648 100644
--- a/Debian/Debhelper/Buildsystem/python_distutils.pm
+++ b/Debian/Debhelper/Buildsystem/python_distutils.pm
@@ -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 {