]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
* Overhaul the module build rules.
authorRuss Allbery <rra@debian.org>
Sun, 1 May 2005 00:40:06 +0000 (00:40 +0000)
committerRuss Allbery <rra@debian.org>
Sun, 1 May 2005 00:40:06 +0000 (00:40 +0000)
    - Use debhelper to build the module binary package.
    - Let debhelper handle the module postinst and prerm control scripts.
    - Properly support modules_config and modules_clean.
    - Break the build process into configure, build, install, and binary
      rules, paralleling the regular build rules and making it easier to
      maintain the make-kpkg build targets.
    - Include the kernel version in the long description.
    - Update standards version of module packages to 3.6.1.
    - Include the copyright and basic documentation in the module binary
      package.  Otherwise, policy requires an exact versioned dependency
      on the package containing the copyright file.

Also note that the logic to turn off optimization when requested doesn't
work as documented in the configure script.

debian/changelog
debian/control
debian/control.module
debian/control.module-image
debian/postinst.mod [deleted file]
debian/prerm.mod [deleted file]
debian/rules

index 1aff286f44456d0b791d80ad5fa37d8c1ff48e11..cb5825b6db057e505d6be42d72bb9e88e374eb83 100644 (file)
@@ -4,10 +4,23 @@ openafs (1.3.81-5) unstable; urgency=low
     or ext3 and that XFS and ReiserFS will not work.  upserver and
     upclient are now provided.  Provide some information about why
     kaserver is not provided.  (Closes: #249315)
+  * Overhaul the module build rules.
+    - Use debhelper to build the module binary package.
+    - Let debhelper handle the module postinst and prerm control scripts.
+    - Properly support modules_config and modules_clean.
+    - Break the build process into configure, build, install, and binary
+      rules, paralleling the regular build rules and making it easier to
+      maintain the make-kpkg build targets.
+    - Include the kernel version in the long description.
+    - Update standards version of module packages to 3.6.1.
+    - Include the copyright and basic documentation in the module binary
+      package.  Otherwise, policy requires an exact versioned dependency
+      on the package containing the copyright file.
   * Update standards version to 3.6.1.
     - Install Debian::OpenAFS::ConfigUtils in /usr/share, not /usr/lib.
     - Always enable debugging symbols and disable optimization if noopt is
-      set in DEB_BUILD_OPTIONS.
+      set in DEB_BUILD_OPTIONS.  (Alas, this doesn't entirely work; the
+      upstream makefiles don't always honor the configure options.)
     - /etc/init.d/openafs-fileserver restart starts bosserver if it's not
       already running.
 
index be2212e6d5b61dbbee601e3af96ae45a205d60f1..f79aec1826a7dd228b1ef53e1e5992269a5fc52c 100644 (file)
@@ -76,7 +76,7 @@ Description: The AFS distributed filesystem- development libraries
 
 Package: openafs-modules-source
 Priority: extra
-Depends: bison, flex, debhelper, libpam0g-dev, libncurses5-dev, kernel-package, e2fslibs-dev
+Depends: bison, flex, debhelper (>= 4.0.0), libpam0g-dev, libncurses5-dev, kernel-package, e2fslibs-dev
 Architecture: all
 Description: The AFS distributed filesystem- Module Sources
  AFS is a distributed filesystem allowing cross-platform sharing of
index c72c5a6eda076e8602657509342f12df5440e5f7..c32426a75dc648831c1404978d727de38d87714c 100644 (file)
@@ -2,7 +2,7 @@ Source: openafs
 Section: net
 Priority: optional
 Maintainer: Sam Hartman <hartmans@debian.org>
-Standards-Version: 3.1.1
+Standards-Version: 3.6.1
 
 Package: openafs-modules-=KVERS
 Conflicts: openafs-client (<< 1.2.9)
@@ -13,4 +13,5 @@ Description: The AFS distributed filesystem- Kernel Module
  files among multiple computers.  Facilities are provided for access
  control, authentication, backup and administrative management.
  .
- This package provides the kernel module for the filesystem
+ This package provides the compiled AFS kernel module for kernel
+ =KVERS.
index f1aaf33926107b937af0bfc7a857db465420b342..f1bb6d44f9eefb0e0e576218d1d9a883d8feb139 100644 (file)
@@ -2,7 +2,7 @@ Source: openafs
 Section: net
 Priority: optional
 Maintainer: Sam Hartman <hartmans@debian.org>
-Standards-Version: 3.1.1
+Standards-Version: 3.6.1
 
 Package: openafs-modules-=KVERS
 Conflicts: openafs-client (<< 1.2.9)
@@ -14,4 +14,6 @@ Description: The AFS distributed filesystem- Kernel Module
  files among multiple computers.  Facilities are provided for access
  control, authentication, backup and administrative management.
  .
- This package provides the kernel module for the filesystem
+ This package provides the compiled AFS kernel module for kernel
+ =KVERS.
diff --git a/debian/postinst.mod b/debian/postinst.mod
deleted file mode 100644 (file)
index cfb292b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh -e
-
-update-modules
-
-exit 0
diff --git a/debian/prerm.mod b/debian/prerm.mod
deleted file mode 100644 (file)
index f11f4e1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh -e
-exit 0
index 4d85307ad21494fb7de432e6cc2bbe4159d8e0d8..d76a51d273f91c94d78d1e62a368e7a445575b42 100755 (executable)
@@ -26,9 +26,6 @@ endif
 # The AFS sysname is determined by a script
 KVERS=`perl -e '$$_ = <>; $$_ =~ m/"(.+)"/; print "$$1\n";' < $(KSRC)/include/linux/version.h`
 SYS_NAME=$(shell KVERS=$(KVERS) sh debian/sysname)
-package=openafs
-srcpkg = openafs-modules-source
-modulepkg=$(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
 ifndef KSRC
 KSRC=/usr/src/linux
 endif
@@ -39,6 +36,11 @@ export KSRC
 export KVERS
 export KPKG_DEST_DIR
 
+package   = openafs
+srcpkg    = openafs-modules-source
+modulepkg = $(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
+moduledir = debian/$(modulepkg)/lib/modules/$(KVERS)/fs
+
 LINTIAN_PACKAGES= openafs-client openafs-fileserver
 
 configure: configure-stamp
@@ -70,7 +72,8 @@ build-stamp:
 clean:
        dh_testdir
        dh_testroot
-       rm -f build-stamp configure-stamp build-modules-stamp
+       rm -f build-stamp configure-stamp configure-modules-stamp
+       rm -f build-modules-stamp
        # Add here commands to clean up after the build process.
        -$(MAKE) -ki distclean
        -rm -rf obj dest $(SYS_NAME) @sys Makefile debian/openafs-client.init
@@ -180,25 +183,25 @@ binary-arch: build install
        dh_md5sums
        dh_builddeb
 
-binary:   binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+binary: binary-indep binary-arch
 
 ############################Module package support
-kdist_image:  build-modules
+
+kdist_configure: configure-modules-stamp
+
+kdist_image: build-modules-stamp
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-modules
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
 
-kdist:  build-modules
-       $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules KERNEL_DEPENDS=y binary-modules
+kdist: build-modules-stamp
+       $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules KERNEL_DEPENDS=y \
+           binary-modules
        KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \
-               sh -v debian/genchanges.sh
+           sh -v debian/genchanges.sh
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
 
-
-
-kdist_config: configure
-
-kdist_clean: clean
+kdist_clean:
+       $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
 
 ############################ source stuff #################################
 binary-source:
@@ -234,58 +237,54 @@ binary-source:
        chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.gz
 ############################ modules stuff #################################
 
-build-modules: build-modules-stamp
-
-build-modules-stamp: 
+configure-modules: configure-modules-stamp
+configure-modules-stamp:
+ifeq ($(KERNEL_DEPENDS),y)
+       sh debian/prep-modules $(KSRC) debian/control.module > debian/control
+else
+       sh debian/prep-modules $(KSRC) debian/control.module-image > debian/control
+endif
        -ln -s @sys/dest dest
        -ln -s $(SYS_NAME) @sys
        sh configure --with-afs-sysname=$(SYS_NAME) \
            --with-linux-kernel-headers=$(KSRC) --prefix=`pwd`/debian/tmp \
            --enable-debug --enable-lwp-debug --enable-kernel-debug \
            $(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS)
+       touch configure-modules-stamp
+
+build-modules: build-modules-stamp
+build-modules-stamp: configure-modules-stamp
        make only_libafs
-       cd src/libafs&&make install
        touch build-modules-stamp
 
-binary-modules: build-modules
-# Perform some tests
-       test -f debian/rules
-       test `id -u` = "0"
-
-# Setup everything first
-       -rm -rf debian/$(modulepkg) debian/substvars
-       install -d debian/$(modulepkg)
-
-# Install the software
-       install -d -g root -o root -m 755 debian/$(modulepkg)/lib/modules/$(KVERS)/fs
-       install -g root -o root -m 755  debian/tmp/lib/openafs/*o \
-               debian/$(modulepkg)/lib/modules/$(KVERS)/fs
-# Fix some stuff up
-       if test -f debian/$(modulepkg)/lib/modules/$(KVERS)/fs/openafs.o -a ! -f debian/$(modulepkg)/lib/modules/$(KVERS)/fs/openafs.mp.o; then ln debian/$(modulepkg)/lib/modules/$(KVERS)/fs/openafs.o debian/$(modulepkg)/lib/modules/$(KVERS)/fs/openafs.mp.o; fi
-       install -d -o root -g root -m 755 debian/$(modulepkg)/usr/share/doc
-       ln -s openafs-client debian/$(modulepkg)/usr/share/doc/$(modulepkg)
+install-modules: build-modules-stamp
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       cd src/libafs && make install
+       install -d -g root -o root -m 755 $(moduledir)
+       install -g root -o root -m 755 debian/tmp/lib/openafs/*o $(moduledir)/
+       if test -f $(moduledir)/openafs.o \
+               -a ! -f $(moduledir)/openafs.mp.o ; then \
+           ln $(moduledir)/openafs.o $(moduledir)/openafs.mp.o || exit 1 ; \
+       fi
        rm -rf debian/$(modulepkg)/usr/include
-ifeq ($(KERNEL_DEPENDS),y)
-       sh debian/prep-modules $(KSRC) debian/control.module > debian/control
-else
-       sh debian/prep-modules $(KSRC) debian/control.module-image > debian/control
-endif
-
-# Install control files
-       install -d -o root -g root -m 755 debian/$(modulepkg)/DEBIAN
-       install -p -o root -g root -m 755 debian/prerm.mod \
-               debian/$(modulepkg)/DEBIAN/prerm
-       install -p -o root -g root -m 755 debian/postinst.mod \
-               debian/$(modulepkg)/DEBIAN/postinst
 
-# And now.. for the final packaging!
-       find debian/$(modulepkg) -type f | grep -v "./DEBIAN" | xargs md5sum | \
-               sed -e 's#debian/$(modulepkg)/##' > debian/$(modulepkg)/DEBIAN/md5sums
+binary-modules: install-modules
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       dh_installmodules
+       dh_strip
+       dh_link
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_gencontrol -- -v`cat debian/VERSION`
+       dh_md5sums
+       dh_builddeb --destdir="$(KPKG_DEST_DIR)"
 
-       dpkg-gencontrol -isp \
-               -p$(modulepkg) \
-               -v`cat debian/VERSION` \
-               -Pdebian/$(modulepkg)
-       chown -R root.root debian/$(modulepkg)
-       chmod -R go=rX debian/$(modulepkg)
-       dpkg --build debian/$(modulepkg) $(KPKG_DEST_DIR)
+.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: kdist_configure kdist_image kdist kdist_clean binary-source
+.PHONY: configure-modules build-modules install-modules binary-modules