On Fri, Apr 10, 2009 at 06:45:54PM +0200, Julian Andres Klode wrote:
> The attached patch implements the requested behavior.

Updated the patch because I overlooked one "python" in dh_auto_install which
has to be $python. Also fix the spelling error "python"=>"Python" in the
description.



-- 
Julian Andres Klode  - Free Software Developer
   Debian Developer  - Contributing Member of SPI
   Ubuntu Member     - Fellow of FSFE

Website: http://jak-linux.org/   XMPP: juli...@jabber.org
Debian:  http://www.debian.org/  SPI:  http://www.spi-inc.org/
Ubuntu:  http://www.ubuntu.com/  FSFE: http://www.fsfe.org/
From 62337fe24b1a825164b5338a9c24f33e23f0e40b Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <j...@debian.org>
Date: Fri, 10 Apr 2009 18:32:45 +0200
Subject: [PATCH] Support multiple Python versions (Closes: #520834)

Change the behaviour of the dh_auto_* scripts to get the requested
Python versions from `pyversions -r` and build for all of them, instead
of just the current Python version.
---
 dh_auto_build   |    4 +++-
 dh_auto_clean   |    4 +++-
 dh_auto_install |   10 ++++++----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dh_auto_build b/dh_auto_build
index 75ce51c..087e799 100755
--- a/dh_auto_build
+++ b/dh_auto_build
@@ -43,7 +43,9 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 	doit(exists $ENV{MAKE} ? $ENV{MAKE} : "make", @{$dh{U_PARAMS}});
 }
 elsif (-e "setup.py") {
-	doit("python", "setup.py", "build", @{$dh{U_PARAMS}});
+	for my $python (split ' ', `pyversions -r`) {
+		doit($python, "setup.py", "build", @{$dh{U_PARAMS}});
+	}
 }
 elsif (-e "Build.PL" && -e "Build") {
 	$ENV{MODULEBUILDRC} = "/dev/null";
diff --git a/dh_auto_clean b/dh_auto_clean
index 610155a..d98cfe6 100755
--- a/dh_auto_clean
+++ b/dh_auto_clean
@@ -54,7 +54,9 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 	}
 }
 elsif (-e "setup.py") {
-	doit("python", "setup.py", "clean", "-a", @{$dh{U_PARAMS}});
+	for my $python (split ' ', `pyversions -r`) {
+		doit($python, "setup.py", "clean", "-a", @{$dh{U_PARAMS}});
+	}
 	# The setup.py might import files, leading to python creating pyc
 	# files.
 	doit('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');
diff --git a/dh_auto_install b/dh_auto_install
index 264725c..8f49a71 100755
--- a/dh_auto_install
+++ b/dh_auto_install
@@ -84,10 +84,12 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 	}
 }
 elsif (-e "setup.py") {
-	doit("python", "setup.py", "install", 
-		"--root=$destdir",
-		"--no-compile", "-O0",
-		@{$dh{U_PARAMS}});
+	for my $python (split ' ', `pyversions -r`) {
+		doit("python", "setup.py", "install",
+			"--root=$destdir",
+			"--no-compile", "-O0",
+			@{$dh{U_PARAMS}});
+	}
 }
 elsif (-e "Build.PL" && -e "Build") {
 	$ENV{MODULEBUILDRC} = "/dev/null";
-- 
1.6.2.2

Attachment: signature.asc
Description: Digital signature

Reply via email to