tags 445486 + patch
thanks

Le samedi 06 octobre 2007 à 12:20 +0200, Bernd Zeimetz a écrit :
> no, as explained in my reply to your mail applications will badly fail
> if it tries to run scripts using #!/usr/bin/python (which is the
> default, even for packages shipped in Debian) when the package was build
> against python2.4, while the default python version is 2.5.
> To make sure a user updates both packages at the same time this
> dependency was introduced. It will be updated on a rebuild with a new
> default python version.

Well, it's not as if it's complicated to build the package for several
python versions anyway, even with a broken build system like mod_wsgi's.

Here is how to do with a rtupdate script.

Cheers,
-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.
diff -u mod-wsgi-1.1/debian/rules mod-wsgi-1.1/debian/rules
--- mod-wsgi-1.1/debian/rules
+++ mod-wsgi-1.1/debian/rules
@@ -10,44 +10,42 @@
 include /usr/share/dpatch/dpatch.make
 
 APXS2=/usr/bin/apxs2
-PY_VERSION=$(shell pyversions -vd)
-PY_NEXT_VERSION=$(shell echo $(PY_VERSION) | awk '{ print (($$1*10)+1)/10 }')
+PYVERS=$(shell pyversions -vs)
+PYMIN=$(shell echo $(PYVERS) | awk '{print $$1}')
+PYMAX=$(shell echo $(PYVERS) | LANG=C awk '{print $$NF+0.1}')
 
-config.status: configure patch
+build-%/config.status:
 	dh_testdir
+	mkdir -p build-$*
+	cp *.in *.c configure build-$*/
+	cd build-$* && ./configure --with-apxs=$(APXS2) \
+	            --with-python=/usr/bin/python$*
 
-	./configure --with-apxs=$(APXS2) \
-	            --with-python=/usr/bin/python$(PY_VERSION) 
-
-
-build: build-stamp
-
-build-stamp:  config.status
+build-%/build-stamp: build-%/config.status
 	dh_testdir
-
-	$(MAKE)
-
+	$(MAKE) -C build-$*
 	touch $@
 
-clean: clean-patched unpatch
+build: patch $(PYVERS:%=build-%/build-stamp)
 
-clean-patched:
+clean: unpatch
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp 
-
-	[ ! -f Makefile ] || $(MAKE) distclean
-
+	rm -rf build-*
 	dh_clean 
 
-install: build
+install-clean:
 	dh_testdir
 	dh_testroot
-	dh_clean -k 
+	dh_clean -k
 	dh_installdirs
-	
-	$(MAKE) DESTDIR=$(CURDIR)/debian/$(PACKAGE) install
 
+install-%: build-%/build-stamp
+	$(MAKE) -C build-$* DESTDIR=$(CURDIR)/debian/$(PACKAGE) install
+	mv $(CURDIR)/debian/$(PACKAGE)/usr/lib/apache2/modules/mod_wsgi.so \
+		$(CURDIR)/debian/$(PACKAGE)/usr/lib/apache2/modules/mod_wsgi.so-$*
+
+install: build install-clean $(PYVERS:%=install-%)
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -59,18 +57,20 @@
 	dh_installchangelogs 
 	dh_installdocs
 	dh_install
+	install -d -m 755 debian/$(PACKAGE)/usr/share/python/runtime.d
+	install -m 755 debian/*.rtupdate debian/$(PACKAGE)/usr/share/python/runtime.d/
 	dh_installman
 	dh_link
 	dh_strip
 	dh_compress
 	dh_fixperms
 	dh_installdeb
+	# Ugh, ignore libpython dependencies
+	( for i in $(PYVERS); do echo libpython$$i 1.0; done ) > debian/shlibs.local
 	dh_shlibdeps
-	#We wan't to make sure that mod-wsgi depends on the default
-	#python version as most people won't take care of it.
-	#This way should ensure that the package is binNMU-able when
-	#Debian switches to a new default Py version.
-	echo 'python:Depends=python (>= $(PY_VERSION)), python (<< $(PY_NEXT_VERSION))' \
+	rm -f debian/shlibs.local
+	# Generate dependencies manually as there are no public modules
+	echo 'python:Depends=python (>= $(PYMIN)), python (<< $(PYMAX))' \
 	     >> $(CURDIR)/debian/$(PACKAGE).substvars
 	dh_gencontrol
 	dh_md5sums
diff -u mod-wsgi-1.1/debian/changelog mod-wsgi-1.1/debian/changelog
--- mod-wsgi-1.1/debian/changelog
+++ mod-wsgi-1.1/debian/changelog
@@ -1,3 +1,15 @@
+mod-wsgi (1.1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Build the module for all supported python versions.
+  * Copy the sources in the build directories as the package's build 
+    system cannot handle out-of-tree builds.
+  * Ship a rtupdate script to rotate to the new version when the python
+    version changes.
+  * Build-depend on python-all-dev.
+
+ -- Josselin Mouette <[EMAIL PROTECTED]>  Sat, 06 Oct 2007 13:01:07 +0200
+
 mod-wsgi (1.1-1) unstable; urgency=low
 
   * New upstream version
diff -u mod-wsgi-1.1/debian/control mod-wsgi-1.1/debian/control
--- mod-wsgi-1.1/debian/control
+++ mod-wsgi-1.1/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <[EMAIL PROTECTED]>
 Uploaders: Bernd Zeimetz <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 5), python-dev, apache2-threaded-dev, dpatch
+Build-Depends: debhelper (>= 5), python-all-dev, apache2-threaded-dev, dpatch
 Homepage: http://www.modwsgi.org/
 Standards-Version: 3.7.2
 XS-Vcs-Svn: svn://svn.debian.org/python-modules/packages/mod-wsgi/trunk/
diff -u mod-wsgi-1.1/debian/libapache2-mod-wsgi.prerm mod-wsgi-1.1/debian/libapache2-mod-wsgi.prerm
--- mod-wsgi-1.1/debian/libapache2-mod-wsgi.prerm
+++ mod-wsgi-1.1/debian/libapache2-mod-wsgi.prerm
@@ -6,6 +6,8 @@
     a2dismod mod-wsgi || true
 fi
 
+rm -f /usr/lib/apache2/modules/mod_wsgi.so
+
 #DEBHELPER#
 
 exit 0
diff -u mod-wsgi-1.1/debian/libapache2-mod-wsgi.postinst mod-wsgi-1.1/debian/libapache2-mod-wsgi.postinst
--- mod-wsgi-1.1/debian/libapache2-mod-wsgi.postinst
+++ mod-wsgi-1.1/debian/libapache2-mod-wsgi.postinst
@@ -2,6 +2,11 @@
 
 set -e
 
+/usr/share/python/runtime.d/libapache2-mod-wsgi.rtupdate \
+        rtupdate \
+        pouet \
+        $(pyversions -d)
+
 apache_force_reload() {
     if apache2ctl configtest 2>/dev/null; then
         invoke-rc.d apache2 force-reload || true
only in patch2:
unchanged:
--- mod-wsgi-1.1.orig/debian/libapache2-mod-wsgi.rtupdate
+++ mod-wsgi-1.1/debian/libapache2-mod-wsgi.rtupdate
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = rtupdate ]; then
+    new_version=${3#python}
+    ln -sf mod_wsgi.so-${new_version} /usr/lib/apache2/modules/mod_wsgi.so
+fi

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

Reply via email to