]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Use dh_dkms for DKMS maintainer script handling
authorRuss Allbery <rra@debian.org>
Mon, 8 Mar 2010 23:05:37 +0000 (15:05 -0800)
committerRuss Allbery <rra@debian.org>
Mon, 8 Mar 2010 23:05:37 +0000 (15:05 -0800)
* 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)

debian/changelog
debian/control
debian/dkms.conf.in [deleted file]
debian/openafs-modules-dkms.dkms [new file with mode: 0644]
debian/openafs-modules-dkms.postinst [deleted file]
debian/openafs-modules-dkms.prerm [deleted file]
debian/rules

index e017455e5b00228399328ae326840ec46a88b6fb..99b4dd26d6b219405229a0a690a4486588135017 100644 (file)
@@ -13,6 +13,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.
index 5dcfcfa693604d9f9c78b00d678b922eae73b9e8..6c656c562ebb1d04ec6dac358483ae814c553135 100644 (file)
@@ -4,8 +4,8 @@ Priority: optional
 Maintainer: Russ Allbery <rra@debian.org>
 Uploaders: Sam Hartman <hartmans@debian.org>
 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 (file)
index 409471a..0000000
+++ /dev/null
@@ -1,14 +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 --with-linux-kernel-headers=${kernel_source_dir}
-    && 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 (file)
index 0000000..7e4d438
--- /dev/null
@@ -0,0 +1,14 @@
+# 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 --with-linux-kernel-headers=${kernel_source_dir}
+    && 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 (file)
index 5a6d5f4..0000000
+++ /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 (file)
index 116e701..0000000
+++ /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#
index fc41a20bad9b17aa14868703faba7abb99a3577b..e3b82913517080742de1bb83f49e2f7c3f0434a6 100755 (executable)
@@ -173,8 +173,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; \
@@ -208,6 +206,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