[SCM] Debian packaging for XMLTooling-C branch, debian, updated. debian/1.0-1-13-g59a529d

Russ Allbery rra at debian.org
Sun May 25 03:14:05 UTC 2008


The following commit has been merged in the debian branch:
commit 59a529dfc9739c9710d268d5b46a7d73756284bd
Author: Russ Allbery <rra at debian.org>
Date:   Sat May 24 20:12:57 2008 -0700

    Overhaul debian/rules
    
    Remove the normal CFLAGS setting and instead pass --enable-debug to
    configure.  dh_strip will remove the debugging symbols if appropriate.
    
    Use the right Autoconf logic to handle cross-builds.
    
    Use stamp files for configure and install and better logic for
    optionally running make clean.
    
    Always copy config.guess and config.sub before running configure and
    delete them in the clean target.
    
    Remove unnecessary debhelper programs.

diff --git a/debian/rules b/debian/rules
index 39f2b0b..6031acd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,105 +16,85 @@
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-# 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)
-
-
-CFLAGS = -Wall -g
-
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
+    DEBUG = --enable-debug
 else
-	CFLAGS += -O2
+    DEBUG =
 endif
 
-config.status: configure
-	dh_testdir
-	# Add here commands to configure the package.
-	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr CFLAGS="$(CFLAGS)" --disable-dependency-tracking
+# Tell Autoconf the correct system types.
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+    SYSTEM = --build $(DEB_HOST_GNU_TYPE)
+else
+    SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+endif
 
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	cp /usr/share/misc/config.guess config.guess
+	cp /usr/share/misc/config.sub config.sub
+	CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
+	    --disable-dependency-tracking $(SYSTEM) $(DEBUG)
+	touch $@
 
-#Architecture 
 build: build-arch build-indep
-
 build-arch: build-stamp
-
-build-indep: build-stamp
-
-build-stamp: config.status
+build-indep:
+build-stamp: configure-stamp
+	dh_testdir
 	$(MAKE)
 	touch $@
 
 clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp #CONFIGURE-STAMP#
-
-	# Add here commands to clean up after the build process.
-	-$(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-	cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-	cp -f /usr/share/misc/config.guess config.guess
-endif
-
+	rm -f configure-stamp build-stamp install-stamp
+	[ ! -f Makefile ] || $(MAKE) distclean
+	dh_clean config.guess config.sub
 
-	dh_clean 
-
-install:
+install: install-stamp
+install-stamp:
 	dh_testdir
 	dh_testroot
-	dh_clean -k -i -s
-	dh_installdirs -i -s
-
-	# Add here commands to install the the package into debian/tmp.
+	dh_clean -k
 	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+	rm -r $(CURDIR)/debian/tmp/usr/share/doc/xmltooling
+	dh_install --fail-missing
 
-	rm $(CURDIR)/debian/tmp/usr/share/doc/xmltooling/{{CURL,LOG4CPP,OPENSSL}.LICENSE,{NOTICE,LICENSE}.txt}
-
-	dh_install -i -s --fail-missing
-
-# Must not depend on anything. This is to be called by
-# binary-arch/binary-indep
-# in another 'make' thread.
-binary-common:
+binary: binary-arch binary-indep
+binary-arch: DH_OPTIONS=-a
+binary-arch: install-stamp
 	dh_testdir
 	dh_testroot
-	dh_installchangelogs 
+	dh_installchangelogs
 	dh_installdocs
-	dh_installexamples
-#	dh_installmenu
-#	dh_installdebconf	
-#	dh_installlogrotate	
-#	dh_installemacsen
-#	dh_installpam
-#	dh_installmime
-#	dh_python
-#	dh_installinit
-#	dh_installcron
-#	dh_installinfo
-	dh_installman
 	dh_link
 	dh_strip
-	dh_compress 
+	dh_compress
 	dh_fixperms
-#	dh_perl
 	dh_makeshlibs
 	dh_installdeb
 	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
-# Build architecture independant packages using the common target.
-binary-indep: build-indep install
-	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
 
-# Build architecture dependant packages using the common target.
-binary-arch: build-arch install
-	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
+binary-indep: DH_OPTIONS=-i
+binary-indep: install-stamp
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_link
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
-binary: binary-arch binary-indep
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: binary binary-arch binary-indep build build-arch build-indep clean
+.PHONY: install

-- 
Debian packaging for XMLTooling-C



More information about the Pkg-shibboleth-devel mailing list