From: Russ Allbery Date: Thu, 12 Feb 2009 21:23:20 +0000 (-0800) Subject: First cut at debhelper 7 support X-Git-Tag: debian/1.4.8.dfsg1-1~17 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0678c13652422d891f287e125db8d6d962adb9ab;p=packages%2Fo%2Fopenafs.git First cut at debhelper 7 support * Update to debhelper compatibility level V7. - Use dh where possible in debian/rules. - Use dh_lintian to install Lintian overrides. - Eliminate the configure target and do all the work in build. - Do more in the install target and less in binary, matching the default command stacks in dh. - Use a debian/clean configuration file to let dh clean do more of the work rather than using rm commands in debian/rules. --- diff --git a/debian/changelog b/debian/changelog index 15f29d964..3e28ed369 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,14 @@ openafs (1.4.8.dfsg1-1) UNRELEASED; urgency=low Kaseorg and Lutz Goehring for suggestions. (LP: #295897) * Allow time-daemon to satisfy the openafs-fileserver recommends in addition to ntp, allowing for openntpd. (Closes: #508258) + * Update to debhelper compatibility level V7. + - Use dh where possible in debian/rules. + - Use dh_lintian to install Lintian overrides. + - Eliminate the configure target and do all the work in build. + - Do more in the install target and less in binary, matching the + default command stacks in dh. + - Use a debian/clean configuration file to let dh clean do more of the + work rather than using rm commands in debian/rules. * Add ${misc:Depends} to all dependencies. * Add explanations for the Lintian overrides. * Use set -e instead of #!/bin/sh -e in maintainer scripts. diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..9c2b66713 --- /dev/null +++ b/debian/clean @@ -0,0 +1,8 @@ +aclocal.m4 +configure +configure-libafs +doc/man-pages/man1/*.1 +doc/man-pages/man5/*.5 +doc/man-pages/man8/*.8 +src/kauth/ka-forwarder +src/packaging/RedHat/openafs.spec diff --git a/debian/compat b/debian/compat index 7ed6ff82d..7f8f011eb 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index 514900e90..342b65891 100644 --- a/debian/control +++ b/debian/control @@ -3,8 +3,8 @@ Section: net Priority: optional Maintainer: Russ Allbery Uploaders: Sam Hartman -Build-Depends: debhelper (>= 5), libncurses5-dev, libpam0g-dev, bison, - flex, perl, comerr-dev, libkrb5-dev, autoconf, automake +Build-Depends: debhelper (>= 7), autoconf, automake, bison, comerr-dev, + flex, libkrb5-dev, libncurses5-dev, libpam0g-dev, perl Standards-Version: 3.8.0 Homepage: http://www.openafs.org/ Vcs-Git: git://git.debian.org/git/pkg-k5-afs/openafs.git diff --git a/debian/openafs-client.lintian b/debian/openafs-client.lintian deleted file mode 100644 index ef9985f71..000000000 --- a/debian/openafs-client.lintian +++ /dev/null @@ -1,3 +0,0 @@ -# The AFS client cache should not be world-readable, since it may contain -# files only readable by some of the local users based on their tokens. -openafs-client: non-standard-dir-perm /var/cache/openafs/ 0700 != 0755 diff --git a/debian/openafs-client.lintian-overrides b/debian/openafs-client.lintian-overrides new file mode 100644 index 000000000..ef9985f71 --- /dev/null +++ b/debian/openafs-client.lintian-overrides @@ -0,0 +1,3 @@ +# The AFS client cache should not be world-readable, since it may contain +# files only readable by some of the local users based on their tokens. +openafs-client: non-standard-dir-perm /var/cache/openafs/ 0700 != 0755 diff --git a/debian/openafs-dbserver.lintian b/debian/openafs-dbserver.lintian deleted file mode 100644 index cf65ecb5b..000000000 --- a/debian/openafs-dbserver.lintian +++ /dev/null @@ -1,3 +0,0 @@ -# The database directory should be kept locked down to prevent reading -# database information that may not be accessible without authentication. -openafs-dbserver: non-standard-dir-perm var/lib/openafs/db/ 0700 != 0755 diff --git a/debian/openafs-dbserver.lintian-overrides b/debian/openafs-dbserver.lintian-overrides new file mode 100644 index 000000000..cf65ecb5b --- /dev/null +++ b/debian/openafs-dbserver.lintian-overrides @@ -0,0 +1,3 @@ +# The database directory should be kept locked down to prevent reading +# database information that may not be accessible without authentication. +openafs-dbserver: non-standard-dir-perm var/lib/openafs/db/ 0700 != 0755 diff --git a/debian/openafs-fileserver.lintian b/debian/openafs-fileserver.lintian deleted file mode 100644 index f77b31f04..000000000 --- a/debian/openafs-fileserver.lintian +++ /dev/null @@ -1,3 +0,0 @@ -# /etc/openafs/server contains the KeyFile for the server, so it's kept -# locked down as an extra precaution. -openafs-fileserver: non-standard-dir-perm etc/openafs/server/ 0700 != 0755 diff --git a/debian/openafs-fileserver.lintian-overrides b/debian/openafs-fileserver.lintian-overrides new file mode 100644 index 000000000..f77b31f04 --- /dev/null +++ b/debian/openafs-fileserver.lintian-overrides @@ -0,0 +1,3 @@ +# /etc/openafs/server contains the KeyFile for the server, so it's kept +# locked down as an extra precaution. +openafs-fileserver: non-standard-dir-perm etc/openafs/server/ 0700 != 0755 diff --git a/debian/rules b/debian/rules index d6c198b84..f662632b2 100755 --- a/debian/rules +++ b/debian/rules @@ -32,9 +32,6 @@ SYS_NAME := $(shell sh debian/sysname) package = openafs srcpkg = openafs-modules-source -# These packages have lintian overrides. -LINTIAN_PACKAGES = openafs-dbserver openafs-client openafs-fileserver - # The /usr/share/doc directory for these packages should be a symlink to # /usr/share/doc/openafs-client. Any package on this list must depend on # openafs-client. @@ -83,10 +80,12 @@ get-orig-source: # Handle the renaming of the up man page to afs-up here since the man pages # are generated from POD source by regen.sh. -configure: configure-stamp -configure-stamp: +build: build-arch build-indep +build-arch: build-stamp +build-indep: +build-stamp: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi - dh_testdir + dh build --before configure mv doc/man-pages/pod1/up.pod doc/man-pages/pod1/afs-up.pod rm -f doc/man-pages/man1/up.1 sh regen.sh @@ -101,37 +100,57 @@ configure-stamp: --enable-debug --enable-lwp-debug \ $(DEBIAN_OPT_FLAGS) $(SYSTEM) chmod a+x src/libafs/make_kbuild_makefile.pl - touch $@ - -build: build-arch build-indep -build-arch: configure-stamp build-stamp -build-indep: -build-stamp: - dh_testdir - mkdir -p $(CURDIR)/debian/tmp - $(MAKE) install_nolibafs DESTDIR=$(CURDIR)/debian/tmp - rm -f debian/tmp/usr/bin/klog.krb - chmod +x debian/afs-rootvol debian/afs-newcell + dh build --after configure touch $@ clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp install-stamp [ ! -f doc/man-pages/pod1/afs-up.pod ] \ || mv doc/man-pages/pod1/afs-up.pod doc/man-pages/pod1/up.pod - [ ! -f Makefile ] || $(MAKE) distclean - dh_clean aclocal.m4 configure configure-libafs doc/man-pages/man1/*.1 \ - doc/man-pages/man5/*.5 doc/man-pages/man8/*.8 \ - src/kauth/ka-forwarder src/packaging/RedHat/openafs.spec + dh clean -install: install-stamp -install-stamp: DH_OPTIONS= -install-stamp: build-stamp +# Rules for building the openafs-modules-source package. +install-source-stamp: dh_testdir dh_testroot + rm -rf debian/$(srcpkg) + install -d debian/$(srcpkg)/usr/src/modules/$(package) + find . \( -name \*.o -o -path ./debian -o -path \*/.svn \ + -o -path ./src/WINNT -o -path ./doc -o -path ./obj \ + -o -path ./$(SYS_NAME) -o -path ./.pc \) -prune -o -print | \ + cpio -admp debian/$(srcpkg)/usr/src/modules/$(package) + mkdir -p debian/$(srcpkg)/usr/src/modules/$(package)/debian + cp debian/changelog debian/copyright debian/module/* \ + debian/$(srcpkg)/usr/src/modules/$(package)/debian/ + chmod 755 debian/$(srcpkg)/usr/src/modules/$(package)/debian/rules + rm -f debian/$(srcpkg)/usr/src/modules/$(package)/*-stamp + cd debian/$(srcpkg)/usr/src/modules/$(package) && \ + $(MAKE) distclean + -cd debian/$(srcpkg)/usr/src/modules/$(package) && \ + rm -rf src/libafs/rx src/libafs/afs src/libafs/afsint + chown -R root.src debian/$(srcpkg) + find debian/$(srcpkg) -type d | xargs chmod 755 + find debian/$(srcpkg) -type f -perm -100 | xargs chmod 755 + find debian/$(srcpkg) -type f -not -perm -100 | xargs chmod 644 + chmod 775 debian/$(srcpkg)/usr/src/modules + cd debian/$(srcpkg)/usr/src && \ + tar cf $(package).tar modules && \ + rm -r modules + gzip -9 debian/$(srcpkg)/usr/src/$(package).tar + chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.gz + touch $@ + +install: install-stamp +install-stamp: DH_OPTIONS= +install-stamp: build-stamp install-source-stamp + dh install --until dh_prep + mkdir -p $(CURDIR)/debian/tmp + $(MAKE) install_nolibafs DESTDIR=$(CURDIR)/debian/tmp + rm -f debian/tmp/usr/bin/klog.krb + chmod +x debian/afs-rootvol debian/afs-newcell dh_installdirs dh_install --fail-missing $(IGNORE) + dh_installinit -popenafs-client -r -- defaults 25 20 + dh_installinit -popenafs-fileserver -r set -e; for pkg in $(LINTIAN_PACKAGES) ; do \ install -d debian/$$pkg/usr/share/lintian/overrides; \ @@ -166,95 +185,32 @@ install-stamp: build-stamp afs-newcell ) \ >debian/openafs-dbserver/usr/share/man/man8/afs-newcell.8 - touch $@ - -# Rules for building the openafs-modules-source package. -binary-source: - dh_testdir - dh_testroot - -rm -rf debian/$(srcpkg) debian/substvars - install -d debian/$(srcpkg)/usr/src/modules/$(package) - find . \( -name \*.o -o -path ./debian -o -path \*/.svn \ - -o -path ./src/WINNT -o -path ./doc -o -path ./obj \ - -o -path ./$(SYS_NAME) -o -path ./.pc \) -prune -o -print | \ - cpio -admp debian/$(srcpkg)/usr/src/modules/$(package) - mkdir -p debian/$(srcpkg)/usr/src/modules/$(package)/debian - cp debian/changelog debian/copyright debian/module/* \ - debian/$(srcpkg)/usr/src/modules/$(package)/debian/ - chmod 755 debian/$(srcpkg)/usr/src/modules/$(package)/debian/rules - rm -f debian/$(srcpkg)/usr/src/modules/$(package)/*-stamp - cd debian/$(srcpkg)/usr/src/modules/$(package) && \ - $(MAKE) distclean - -cd debian/$(srcpkg)/usr/src/modules/$(package) && \ - rm -rf src/libafs/rx src/libafs/afs src/libafs/afsint - chown -R root.src debian/$(srcpkg) - find debian/$(srcpkg) -type d | xargs chmod 755 - find debian/$(srcpkg) -type f -perm -100 | xargs chmod 755 - find debian/$(srcpkg) -type f -not -perm -100 | xargs chmod 644 - chmod 775 debian/$(srcpkg)/usr/src/modules - cd debian/$(srcpkg)/usr/src && \ - tar cf $(package).tar modules && \ - rm -r modules - gzip -9 debian/$(srcpkg)/usr/src/$(package).tar - chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.gz - -# Build architecture-independent files here. Pass -i to all debhelper -# commands in this target to reduce clutter. -# -# Also install debian/openafs-client.NEWS in the openafs-modules-source -# package. -binary-indep: DH_OPTIONS=-i -binary-indep: install-stamp binary-source - dh_testdir - dh_testroot - dh_installchangelogs NEWS install -m 644 debian/openafs-client.NEWS \ debian/$(srcpkg)/usr/share/doc/$(srcpkg)/NEWS.Debian - dh_installdocs -XAdminReference -XQuickStartWindows -Xwinnotes - dh_installexamples - dh_link - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb -# Build architecture-dependent files here. Pass -a to all debhelper commands -# in this target to reduce clutter. -# + dh install --after dh_install + chmod 700 debian/openafs-client/var/cache/openafs + chmod 700 debian/openafs-dbserver/var/lib/openafs/db + chmod 700 debian/openafs-fileserver/etc/openafs/server + touch $@ + +binary-indep: install-stamp + dh binary-indep + # Only include debugging information for the servers installed into # /usr/lib/openafs rather than for all binaries. The servers are where # debugging backtraces really matter, and a 10MB debugging package is # overkill. -binary-arch: DH_OPTIONS=-a binary-arch: install-stamp - dh_testdir - dh_testroot - dh_installchangelogs NEWS - dh_installdocs - dh_installdebconf - DH_OPTIONS= dh_installinit -popenafs-client -r -- defaults 25 20 - DH_OPTIONS= dh_installinit -popenafs-fileserver -r - dh_link + dh binary-arch --before dh_strip dh_strip --dbg-package=openafs-dbg rm -rf debian/openafs-dbg/usr/lib/debug/lib rm -rf debian/openafs-dbg/usr/lib/debug/sbin rm -rf debian/openafs-dbg/usr/lib/debug/usr/bin rm -rf debian/openafs-dbg/usr/lib/debug/usr/sbin - dh_compress - dh_fixperms - chmod 700 debian/openafs-client/var/cache/openafs - chmod 700 debian/openafs-dbserver/var/lib/openafs/db - chmod 700 debian/openafs-fileserver/etc/openafs/server - dh_perl - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh binary-arch --remaining binary: binary-indep binary-arch -.PHONY: binary binary-arch binary-indep binary-source build build-arch -.PHONY: build-indep clean configure install +.PHONY: binary binary-arch binary-indep build build-arch build-indep clean +.PHONY: install