tag 460111 + patch
thanks

On dim, 2008-01-20 at 13:33 +0100, Josselin Mouette wrote:
> > So, yes a patch would be very much appreciated to have this resolved!
> 
> Here is a simple version that rebuilds everything for all python
> versions.

Oops, forgot to attach it.

-- 
 .''`.
: :' :      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 hamlib-1.2.6.2/debian/rules hamlib-1.2.6.2/debian/rules
--- hamlib-1.2.6.2/debian/rules
+++ hamlib-1.2.6.2/debian/rules
@@ -4,47 +4,54 @@
 #export DH_VERBOSE=1
 
 PY_INTERPRETER=/usr/bin/python
+PYVERS=$(shell pyversions -vr)
+PYDEFAULT=$(shell pyversions -vd)
 
 perlversion = `perl -V:version|cut -d\' -f2`
 
-configure: configure-stamp
-configure-stamp:
+configure: $(PYVERS:%=build-%/configure-stamp)
+build-%/configure-stamp:
 	dh_testdir
-	./configure --prefix=/usr --mandir=\$${prefix}/share/man \
-	--without-kylix-binding
-
-	touch configure-stamp
-
-build: configure-stamp build-stamp
-build-stamp:
-	dh_testdir
-	# Add here commands to compile the package.
-	$(MAKE)
-	$(MAKE) -C doc doc
-	touch build-stamp
+	mkdir build-$*
+	cd build-$* && PYTHON=/usr/bin/python$* ../configure \
+		--prefix=/usr --mandir=\$${prefix}/share/man \
+		--without-kylix-binding
+	touch $@
+
+build: $(PYVERS:%=build-%/build-stamp) build-doc-stamp
+build-%/build-stamp: build-%/configure-stamp
+	$(MAKE) -C build-$*
+	touch $@
+
+build-doc-stamp: build-$(PYDEFAULT)/configure-stamp
+	$(MAKE) -C build-$(PYDEFAULT)/doc doc
+	touch $@
 
 clean:
 	dh_testdir
 	dh_testroot
-	# Add here commands to clean up after the build process.
-	[ ! -f Makefile ] || $(MAKE) distclean
+	rm -rf build-*
 	dh_clean
-	rm -f build-stamp configure-stamp 
-	rm -f config.log libltdl/config.log
-	rm -f config.status libltdl/config.status
-	rm -rf doc/html
-	rm -rf `find . -name .libs`
-	rm -f lib/termios.o libltdl/ltdl.o
 
-install: build
+install: build install-base $(PYVERS:%=install-%) install-other
+install-base:
 	dh_testdir
 	dh_testroot
 	dh_clean -k
 	dh_installdirs
 
 	# Add here commands to install the package into debian/tmp
-	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+	$(MAKE) -C build-$(PYDEFAULT) install DESTDIR=$(CURDIR)/debian/tmp
 
+install-%: build-%/build-stamp
+	# Move the appropriate files into the python package
+	make -C build-$*/bindings install DESTDIR=$(CURDIR)/debian/tmp
+	rm $(CURDIR)/debian/tmp/usr/lib/python/Hamlib.py?
+	mkdir -p $(CURDIR)/debian/python-libhamlib2/usr/lib/python$*/site-packages
+	mv $(CURDIR)/debian/tmp/usr/lib/python/* $(CURDIR)/debian/python-libhamlib2/usr/lib/python$*/site-packages/
+	mv $(CURDIR)/debian/tmp/usr/lib/_Hamlib.so $(CURDIR)/debian/python-libhamlib2/usr/lib/python$*/site-packages/
+
+install-other:
 	# Move C++ files out of the way
 	# Move the appropriate files into the C++ development package..
 	mv $(CURDIR)/debian/tmp/usr/include/hamlib/rigclass.h $(CURDIR)/debian/libhamlib++-dev/usr/include/
@@ -75,14 +82,7 @@
 	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/auto/Hamlib/.packlist
 	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/auto/Hamlib/Hamlib.bs
 	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/perllocal.pod
-	mv $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/perltest.pl $(CURDIR)/debian/libhamlib2-perl/usr/share/doc/libhamlib2-perl
-
-	# Move the appropriate files into the python package
-	rm $(CURDIR)/debian/tmp/usr/lib/python/Hamlib.py?
-	mv $(CURDIR)/debian/tmp/usr/lib/python/* $(CURDIR)/debian/python-libhamlib2/usr/share/python-support/python-libhamlib2
-	mv $(CURDIR)/debian/tmp/usr/lib/_Hamlib.so $(CURDIR)/debian/python-libhamlib2/usr/share/python-support/python-libhamlib2
-	chmod 0644 $(CURDIR)/bindings/pytest.py
-	cp $(CURDIR)/bindings/pytest.py $(CURDIR)/debian/python-libhamlib2/usr/share/doc/python-libhamlib2/
+	cp $(CURDIR)/bindings/perltest.pl $(CURDIR)/debian/libhamlib2-perl/usr/share/doc/libhamlib2-perl/
 
 	# Move the appropriate files into the tcl package
 	mv $(CURDIR)/debian/tmp/usr/lib/hamlibtcl* $(CURDIR)/debian/libhamlib2-tcl/usr/lib/hamlib/
@@ -90,7 +90,7 @@
 	cp $(CURDIR)/bindings/tcltest.tcl $(CURDIR)/debian/libhamlib2-tcl/usr/share/doc/libhamlib2-tcl/
 
 	# Move the appropriate files into the documentation package..
-	mv $(CURDIR)/doc/html/* $(CURDIR)/debian/libhamlib-doc/usr/share/doc/hamlib-doc/html
+	cp -r $(CURDIR)/build-$(PYDEFAULT)/doc/html/* $(CURDIR)/debian/libhamlib-doc/usr/share/doc/hamlib-doc/html
 
 	# Move the appropriate files into the utils package..
 	mv $(CURDIR)/debian/tmp/usr/bin/rigctl $(CURDIR)/debian/libhamlib-utils/usr/bin/
reverted:
--- hamlib-1.2.6.2/debian/python-libhamlib2.dirs
+++ hamlib-1.2.6.2.orig/debian/python-libhamlib2.dirs
@@ -1,2 +0,0 @@
-/usr/share/python-support/python-libhamlib2
-/usr/share/doc/python-libhamlib2
diff -u hamlib-1.2.6.2/debian/changelog hamlib-1.2.6.2/debian/changelog
--- hamlib-1.2.6.2/debian/changelog
+++ hamlib-1.2.6.2/debian/changelog
@@ -1,3 +1,9 @@
+hamlib (1.2.6.2-4.1) UNRELEASED; urgency=low
+
+  * Build the package for all python versions.
+
+ -- Josselin Mouette <[EMAIL PROTECTED]>  Sun, 20 Jan 2008 12:15:59 +0100
+
 hamlib (1.2.6.2-4) unstable; urgency=low
 
   * Build against tcl8.5-dev. Hopefully this will fix building on hppa.
only in patch2:
unchanged:
--- hamlib-1.2.6.2.orig/debian/python-libhamlib2.docs
+++ hamlib-1.2.6.2/debian/python-libhamlib2.docs
@@ -0,0 +1 @@
+bindings/pytest.py
only in patch2:
unchanged:
--- hamlib-1.2.6.2.orig/bindings/pytest.py
+++ hamlib-1.2.6.2/bindings/pytest.py
@@ -3,11 +3,6 @@
 
 import sys
 
-sys.path.append ('.')
-sys.path.append ('.libs')
-sys.path.append ('/usr/local/hamlib/python')
-sys.path.append ('/usr/lib/python2.4/site-packages')
-
 import Hamlib
 
 def StartUp ():

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

Reply via email to