From 21a6798c0582fbb33c9e235e0b3371fa7f708c28 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 2 Sep 2009 22:30:27 -0700 Subject: Convert debian/rules to debhelper 7 and add versioned build-dependencies on debhelper and quilt to suit. --- debian/rules | 111 +++++++++++------------------------------------------------ 1 file changed, 20 insertions(+), 91 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index e455d66d..6f0b3cd6 100755 --- a/debian/rules +++ b/debian/rules @@ -1,9 +1,4 @@ #!/usr/bin/make -f -# Made with the aid of dh_make, by Craig Small -# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. -# This version is for a hypothetical package that builds an -# architecture-dependant package, as well as an architecture-independant -# package. LDFLAGS := -Wl,-z,defs CFLAGS := -g -D_GNU_SOURCE -D_REENTRANT -fPIC @@ -13,109 +8,43 @@ CFLAGS += -O2 endif 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)) - conf_args = --build $(DEB_BUILD_GNU_TYPE) -else - conf_args = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) -endif LC_COLLATE=C export LC_COLLATE -QUILT_PATCH_DIR = debian/patches-applied -include /usr/share/quilt/quilt.make - -BUILD_TREE=$(CURDIR) +export QUILT_PATCH_DIR = debian/patches-applied d = $(CURDIR)/debian dl = $(d)/local -build: configure build-stamp -build-stamp: - dh_testdir +%: + dh $@ --with quilt +override_dh_auto_build: # Compile everything else - $(MAKE) -C $(BUILD_TREE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" - + dh_auto_build pod2man --section 8 --release="Debian GNU/Linux" $(dl)/pam_getenv >$(dl)/pam_getenv.8 - touch build-stamp - -configure: patch configure-stamp -configure-stamp: - cd $(BUILD_TREE) && \ - ./configure $(conf_args) \ - --sysconfdir=/etc --prefix=/usr --enable-static --enable-shared \ - --libdir=/lib --sbindir=/sbin --disable-audit - touch configure-stamp - - -clean: clean-patched unpatch +override_dh_auto_configure: + dh_auto_configure -- --enable-static --enable-shared \ + --libdir=/lib --sbindir=/sbin --disable-audit \ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" -clean-patched: - dh_testdir - dh_testroot - [ ! -f $(BUILD_TREE)/Makefile ] || $(MAKE) -C $(BUILD_TREE) distclean - dh_clean +override_dh_compress: + dh_compress -Xhtml -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs +override_dh_install: + dh_install -plibpam-modules -Xpam_cracklib + dh_install -Nlibpam-modules - $(MAKE) -C $(BUILD_TREE) DESTDIR=$(CURDIR)/debian/tmp install - -# Build architecture-independent files here. -binary-indep: install - dh_testdir -i - dh_testroot -i - dh_install -i - dh_installman -i - dh_installdocs -i - dh_installdebconf -i - dh_installchangelogs -i - dh_compress -i -X.html - dh_lintian -i - dh_link -i - dh_fixperms -i - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -binary-arch: install - dh_testdir -a - dh_testroot -a - - dh_install -a -Nlibpam-cracklib -X pam_cracklib - dh_install -plibpam-cracklib - dh_link -a - dh_installman -a +override_dh_installman: + dh_installman rm -f $(d)/libpam-modules/usr/share/man/man5/pam.conf.5 - dh_installdebconf -a - dh_installdocs -a $(BUILD_TREE)/README - dh_installexamples -a - - dh_installcron -a - - dh_installchangelogs -a - dh_lintian -a - - dh_strip -a - dh_compress -a - dh_fixperms -a +override_dh_fixperms: + dh_fixperms chgrp shadow $(d)/libpam-modules/sbin/unix_chkpwd chmod 02755 $(d)/libpam-modules/sbin/unix_chkpwd - dh_makeshlibs -a -V "libpam0g (>= 1.1.0)" - 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 patch unpatch install configure +override_dh_makeshlibs: + dh_makeshlibs -V "libpam0g (>= 1.1.0)" -- cgit v1.2.3 From d343f5da3ba5b134eb0c269919ee700afca4a8e8 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 3 Sep 2009 01:27:37 -0700 Subject: Drop CFLAGS that we don't need anymore (-fPIC, -D_REENTRANT, -D_GNU_SOURCE). --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 6f0b3cd6..9999af1b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f LDFLAGS := -Wl,-z,defs -CFLAGS := -g -D_GNU_SOURCE -D_REENTRANT -fPIC +CFLAGS := -g ifeq (,$(findstring noopt, ${DEB_BUILD_OPTIONS})) CFLAGS += -O2 -- cgit v1.2.3 From c57ea6514fa7783330b4dc11ed51ac1665fe98f1 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 3 Sep 2009 01:28:37 -0700 Subject: Explicitly add -O0 to CFLAGS when noopt is set. --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 9999af1b..c115d852 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,8 @@ CFLAGS := -g ifeq (,$(findstring noopt, ${DEB_BUILD_OPTIONS})) CFLAGS += -O2 +else +CFLAGS += -O0 endif DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -- cgit v1.2.3 From 9c0389a6f68dc743d2b9a796f432074113780ed9 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 3 Sep 2009 02:24:40 -0700 Subject: consolidate, comment the override targets --- debian/rules | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index c115d852..4c601548 100755 --- a/debian/rules +++ b/debian/rules @@ -22,31 +22,37 @@ dl = $(d)/local %: dh $@ --with quilt -override_dh_auto_build: - # Compile everything else - dh_auto_build - pod2man --section 8 --release="Debian GNU/Linux" $(dl)/pam_getenv >$(dl)/pam_getenv.8 - override_dh_auto_configure: dh_auto_configure -- --enable-static --enable-shared \ --libdir=/lib --sbindir=/sbin --disable-audit \ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" +# make sure the SAG, MWG, ADG are readable with a browser. override_dh_compress: dh_compress -Xhtml +# .install files don't have "except for" handling, so we need to exclude +# our module that doesn't match right here override_dh_install: dh_install -plibpam-modules -Xpam_cracklib dh_install -Nlibpam-modules +# again, excluding files by hand; also, build our local manpage for pam_getenv +# from the XML override_dh_installman: + pod2man --section 8 --release="Debian GNU/Linux" $(dl)/pam_getenv >$(dl)/pam_getenv.8 dh_installman rm -f $(d)/libpam-modules/usr/share/man/man5/pam.conf.5 +# using perms that differ from upstream (sgid instead of suid) /and/ that +# dh_fixperms doesn't want override_dh_fixperms: dh_fixperms chgrp shadow $(d)/libpam-modules/sbin/unix_chkpwd chmod 02755 $(d)/libpam-modules/sbin/unix_chkpwd +# ideally, dh_makeshlibs could compute this from the symbols file; or we +# could drop it since anyone building against this package should have a +# dpkg-shlibdeps available that knows about symbols files? override_dh_makeshlibs: dh_makeshlibs -V "libpam0g (>= 1.1.0)" -- cgit v1.2.3 From 141d169fd95f29cc084c7498872d1b7721e33100 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 3 Sep 2009 02:33:31 -0700 Subject: Move pam_cracklib manpage to the libpam-cracklib package, and add the requisite Replaces --- debian/rules | 1 + 1 file changed, 1 insertion(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 4c601548..226bb03d 100755 --- a/debian/rules +++ b/debian/rules @@ -43,6 +43,7 @@ override_dh_installman: pod2man --section 8 --release="Debian GNU/Linux" $(dl)/pam_getenv >$(dl)/pam_getenv.8 dh_installman rm -f $(d)/libpam-modules/usr/share/man/man5/pam.conf.5 + rm -f $(d)/libpam-modules/usr/share/man/man8/pam_cracklib.8 # using perms that differ from upstream (sgid instead of suid) /and/ that # dh_fixperms doesn't want -- cgit v1.2.3 From c86e81c1b52419226501205c9f18b6e3979dcb19 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 3 Sep 2009 03:00:38 -0700 Subject: make sure we only munge the unix_chkpwd perms when we're not in a binary-indep target --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 226bb03d..b0c0e1ca 100755 --- a/debian/rules +++ b/debian/rules @@ -49,8 +49,10 @@ override_dh_installman: # dh_fixperms doesn't want override_dh_fixperms: dh_fixperms +ifeq (,$(findstring -i, $(DH_INTERNAL_OPTIONS))) chgrp shadow $(d)/libpam-modules/sbin/unix_chkpwd chmod 02755 $(d)/libpam-modules/sbin/unix_chkpwd +endif # ideally, dh_makeshlibs could compute this from the symbols file; or we # could drop it since anyone building against this package should have a -- cgit v1.2.3