[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#801059: libxmu's debian/rules is not safe to execute in parallel



Does the attached patch also fix your issue?

Thanks,
Andreas

On Mon, Oct 05, 2015 at 09:12:20PM +0200, Matthias Klose wrote:
> Package: src:libxmu
> Version: 2:1.1.2-1
> Severity: serious
> Tags: sid stretch patch
> 
> seen in an Ubuntu test rebuild, however this may happen as well in a Debian build.
> 
> https://launchpadlibrarian.net/219669711/buildlog_ubuntu-wily-amd64.libxmu_2%3A1.1.2-1_BUILDING.txt.gz
> 
> the problem is that -j is added to MAKEFLAGS, and the binary-arch and
> binary-indep targets are executed in parallel.  The Ubuntu build now fails
> 
> dh_builddeb -s
> [...]
> dh_builddeb
> dpkg-deb: building package 'libxmu6' in '../libxmu6_1.1.2-1_amd64.deb'.
> tar: ./usr/lib/x86_64-linux-gnu/libXmu.so.6.2.0: file changed as we read it
> dpkg-deb: error: subprocess tar -cf returned error exit status 1
> [...]
> debian/rules:101: recipe for target 'binary-indep' failed
> make: *** [binary-indep] Error 1
> make: *** Waiting for unfinished jobs....
> 
> Every debhelper command for the architecture dependent packages are executed twice.
> 
> patch at
> http://launchpadlibrarian.net/220316375/libxmu_2%3A1.1.2-1_2%3A1.1.2-1ubuntu1.diff.gz
> 
> (together with using dpkg-buildflags, maybe dh_autoreconf could be used as well).
From 0c063344e70e98592b265118ebf00450bb474bc9 Mon Sep 17 00:00:00 2001
From: Andreas Boll <andreas.boll.dev@gmail.com>
Date: Fri, 13 Nov 2015 20:44:11 +0100
Subject: [PATCH] Switch to dh with the autoreconf and quilt addons.

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
---
 debian/changelog |   6 +++
 debian/compat    |   2 +-
 debian/control   |   4 +-
 debian/rules     | 117 +++++++++----------------------------------------------
 4 files changed, 28 insertions(+), 101 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c65fef4..5d790d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libxmu (2:1.1.2-2) UNRELEASED; urgency=medium
+
+  * Switch to dh with the autoreconf and quilt addons.
+
+ -- Andreas Boll <andreas.boll.dev@gmail.com>  Fri, 13 Nov 2015 20:43:36 +0100
+
 libxmu (2:1.1.2-1) unstable; urgency=low
 
   * New upstream release.
diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index 054ff51..1f51029 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,8 @@ Priority: optional
 Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
 Uploaders: Cyril Brulebois <kibi@debian.org>
 Build-Depends:
- debhelper (>= 8.1.3),
- dpkg-dev (>= 1.16.0),
+ debhelper (>= 9),
+ dh-autoreconf,
  libx11-dev (>= 1:0.99.2),
  libxt-dev (>= 1:0.99.1),
  libxext-dev (>= 1:0.99.1),
diff --git a/debian/rules b/debian/rules
index 3fe6792..101ab5e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,107 +7,28 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-include /usr/share/quilt/quilt.make
-
-CFLAGS = -Wall -g
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-	MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-	confflags += --build=$(DEB_HOST_GNU_TYPE)
-else
-	confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
-
-configure: $(QUILT_STAMPFN)
-	dh_testdir
-	autoreconf -vfi
-
-build: build-arch build-indep
-build-indep build-arch: build-stamp
-build-stamp: configure
-	dh_testdir
-
-	mkdir -p build
-	cd build && \
-	../configure --prefix=/usr --mandir=\$${prefix}/share/man \
-	             --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
-	             --infodir=\$${prefix}/share/info $(confflags) \
-	             --docdir=\$${prefix}/share/doc/libxmu-headers \
-	             --with-xmlto --without-fop \
-	             CFLAGS="$(CFLAGS)" 
-	cd build && $(MAKE)
-	>$@
-
-clean: unpatch
-	dh_testdir
-	rm -f build-stamp
-	rm -f config.cache config.log config.status
-	rm -f */config.cache */config.log */config.status
-	rm -f conftest* */conftest*
-	rm -rf autom4te.cache */autom4te.cache
-	rm -rf build
-	rm -f INSTALL aclocal.m4 config.guess config.h.in config.sub configure
-	rm -f depcomp install-sh ltmain.sh missing mkinstalldirs
-	find -name Makefile.in -delete
-	dh_clean
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	dh_installdirs
-
-	cd build && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-	# No need to keep '*.xml' around:
+.PHONY: build
+build:
+	dh build --with quilt,autoreconf --builddirectory=build/ --parallel
+
+%:
+	dh $@ --with quilt,autoreconf --builddirectory=build/ --parallel
+
+override_dh_auto_configure:
+	dh_auto_configure -- \
+		--disable-silent-rules \
+		--docdir=\$${prefix}/share/doc/libxmu-headers \
+		--with-xmlto \
+		--without-fop
+
+override_dh_auto_install:
+	dh_auto_install
 	find debian/tmp/usr/share/doc/libxmu-headers -name '*.xml' -delete
 
-# Build architecture-dependent files here.
-binary-arch: install
-	dh_testdir
-	dh_testroot
+override_dh_install-arch:
+	dh_install --fail-missing -Xusr/include -X.la
 
-	dh_installdocs -s
-	dh_install -s --fail-missing -Xusr/include -X.la
-	dh_installchangelogs -s
-	dh_link -s
+override_dh_strip:
 	dh_strip -Nlibxmu6 -Nlibxmuu1
 	dh_strip -plibxmu6 --dbg-package=libxmu6-dbg
 	dh_strip -plibxmuu1 --dbg-package=libxmuu1-dbg
-	dh_compress -s
-	dh_fixperms -s
-	dh_makeshlibs -s
-	dh_shlibdeps -s
-	dh_installdeb -s
-	dh_gencontrol -s
-	dh_md5sums -s
-	dh_builddeb -s
-
-# Build architecture-independent files here.
-binary-indep: DH_OPTIONS=-i
-binary-indep: build install
-	dh_installdocs
-	dh_install
-	dh_installchangelogs
-	dh_link
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature


Reply to: