I taught myself some autotools and created a much better patch.

SR
diff -Nru libbuffy-bindings-0.10/debian/control libbuffy-bindings-0.10+nmu1/debian/control
--- libbuffy-bindings-0.10/debian/control	2010-03-05 18:54:09.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/debian/control	2010-06-27 00:44:27.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Enrico Zini <enr...@debian.org>
 Uploaders: martin f krafft <madd...@debian.org>
-Build-Depends: cdbs, debhelper (>= 7), dh-buildinfo, libbuffy-dev (>= 1.4), libbuffy-dev (<< 2.0), swig, perl (>= 5.6.0-16), python, python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6), pkg-config, libtool, ruby1.8-dev, ruby, libwibble-dev (>= 0.1.15), libwibble-dev (<< 0.2), libglib2.0-dev, zlib1g-dev
+Build-Depends: cdbs, debhelper (>= 7), dh-buildinfo, libbuffy-dev (>= 1.4), libbuffy-dev (<< 2.0), swig, perl (>= 5.6.0-16), python-all, python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6), pkg-config, libtool, ruby1.8-dev, ruby, libwibble-dev (>= 0.1.15), libwibble-dev (<< 0.2), libglib2.0-dev, zlib1g-dev
 Standards-Version: 3.8.4.0
 XS-Python-Version: >= 2.3
 Vcs-Git: git://git.debian.org/git/buffy/bindings.git
diff -Nru libbuffy-bindings-0.10/debian/python-buffy.install libbuffy-bindings-0.10+nmu1/debian/python-buffy.install
--- libbuffy-bindings-0.10/debian/python-buffy.install	2010-03-05 18:54:09.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/debian/python-buffy.install	2010-06-27 00:44:27.000000000 +0200
@@ -1 +1,2 @@
-debian/tmp/usr/lib/python*
+debian/tmp/usr/lib/python2.*/*-packages/_Buffy.so*
+debian/tmp/usr/lib/python2.*/*-packages/Buffy.py
diff -Nru libbuffy-bindings-0.10/debian/rules libbuffy-bindings-0.10+nmu1/debian/rules
--- libbuffy-bindings-0.10/debian/rules	2010-03-05 18:54:09.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/debian/rules	2010-06-27 01:01:05.000000000 +0200
@@ -22,13 +22,19 @@
   CXXFLAGS += -O2
 endif
 
+export PYVERS=$(shell pyversions -vr)
+
 configure: config-stamp
 config-stamp:
 	dh_testdir
 	# Configure
 	cd perl && perl Makefile.PL PREFIX="/usr" INSTALLDIRS=vendor
-	cd python && CXXFLAGS="$(CXXFLAGS)" ./configure --prefix="/usr"
 	cd ruby && ruby extconf.rb
+	set -e; for pyver in $$PYVERS; do \
+		mkdir build-py$$pyver; \
+		(cd build-py$$pyver; \
+		 PYTHON=python$$pyver CXXFLAGS="$(CXXFLAGS)" ../python/configure --prefix="/usr"); \
+	done
 	#
 	touch $@
 
@@ -37,12 +43,18 @@
 build-stamp: configure
 	# Build
 	cd perl && make all OPTIMIZE="$(CXXFLAGS)"
-	cd python && make all
 	cd ruby && make all
+	set -e; for pyver in $$PYVERS; do \
+		(cd build-py$$pyver; \
+		 PYTHON=python$$pyver make all); \
+	done
 	# Test
 	test "$(DO_TEST)" = true && (cd tests && ./test.pl)
-	test "$(DO_TEST)" = true && (cd tests && ./test.py)
 	test "$(DO_TEST)" = true && (cd tests && ./test.rb)
+	set -e; cd tests; for pyver in $$PYVERS; do \
+		echo "Testing Python $$pyver:"; \
+		PYTHONPATH=../build-py$$pyver:../build-py$$pyver/.libs python$$pyver test.py; \
+	done
 	#
 	touch $@
 
@@ -55,9 +67,10 @@
 	-cd ruby && make clean
 	rm -f perl/Makefile.old
 	rm -f ruby/Makefile
-	rm -f build-stamp config-stamp
+	rm -f python/*.pyc
+	rm -rf build-py*
 	#
-	dh_prep
+	dh_clean
 
 install: install-stamp
 install-stamp:
@@ -67,14 +80,20 @@
 	dh_installdirs -i -s
 	# Install
 	cd perl && make install DESTDIR=$(DEB_INSTALL_PREFIX)
-	cd python && make install DESTDIR=$(DEB_INSTALL_PREFIX)
 	cd ruby && make install DESTDIR=$(DEB_INSTALL_PREFIX)
 	mv debian/tmp/usr/local/lib/site_ruby debian/tmp/usr/lib/ruby
+	set -e; for pyver in $$PYVERS; do \
+		(cd build-py$$pyver; \
+		 make install DESTDIR=$(DEB_INSTALL_PREFIX)); \
+		(cd debian/tmp/usr/lib/python$$pyver/*-packages; \
+		 mv buffy-python/Buffy.py .; \
+		 mv _Buffy.so.0.0.0 _Buffy.so; \
+		 rm _Buffy.so.*); \
+	done
 	#
 	dh_install -i -s
 	touch $@
 
-
 # Must not depend on anything. This is to be called by
 # binary-arch/binary-indep
 # in another 'make' thread.
diff -Nru libbuffy-bindings-0.10/python/configure libbuffy-bindings-0.10+nmu1/python/configure
--- libbuffy-bindings-0.10/python/configure	2010-03-05 18:54:35.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/python/configure	2010-06-27 01:00:04.000000000 +0200
@@ -14855,18 +14863,15 @@
 
 
 
-for pyver in 2.5 2.4 2.3 2.2
-do
-	PYCONF="python${pyver}-config"
-	if which "$PYCONF" > /dev/null
-	then
-		PYTHON_CFLAGS=`"$PYCONF" --cflags`
-		PYTHON_LIBS=`"$PYCONF" --libs`
+PYCONF="${PYTHON}-config"
+PYTHON_CFLAGS=`"$PYCONF" --cflags`
+PYTHON_LIBS=`"$PYCONF" --libs`
+
+
+
+
 
 
-		break
-	fi
-done
 
 
 
diff -Nru libbuffy-bindings-0.10/python/configure.ac libbuffy-bindings-0.10+nmu1/python/configure.ac
--- libbuffy-bindings-0.10/python/configure.ac	2010-03-05 18:54:09.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/python/configure.ac	2010-06-27 00:44:27.000000000 +0200
@@ -17,18 +17,11 @@
 dnl Python build system
 AM_PATH_PYTHON
 
-for pyver in 2.5 2.4 2.3 2.2
-do
-	PYCONF="python${pyver}-config"
-	if which "$PYCONF" > /dev/null
-	then
-		PYTHON_CFLAGS=`"$PYCONF" --cflags`
-		PYTHON_LIBS=`"$PYCONF" --libs`
-		AC_SUBST([PYTHON_CFLAGS])
-		AC_SUBST([PYTHON_LIBS])
-		break
-	fi
-done
+PYCONF="${PYTHON}-config"
+PYTHON_CFLAGS=`"$PYCONF" --cflags`
+PYTHON_LIBS=`"$PYCONF" --libs`
+AC_SUBST([PYTHON_CFLAGS])
+AC_SUBST([PYTHON_LIBS])
 
 PKG_CHECK_MODULES(LIBBUFFY, libbuffy >= 1.4)
 AC_SUBST(LIBBUFFY_CFLAGS)
diff -Nru libbuffy-bindings-0.10/tests/test.py libbuffy-bindings-0.10+nmu1/tests/test.py
--- libbuffy-bindings-0.10/tests/test.py	2010-03-05 18:54:09.000000000 +0200
+++ libbuffy-bindings-0.10+nmu1/tests/test.py	2010-06-27 00:44:27.000000000 +0200
@@ -1,9 +1,5 @@
 #!/usr/bin/python
 
-import sys
-sys.path.append("../python")
-sys.path.append("../python/.libs")
-
 import Buffy
 import unittest
 

Reply via email to