Hi Clint,

On 03-04-11 18:53, Clint Byrum wrote:
> I think the way to go is to drop __init__.py from
> python-gearman.libgearman, and make it depend on python-gearman, since
> it is a sub-module of the gearman namespace.
> 
> I haven't been able to make gearman.libgearman work properly without
> the __path__ changes, though I'm not entirely sure why as I'm sort of a
> python extension novice. If anyone *can* make that work, then we don't
> even need the change suggested above.

I did some more testing and gearman.libgearman actually works without the
__path__ changes, when it's installed in one of the standard Debian locations.
During compilation it's not, so it needs the __path__ changes then.

The problem with implementating that is python-gearman uses dh_python2 while
gearman.libgearman uses python-support, which results in the bytecode files
(.pyc) being installed into different directories. When I converted
gearman.libgearman to dh_python2 both packages work fine. Do you agree with this
solution?

I've attached the patch that I used for testing gearman.libgearman using
dh_python. You'll probably need to make some more changes, but maybe you can use
this.
diff -Nru gearman-interface-0.13.2/debian/changelog gearman-interface-0.13.2/debian/changelog
--- gearman-interface-0.13.2/debian/changelog	2010-09-29 04:41:31.000000000 +0200
+++ gearman-interface-0.13.2/debian/changelog	2011-04-18 20:21:59.000000000 +0200
@@ -1,3 +1,9 @@
+gearman-interface (0.13.2-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+
+ -- Oxan van Leeuwen <o...@oxanvanleeuwen.nl>  Mon, 18 Apr 2011 20:21:56 +0200
+
 gearman-interface (0.13.2-3) unstable; urgency=low
 
   * Fixing Vcs-Bzr to point at debian packaging (Closes: #596794)
diff -Nru gearman-interface-0.13.2/debian/control gearman-interface-0.13.2/debian/control
--- gearman-interface-0.13.2/debian/control	2010-09-29 04:40:46.000000000 +0200
+++ gearman-interface-0.13.2/debian/control	2011-04-18 20:32:19.000000000 +0200
@@ -1,7 +1,7 @@
 Source: gearman-interface
 Priority: extra
 Maintainer: Clint Byrum <cl...@ubuntu.com>
-Build-Depends: python-setuptools (>= 0.6b3), python, python3 (>= 3.1.2-6~), python3-all-dev (>= 3.1.2-10), python-all-dev, debhelper (>= 7.0.50~), python-support (>= 0.8.4), libgearman-dev (>= 0.13), swig, uuid-dev
+Build-Depends: python-setuptools (>= 0.6b3), python3-all-dev (>= 3.1.2-10), python-all-dev (>= 2.6.6-3~), debhelper (>= 7.0.50~), libgearman-dev (>= 0.13), swig, uuid-dev
 Standards-Version: 3.9.1
 Section: python
 Homepage: https://launchpad.net/gearman-interface
@@ -9,7 +9,7 @@
 
 Package: python-gearman.libgearman
 Architecture: any
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-gearman
 Provides: ${python:Provides}
 Description: Python wrapper of libgearman
  This package contains a Python wrapper of libgearman.
diff -Nru gearman-interface-0.13.2/debian/rules gearman-interface-0.13.2/debian/rules
--- gearman-interface-0.13.2/debian/rules	2010-09-29 04:40:46.000000000 +0200
+++ gearman-interface-0.13.2/debian/rules	2011-04-18 20:31:33.000000000 +0200
@@ -14,7 +14,7 @@
 PY3VERS=$(shell py3versions -vs)
 
 %:
-	dh $@ 
+	dh --with python2,python3 $@ 
 
 override_dh_build:: build-python-all build-python3-all
 
@@ -38,7 +38,8 @@
 
 override_dh_install:: build $(PYVERS:%=install-python2%) $(PY3VERS:%=install-python3%)
 install-python2%:
-	cd python && python$* setup.py install --root $(CURDIR)/debian/python-gearman.libgearman
+	cd python && python$* setup.py install --install-layout=deb --root $(CURDIR)/debian/python-gearman.libgearman
+	find $(CURDIR)/debian/python-gearman.libgearman -name '__init__.py' -delete
 
 install-python3%:
 	cd python3 && python$* setup.py install --install-layout=deb --root $(CURDIR)/debian/python3-gearman.libgearman
@@ -52,10 +53,6 @@
 	rm -f python/libgearman.c
 	rm -f python3/libgearman.c
 
-override_dh_pysupport::
-	dh_pysupport
-	dh_python3
-
 override_dh_clean::
 	dh_clean
 	rm -f build-python*
@@ -66,5 +63,7 @@
 	rm -rf python/build/
 	rm -rf python/python_libgearman.egg-info/
 	rm -rf python3/build/
+	rm -rf python3/gearman/_libgearman*so
+	rm -rf python3/gearman/__pycache__
 	[ ! -f python/libgearman.c.orig ] || mv -f python/libgearman.c.orig python/libgearman.c
 	[ ! -f python3/libgearman.c.orig ] || mv -f python3/libgearman.c.orig python3/libgearman.c

Reply via email to