On Sat, 7 Jun 2014, Max Bowsher wrote:

The problem here is that some manual sed hackery munging the /usr/bin/hg shebang was removed in PAPT SVN r10748, with the justification that dh_python2 would take care of it automatically.

Unfortunately, it was not considered that the package currently circumvents large portions of dh_python2's multiple python version support by calling the upstream Makefile instead of setup.py.

Fortunately the solution is relatively simple:

* Drop package-local Makefile constructs handling multiple python versions

* Explicitly call the python_distutils debhelper buildsystem plugin

* Use override hooks to call only the upstream Makefile targets which handle non-distutils parts of the build.

Patch attached.

Regards,
Max Bowsher.

Dear Maintainers,

I tested Max's patch. It works, and looks like a clean solution. I hope you will apply it.

                                                        Regards, Faheem
diff -ru mercurial-3.0/debian/rules mercurial-3.0.fixed/debian/rules

--- mercurial-3.0/debian/rules	2014-04-07 22:58:25.000000000 +0100

+++ mercurial-3.0.fixed/debian/rules	2014-06-07 21:32:25.000000000 +0100

@@ -5,17 +5,30 @@

 #export DH_VERBOSE=1

 

 %:

-	dh $@ --with python2,bash-completion

+	dh $@ --with python2,bash-completion --buildsystem python_distutils

 

-PYVERS=$(shell pyversions -vs)

 PYVER_DEFAULT=$(shell pyversions -vd)

 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

 

+# This package uses both distutils and Makefile elements in its buildsystem.

+# We configure debhelper to use the python_distutils buildsystem plugin, so

+# that appropriate Debian-specific invocations of setup.py are used, and then

+# call the extra needed Makefile targets from override_dh_auto_* targets.

+

 override_dh_auto_build:

-	$(MAKE) all

+	dh_auto_build

+	$(MAKE) doc

 	# Do not start a line with a word with a dot in a manpage

 	sed -i -e 's,^[.]\(hgignore\|hg/hgrc\),\\fP\1,' doc/hg.1

 

+override_dh_auto_install:

+	dh_auto_install

+	$(MAKE) install-doc DESTDIR=$(CURDIR)/debian/tmp

+

+override_dh_auto_clean:

+	dh_auto_clean

+	$(MAKE) clean

+

 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))

          NJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))

          PARALLEL_TEST_JOBS := --jobs $(NJOBS)

@@ -44,11 +57,6 @@

 	rename.ul .deb-backup '' $(CURDIR)/tests/*

 endif

 

-override_dh_auto_install: $(PYVERS:%=install-python%)

-

-install-python%:

-	python$* setup.py install --root $(CURDIR)/debian/tmp --install-layout=deb

-

 override_dh_install:

 	dh_install

 	if test -d $(CURDIR)/debian/mercurial ; then \

Reply via email to