From 3727931514b622ef4320611d9d62326e394637af Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 18 Mar 2010 11:37:23 +0100 Subject: Simplify rules by switching to dh --- debian/rules | 128 +++++++++++++++++------------------------------------------ 1 file changed, 36 insertions(+), 92 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index ed0b3a5..54e23b9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,20 +1,5 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# These are used for cross-compiling and for saving the configure script -# # from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -# FOR AUTOCONF 2.52 AND NEWER ONLY -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 - # The versions of python currently supported PYVERS=$(shell pyversions -s) # The current default version of python @@ -28,23 +13,24 @@ else CFLAGS += -O2 -fno-strict-aliasing endif -build: build-stamp -build-stamp: - dh_testdir +override_dh_auto_configure: configure-main $(PYVERS:%=configure-%) + +configure-main: + dh_auto_configure --builddirectory=build -- --with-history --without-python CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" - # ./configure - mkdir build; cd build && CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" ../configure $(confflags) --prefix=/usr --with-history --without-python +configure-python%: configure-main + dh_auto_configure --builddirectory=build-python$* -- --with-history --with-python=/usr/bin/python$* CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" + mv build-python$*/python build/python$* - # Build libxml2 - $(MAKE) -C build +override_dh_auto_build: build-main $(PYVERS:%=build-%) - touch build-stamp +build-main: + dh_auto_build --builddirectory=build -clean: - dh_testdir - dh_testroot - rm -f build-stamp install*-stamp +build-python%: + dh_auto_build --builddirectory=build/python$* +override_dh_auto_clean: rm -rf build build-python* rm COPYING && cp Copyright COPYING @@ -53,17 +39,10 @@ clean: -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess config.guess - dh_clean - -install: install-stamp install-python-stamp -install-stamp: build-stamp - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - $(MAKE) -C build DESTDIR=`pwd`/debian/tmp install +override_dh_auto_install: install-main $(PYVERS:%=install-%) +install-main: + dh_auto_install --builddirectory=build mv debian/tmp/usr/share/aclocal/libxml.m4 debian/tmp/usr/share/aclocal/libxml2.m4 # Properly install documentation in /usr/share/doc/libxml2-doc @@ -82,55 +61,25 @@ install-stamp: build-stamp doc/html \ doc/tutorial debian/tmp/usr/share/doc/libxml2-doc - touch install-stamp +install-python%: + dh_auto_install --builddirectory=build/python$* -build-python%-stamp: build-stamp - mkdir build-python$*; cd build-python$* && CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" ../configure $(confflags) --prefix=/usr --with-history --with-python=/usr/bin/python$* - mv build-python$*/python build/python$* - $(MAKE) -C build/python$* - - touch $@ - -install-python%-stamp: build-python%-stamp - $(MAKE) -C build/python$* DESTDIR=`pwd`/debian/tmp install - - touch $@ - -install-python-stamp: $(PYVERS:%=install-%-stamp) - touch $@ - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir -i - dh_testroot -i - dh_installdocs -i -A AUTHORS TODO README NEWS - dh_installchangelogs -i - dh_install -i --sourcedir=debian/tmp - dh_link -i - dh_strip -i - dh_compress -i -Xexamples/ -Xtutorial/ -Xhtml/ -X.html - dh_fixperms -i - dh_installdeb -i - dh_shlibdeps -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -a - dh_testroot -a - dh_installexamples -a - dh_installdocs -a -A AUTHORS TODO README NEWS +override_dh_installdocs: + dh_installdocs -A AUTHORS TODO README NEWS dh_installdocs -ppython-libxml2 python/TODO - dh_installman -a + +override_dh_compress: + dh_compress -Xexamples/ -Xtutorial/ -Xhtml/ -X.html + +override_dh_installchangelogs: dh_installchangelogs -plibxml2 ChangeLog - dh_installchangelogs -Nlibxml2 - dh_install -a --sourcedir=debian/tmp + dh_installchangelogs -Nlibxml2 -XChangeLog + +override_dh_install: + dh_install sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/libxml2.la > debian/libxml2-dev/usr/lib/libxml2.la - dh_pysupport -a - dh_python -a - dh_link -a + +override_dh_strip: dh_strip -a --dbg-package=libxml2-dbg -Npython-libxml2 dh_strip -ppython-libxml2 $(foreach python, $(filter-out $(PYVER), $(PYVERS)),\ @@ -139,14 +88,9 @@ binary-arch: build install rm -f $(python)/libxml2mod.so; \ ln -s ../$(PYVER)/libxml2mod.so $(python)/libxml2mod.so; \ fi;) - dh_compress -a -Xexamples/ - dh_fixperms -a + +override_dh_makeshlibs: dh_makeshlibs -a -V 'libxml2 (>= 2.7.4)' -- -c4 - dh_installdeb -a - dh_shlibdeps -a - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install + +%: + dh $@ -- cgit v1.2.3