From: Russ Allbery Date: Mon, 8 Mar 2010 23:05:37 +0000 (-0800) Subject: Use dh_dkms for DKMS maintainer script handling X-Git-Tag: debian/1.5.73.3-1~30 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=475673ff7bf84b14b951286895ff7d448219b634;p=packages%2Fo%2Fopenafs.git Use dh_dkms for DKMS maintainer script handling * Use dh_dkms from the DKMS package to handle creation of the maintainer scripts for openafs-modules-dkms rather than rolling our own. (LP: #497149) --- diff --git a/debian/changelog b/debian/changelog index a5a540593..3dbaa5052 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,9 @@ openafs (1.4.12~pre4+dfsg-1) UNRELEASED; urgency=low - New dump tag and length standard for vos dump. - Fix stack executability for programs containing assembly code. - Various salvager robustness fixes. + * Use dh_dkms from the DKMS package to handle creation of the maintainer + scripts for openafs-modules-dkms rather than rolling our own. + (LP: #497149) * Update init script to require $remote_fs be started first. This won't be the case in the long run, but for now some important boot-time options need /usr/bin/fs to set them. diff --git a/debian/control b/debian/control index 959df75bc..4aaf5d9d3 100644 --- a/debian/control +++ b/debian/control @@ -4,8 +4,8 @@ Priority: optional Maintainer: Russ Allbery Uploaders: Sam Hartman Build-Depends: debhelper (>= 7), autoconf, automake, bison, comerr-dev, - cpio, dblatex, docbook-xsl, doxygen, flex, libkrb5-dev, libncurses5-dev, - libpam0g-dev, libxml2-utils, perl, xsltproc + cpio, dblatex, dkms (>= 2.1.1.1), docbook-xsl, doxygen, flex, + libkrb5-dev, libncurses5-dev, libpam0g-dev, libxml2-utils, perl, xsltproc Standards-Version: 3.8.3 Homepage: http://www.openafs.org/ Vcs-Git: git://git.debian.org/git/pkg-k5-afs/openafs.git diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in deleted file mode 100644 index da427ab71..000000000 --- a/debian/dkms.conf.in +++ /dev/null @@ -1,16 +0,0 @@ -# DKMS configuration for the OpenAFS kernel module. -*- sh -*- - -# The version is replaced at build time by debian/rules. -PACKAGE_NAME="openafs" -PACKAGE_VERSION="@VERSION@" - -BUILT_MODULE_NAME[0]="$PACKAGE_NAME" -DEST_MODULE_LOCATION[0]="/updates/dkms/" -AUTOINSTALL=yes - -MAKE[0]="./configure --enable-disconnected \ - --with-linux-kernel-headers=${kernel_source_dir} \ - --with-linux-kernel-packaging - && make - && mv src/libafs/MODLOAD-*/openafs.ko ." -CLEAN="rm -f openafs.ko && make -C src/libafs clean" diff --git a/debian/openafs-modules-dkms.dkms b/debian/openafs-modules-dkms.dkms new file mode 100644 index 000000000..607151627 --- /dev/null +++ b/debian/openafs-modules-dkms.dkms @@ -0,0 +1,16 @@ +# DKMS configuration for the OpenAFS kernel module. -*- sh -*- + +# The version is replaced at build time by dh_dkms invoked in debian/rules. +PACKAGE_NAME="openafs" +PACKAGE_VERSION="#MODULE_VERSION#" + +BUILT_MODULE_NAME[0]="$PACKAGE_NAME" +DEST_MODULE_LOCATION[0]="/updates/dkms/" +AUTOINSTALL=yes + +MAKE[0]="./configure --enable-disconnected \ + --with-linux-kernel-headers=${kernel_source_dir} \ + --with-linux-kernel-packaging + && make + && mv src/libafs/MODLOAD-*/openafs.ko ." +CLEAN="rm -f openafs.ko && make -C src/libafs clean" diff --git a/debian/openafs-modules-dkms.postinst b/debian/openafs-modules-dkms.postinst deleted file mode 100644 index 5a6d5f447..000000000 --- a/debian/openafs-modules-dkms.postinst +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -set -e - -# Get the package version, which is the version of openafs-modules-dkms -# without the dfsg part and without the Debian version. -package=openafs-modules-dkms -version=`dpkg-query -W -f='${Version}' "$package" \ - | sed -e 's/[+-].*//' -e 's/\.dfsg.*//' -e 's/~//g'` -kernel=`uname -r` - -# If someone installed this package without the necessary kernel headers, the -# postinst will fail. If they then fix this problem, the postinst will keep -# failing since the dkms add cannot be run twice. Try to detect this -# situation and remove and re-add the module. -if [ -e "/var/lib/dkms/openafs/$version" ] ; then - dkms remove -m openafs -v "$version" --all || true -fi -dkms add -m openafs -v "$version" -if [ "$1" = 'configure' ] ; then - if [ -e "/lib/modules/$kernel/build/include" ] ; then - dkms build -m openafs -v "$version" - dkms install -m openafs -v "$version" --force - else - cat >&2 <<"EOF" - -The OpenAFS module build for the currently running kernel was skipped since -the kernel headers for this kernel do not seem to be installed. To build -the kernel module, install the appropriate kernel headers package for your -kernel (usually linux-headers-$kernel). - -EOF - fi -fi - -#DEBHELPER# diff --git a/debian/openafs-modules-dkms.prerm b/debian/openafs-modules-dkms.prerm deleted file mode 100644 index 116e70174..000000000 --- a/debian/openafs-modules-dkms.prerm +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -set -e - -# Get the package version, which is the version of openafs-modules-dkms -# without the dfsg part and without the Debian version. I hope this is always -# correct when running prerm and we won't get the new version. -package=openafs-modules-dkms -version=`dpkg-query -W -f='${Version}' "$package" \ - | sed -e 's/[+-].*//' -e 's/\.dfsg.*//' -e 's/~//g'` - -# In some cases, broken packages have caused this to fail. If the sysadmin -# manually deletes the directory, that will also fail. In neither case -# should we abort the postrm, so ignore failure. Note that we intentionally -# do this unconditionally on upgrade so that dkms will re-add the new version -# of the package. -dkms remove -m openafs -v "$version" --all || true - -#DEBHELPER# diff --git a/debian/rules b/debian/rules index 7808f5472..65b19b812 100755 --- a/debian/rules +++ b/debian/rules @@ -172,8 +172,6 @@ install-stamp: build-stamp debian/$(dkmspkg)/usr/src/openafs-$(VERSION) rm -rf debian/$(dkmspkg)/usr/src/openafs-$(VERSION)/debian rmdir debian/$(srcpkg)/usr/src/modules - sed -e 's/[@]VERSION[@]/$(VERSION)/' debian/dkms.conf.in \ - > debian/$(dkmspkg)/usr/src/openafs-$(VERSION)/dkms.conf set -e; for pkg in $(DOC_PACKAGES) ; do \ ln -s openafs-client debian/$$pkg/usr/share/doc/$$pkg; \ @@ -207,6 +205,7 @@ install-stamp: build-stamp install -m 644 debian/openafs-client.NEWS \ debian/$(srcpkg)/usr/share/doc/$(srcpkg)/NEWS.Debian + dh_dkms -V $(VERSION) dh install --after dh_install chmod 700 debian/openafs-client/var/cache/openafs chmod 700 debian/openafs-dbserver/var/lib/openafs/db