From: Russ Allbery Date: Mon, 20 Aug 2007 04:48:31 +0000 (+0000) Subject: * Restructure the source for the module package. The build files for X-Git-Tag: debian/1.4.4.dfsg1-7~11 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=871eccf50033f76b6eb9aa1d431ed8a54e47127e;p=packages%2Fo%2Fopenafs.git * Restructure the source for the module package. The build files for the module build are now in debian/module in the source package and there is a completely separate rules file. This way, the module build rules don't have to depend on quilt and the structure is clearer. * Fix debhelper dependencies for the module build. * Update module standards version to 3.7.2 (no changes required). --- diff --git a/debian/changelog b/debian/changelog index 4cb141ed9..0ce09616e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +openafs (1.4.4.dfsg1-7) unstable; urgency=low + + * Restructure the source for the module package. The build files for + the module build are now in debian/module in the source package and + there is a completely separate rules file. This way, the module build + rules don't have to depend on quilt and the structure is clearer. + * Fix debhelper dependencies for the module build. + * Update module standards version to 3.7.2 (no changes required). + + -- + openafs (1.4.4.dfsg1-6) unstable; urgency=low * Apply upstream patch for the OpenAFS file server to treat clients that diff --git a/debian/control b/debian/control index 97e151139..5c941631e 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,8 @@ Priority: optional Maintainer: Sam Hartman Uploaders: Russ Allbery Build-Depends: debhelper (>= 5), libncurses5-dev, libpam0g-dev, bison, - docbook-to-man, flex, perl, comerr-dev, libkrb5-dev, autoconf, automake + docbook-to-man, flex, perl, comerr-dev, libkrb5-dev, autoconf, automake, + quilt (>= 0.40) Standards-Version: 3.7.2 Package: openafs-client @@ -106,7 +107,7 @@ Description: AFS distributed filesystem development libraries Package: openafs-modules-source Priority: extra -Depends: bison, flex, debhelper (>= 4.0.0), kernel-package | module-assistant +Depends: bison, flex, debhelper (>= 5), kernel-package | module-assistant Architecture: all Description: AFS distributed filesystem kernel module source AFS is a distributed filesystem allowing cross-platform sharing of diff --git a/debian/control.module b/debian/control.module deleted file mode 100644 index 66aaad4eb..000000000 --- a/debian/control.module +++ /dev/null @@ -1,20 +0,0 @@ -Source: openafs -Section: net -Priority: optional -Maintainer: Sam Hartman -Uploaders: Russ Allbery -Build-Depends: debhelper (>= 4.1.16), flex, bison -Standards-Version: 3.6.2 - -Package: openafs-modules-=KVERS -Conflicts: openafs-client (<< 1.2.9) -Provides: openafs-modules2 -Architecture: any -Recommends: =IMG-=KVERS -Description: AFS distributed filesystem kernel module - AFS is a distributed filesystem allowing cross-platform sharing of - files among multiple computers. Facilities are provided for access - control, authentication, backup and administrative management. - . - This package provides the compiled AFS kernel module for kernel - version =KVERS. diff --git a/debian/kern-sysname b/debian/kern-sysname deleted file mode 100644 index cdb96923e..000000000 --- a/debian/kern-sysname +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/sh - -if [ x"$KVERS" = x ] ; then - echo "ERROR: no kernel version" >&2 - echo " ($KSRC/include/linux/version.h not found?)" >&2 - echo UNKNOWN - exit 1 -fi - -case `dpkg --print-architecture` in -alpha) - case $KVERS in - 2.2*) - echo alpha_linux_22 - ;; - 2.4*) - echo alpha_linux_24 - ;; - 2.6*) - echo alpha_linux_26 - ;; - esac - ;; -amd64) - case $KVERS in - 2.4*) - echo amd64_linux24 - ;; - 2.6*) - echo amd64_linux26 - ;; - esac - ;; -hppa) - case $KVERS in - 2.4*) - echo parisc_linux24 - ;; - esac - ;; -i[3456]86) - case $KVERS in - 2.2*) - echo i386_linux22 - ;; - 2.4*) - echo i386_linux24 - ;; - 2.6*) - echo i386_linux26 - ;; - esac - ;; -ia64) - case $KVERS in - 2.4*) - echo ia64_linux24 - ;; - 2.6*) - echo ia64_linux26 - ;; - esac - ;; -powerpc) - case $KVERS in - 2.2*) - echo ppc_linux22 - ;; - 2.4*) - echo ppc_linux24 - ;; - 2.6) - echo ppc_linux26 - ;; - esac - ;; -ppc64) - case $KVERS in - 2.4*) - echo ppc64_linux24 - ;; - 2.6*) - echo ppc64_linux26 - ;; - esac - ;; -s390) - case $KVERS in - 2.4*) - echo s390_linux24 - ;; - 2.6*) - echo s390_linux26 - ;; - esac - ;; -s390x) - case $KVERS in - 2.4*) - echo s390x_linux24 - ;; - 2.6*) - echo s390x_linux26 - ;; - esac - ;; -sparc) - case $KVERS in - 2.2*) - echo sparc_linux22 - ;; - 2.4*) - echo sparc_linux24 - ;; - esac - ;; -sparc64) - case $KVERS in - 2.2*) - echo sparc64_linux22 - ;; - 2.4*) - echo sparc64_linux24 - ;; - 2.6*) - echo sparc64_linux26 - ;; - esac - ;; -*) - echo "ERROR: unsupported architecture" >&2 - echo UNKNOWN - exit 1 -esac diff --git a/debian/kernel-version b/debian/kernel-version deleted file mode 100755 index a1985a277..000000000 --- a/debian/kernel-version +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl -# -# Extract the kernel version from the kernel version header file. Takes the -# kernel source path as its only argument. If the version header couldn't be -# found, print nothing and exit quietly. - -my $ksrc = shift; -unless ($ksrc && open (VERSION, "$ksrc/include/linux/version.h")) { - exit 0; -} -my $found; -my $line = ; -if ($line =~ /"(.+)"/) { - print "$1\n"; - $found = 1; -} -exit 0 if $found; -unless (open (VERSION, "$ksrc/include/config/kernel.release")) { - exit 0; -} -if ($line = ) { - print "$line"; -} -exit 0; diff --git a/debian/module/compat b/debian/module/compat new file mode 100644 index 000000000..7ed6ff82d --- /dev/null +++ b/debian/module/compat @@ -0,0 +1 @@ +5 diff --git a/debian/module/control b/debian/module/control new file mode 100644 index 000000000..31c8aab3b --- /dev/null +++ b/debian/module/control @@ -0,0 +1,20 @@ +Source: openafs +Section: net +Priority: optional +Maintainer: Sam Hartman +Uploaders: Russ Allbery +Build-Depends: debhelper (>= 5), flex, bison +Standards-Version: 3.7.2 + +Package: openafs-modules-=KVERS +Conflicts: openafs-client (<< 1.2.9) +Provides: openafs-modules2 +Architecture: any +Recommends: =IMG-=KVERS +Description: AFS distributed filesystem kernel module + AFS is a distributed filesystem allowing cross-platform sharing of + files among multiple computers. Facilities are provided for access + control, authentication, backup and administrative management. + . + This package provides the compiled AFS kernel module for kernel + version =KVERS. diff --git a/debian/module/kernel-version b/debian/module/kernel-version new file mode 100755 index 000000000..a1985a277 --- /dev/null +++ b/debian/module/kernel-version @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# +# Extract the kernel version from the kernel version header file. Takes the +# kernel source path as its only argument. If the version header couldn't be +# found, print nothing and exit quietly. + +my $ksrc = shift; +unless ($ksrc && open (VERSION, "$ksrc/include/linux/version.h")) { + exit 0; +} +my $found; +my $line = ; +if ($line =~ /"(.+)"/) { + print "$1\n"; + $found = 1; +} +exit 0 if $found; +unless (open (VERSION, "$ksrc/include/config/kernel.release")) { + exit 0; +} +if ($line = ) { + print "$line"; +} +exit 0; diff --git a/debian/module/prep-modules b/debian/module/prep-modules new file mode 100644 index 000000000..0ab5d5c10 --- /dev/null +++ b/debian/module/prep-modules @@ -0,0 +1,103 @@ +#! /bin/sh +# +# Prepares to build kernel modules. This script figures out and munges +# version strings. The goal is: +# +# * Set the package name to openafs-modules-$(KVERS) where $(KVERS) is the +# major kernel revision plus the debian subrevision and whatever +# architecture string is appropriate if building against the stock Debian +# kernels. $(KVERS) should be identical to the version component contained +# in the Debian kernel package names. +# +# * Make the package recommend either kernel-image-$(KVERS) or +# linux-image-$(KVERS) as appropriate for the kernel version that we're +# building against. Use recommend rather than depends since the user may +# have built their own kernel outside of the Debian package infrastructure. +# +# * Save the version number of the binary package in debian/VERSION for later +# use by dh_gencontrol. This will be the version number of the source +# package followed by a + and the version number of the kernel package that +# we're building against. If the kernel package version contains an epoch, +# try to hack our way into doing the right thing by using that epoch number +# as our own. This isn't quite the right thing, but seems reasonably good. +# +# This script generates debian/control from debian/control.module using sed. +# Unfortunately, substvars cannot be used since the name of the package is +# modified and substvars happens too late. It also outputs debian/VERSION, +# containing the version of the binary package. + +set -e + +if [ "$#" -ne 1 ]; then + echo Usage: $0 kernelsource-location + exit 1 +fi + +# We can get the kernel version from one of three places. If KVERS and KDREV +# are both already set in the environment (which will be the case when invoked +# by make-kpkg or module-assistant), use them. Otherwise, if we have a kernel +# source directory that contains debian/changelog (generated by make-kpkg), +# parse that file to find the version information. Finally, if neither works, +# extract the kernel version from the kernel headers, append INT_SUBARCH to +# that version if it's available, and assume a kernel package revision of -0 +# if none is provided. +# +# Set the variables $afs_kvers, which will hold the revision of the kernel, +# and $afs_kdrev, which will hold the version of the kernel package that we're +# building against. + +changelog="$1/debian/changelog" +if [ -n "$KVERS" ] && [ -n "$KDREV" ]; then + afs_kvers="${KVERS}${INT_SUBARCH}" + afs_kdrev="${KDREV}" +elif [ ! -f "$changelog" ] ; then + if [ -n "$KVERS" ] ; then + afs_kvers="$KVERS" + else + afs_kvers=`perl debian/kernel-version "$1"` + fi + if [ -z "$KDREV" ] ; then + afs_kdrev="${afs_kvers}-0" + else + afs_kvers="${afs_kvers}${INT_SUBARCH}" + afs_kdrev="${KDREV}" + fi +else + if [ -n "$KVERS" ] ; then + afs_kvers="$KVERS" + else + afs_kvers=`head -1 "$changelog" \ + | sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\1/'` + fi + afs_kdrev=`head -1 "$changelog" \ + | sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\2/'` +fi + +# Determine the kernel package name. For right now, assume linux-image for +# 2.6.12 and later, and kernel-image for anything earlier. If this doesn't +# work for someone, please submit a bug with the details. + +if dpkg --compare-versions "$afs_kvers" ge "2.6.12" ; then + afs_image=linux-image +else + afs_image=kernel-image +fi + +# Generate the control file from the template. + +sed -e "s/=KVERS/${afs_kvers}/g" -e "s/=IMG/${afs_image}/g" \ + debian/control.module > debian/control + +# Now, calcuate the binary package version. Extract the epoch from the kernel +# package revision and add it to the beginning of the binary package version +# if present. Then, concatenate the source version, '+', and the kernel +# package revision without the epoch. + +afs_version=`head -1 debian/changelog | sed -e 's/.*(\([^)]*\)).*/\1/'` +afs_epoch=`echo ${afs_kdrev} | sed -n -e 's/^\([0-9]*\):.*/\1/p'` +afs_version="${afs_version}+`echo ${afs_kdrev} | sed -e 's/^[0-9]*://'`" +if [ -n "$afs_epoch" ] ; then + afs_version="${afs_epoch}:${afs_version}" +fi + +echo "$afs_version" > debian/VERSION diff --git a/debian/module/rules b/debian/module/rules new file mode 100755 index 000000000..359b373fc --- /dev/null +++ b/debian/module/rules @@ -0,0 +1,125 @@ +#!/usr/bin/make -f +# Based on sample debian/rules that uses debhelper. +# GNU copyright 1997 by Joey Hess. +# +# The rules file for the OpenAFS module build. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +# Tell Autoconf the correct system types. +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)) + SYSTEM = --build $(DEB_HOST_GNU_TYPE) +else + SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + +# Determine whether we're building with optimization. This doesn't really +# work at the moment due to upstream problems. +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + DEBIAN_OPT_FLAGS = --disable-optimize --disable-lwp-optimize + DEBIAN_KERN_FLAGS = --disable-kernel-optimize +else + DEBIAN_OPT_FLAGS = + DEBIAN_KERN_FLAGS = +endif + +# Find kernel build information. +ifndef KSRC + KSRC = /usr/src/linux +endif +ifndef KPKG_DEST_DIR + KPKG_DEST_DIR = .. +endif +KVERS := $(shell perl debian/kernel-version $(KSRC)) +export KSRC +export KVERS +export KPKG_DEST_DIR + +SYS_NAME := $(shell KSRC="$(KSRC)" KVERS="$(KVERS)" sh debian/sysname) + +package = openafs +modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH} +moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs + +configure: configure-modules-stamp +configure-stamp: + @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi + @if test x"$(KVERS)" = x ; then \ + echo 'No version in $(KSRC)/include/linux/version.h' >&2 ; \ + exit 1 ; \ + fi + sh debian/prep-modules $(KSRC) + 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-stamp + +build: build-arch build-indep +build-arch: build-arch-stamp +build-indep: +build-arch-stamp: configure-stamp + make only_libafs + touch build-arch-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp configure-stamp + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean + +install: build-arch-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 + +binary: binary-arch binary-indep +binary-indep: +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs NEWS + 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)" + +#################### Module package support (make-kpkg) #################### + +kdist_configure: configure-stamp + +kdist_image: build-arch-stamp + $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch + $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean + +kdist: build-arch-stamp + $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch + KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \ + sh -v debian/genchanges.sh + $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean + +kdist_clean: + $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean + +.PHONY: binary binary-arch binary-indep build build-arch build-indep clean +.PHONY: configure install kdist kdist_clean kdist_configure kdist_image diff --git a/debian/module/sysname b/debian/module/sysname new file mode 100644 index 000000000..cdb96923e --- /dev/null +++ b/debian/module/sysname @@ -0,0 +1,134 @@ +#!/bin/sh + +if [ x"$KVERS" = x ] ; then + echo "ERROR: no kernel version" >&2 + echo " ($KSRC/include/linux/version.h not found?)" >&2 + echo UNKNOWN + exit 1 +fi + +case `dpkg --print-architecture` in +alpha) + case $KVERS in + 2.2*) + echo alpha_linux_22 + ;; + 2.4*) + echo alpha_linux_24 + ;; + 2.6*) + echo alpha_linux_26 + ;; + esac + ;; +amd64) + case $KVERS in + 2.4*) + echo amd64_linux24 + ;; + 2.6*) + echo amd64_linux26 + ;; + esac + ;; +hppa) + case $KVERS in + 2.4*) + echo parisc_linux24 + ;; + esac + ;; +i[3456]86) + case $KVERS in + 2.2*) + echo i386_linux22 + ;; + 2.4*) + echo i386_linux24 + ;; + 2.6*) + echo i386_linux26 + ;; + esac + ;; +ia64) + case $KVERS in + 2.4*) + echo ia64_linux24 + ;; + 2.6*) + echo ia64_linux26 + ;; + esac + ;; +powerpc) + case $KVERS in + 2.2*) + echo ppc_linux22 + ;; + 2.4*) + echo ppc_linux24 + ;; + 2.6) + echo ppc_linux26 + ;; + esac + ;; +ppc64) + case $KVERS in + 2.4*) + echo ppc64_linux24 + ;; + 2.6*) + echo ppc64_linux26 + ;; + esac + ;; +s390) + case $KVERS in + 2.4*) + echo s390_linux24 + ;; + 2.6*) + echo s390_linux26 + ;; + esac + ;; +s390x) + case $KVERS in + 2.4*) + echo s390x_linux24 + ;; + 2.6*) + echo s390x_linux26 + ;; + esac + ;; +sparc) + case $KVERS in + 2.2*) + echo sparc_linux22 + ;; + 2.4*) + echo sparc_linux24 + ;; + esac + ;; +sparc64) + case $KVERS in + 2.2*) + echo sparc64_linux22 + ;; + 2.4*) + echo sparc64_linux24 + ;; + 2.6*) + echo sparc64_linux26 + ;; + esac + ;; +*) + echo "ERROR: unsupported architecture" >&2 + echo UNKNOWN + exit 1 +esac diff --git a/debian/prep-modules b/debian/prep-modules deleted file mode 100644 index 0ab5d5c10..000000000 --- a/debian/prep-modules +++ /dev/null @@ -1,103 +0,0 @@ -#! /bin/sh -# -# Prepares to build kernel modules. This script figures out and munges -# version strings. The goal is: -# -# * Set the package name to openafs-modules-$(KVERS) where $(KVERS) is the -# major kernel revision plus the debian subrevision and whatever -# architecture string is appropriate if building against the stock Debian -# kernels. $(KVERS) should be identical to the version component contained -# in the Debian kernel package names. -# -# * Make the package recommend either kernel-image-$(KVERS) or -# linux-image-$(KVERS) as appropriate for the kernel version that we're -# building against. Use recommend rather than depends since the user may -# have built their own kernel outside of the Debian package infrastructure. -# -# * Save the version number of the binary package in debian/VERSION for later -# use by dh_gencontrol. This will be the version number of the source -# package followed by a + and the version number of the kernel package that -# we're building against. If the kernel package version contains an epoch, -# try to hack our way into doing the right thing by using that epoch number -# as our own. This isn't quite the right thing, but seems reasonably good. -# -# This script generates debian/control from debian/control.module using sed. -# Unfortunately, substvars cannot be used since the name of the package is -# modified and substvars happens too late. It also outputs debian/VERSION, -# containing the version of the binary package. - -set -e - -if [ "$#" -ne 1 ]; then - echo Usage: $0 kernelsource-location - exit 1 -fi - -# We can get the kernel version from one of three places. If KVERS and KDREV -# are both already set in the environment (which will be the case when invoked -# by make-kpkg or module-assistant), use them. Otherwise, if we have a kernel -# source directory that contains debian/changelog (generated by make-kpkg), -# parse that file to find the version information. Finally, if neither works, -# extract the kernel version from the kernel headers, append INT_SUBARCH to -# that version if it's available, and assume a kernel package revision of -0 -# if none is provided. -# -# Set the variables $afs_kvers, which will hold the revision of the kernel, -# and $afs_kdrev, which will hold the version of the kernel package that we're -# building against. - -changelog="$1/debian/changelog" -if [ -n "$KVERS" ] && [ -n "$KDREV" ]; then - afs_kvers="${KVERS}${INT_SUBARCH}" - afs_kdrev="${KDREV}" -elif [ ! -f "$changelog" ] ; then - if [ -n "$KVERS" ] ; then - afs_kvers="$KVERS" - else - afs_kvers=`perl debian/kernel-version "$1"` - fi - if [ -z "$KDREV" ] ; then - afs_kdrev="${afs_kvers}-0" - else - afs_kvers="${afs_kvers}${INT_SUBARCH}" - afs_kdrev="${KDREV}" - fi -else - if [ -n "$KVERS" ] ; then - afs_kvers="$KVERS" - else - afs_kvers=`head -1 "$changelog" \ - | sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\1/'` - fi - afs_kdrev=`head -1 "$changelog" \ - | sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\2/'` -fi - -# Determine the kernel package name. For right now, assume linux-image for -# 2.6.12 and later, and kernel-image for anything earlier. If this doesn't -# work for someone, please submit a bug with the details. - -if dpkg --compare-versions "$afs_kvers" ge "2.6.12" ; then - afs_image=linux-image -else - afs_image=kernel-image -fi - -# Generate the control file from the template. - -sed -e "s/=KVERS/${afs_kvers}/g" -e "s/=IMG/${afs_image}/g" \ - debian/control.module > debian/control - -# Now, calcuate the binary package version. Extract the epoch from the kernel -# package revision and add it to the beginning of the binary package version -# if present. Then, concatenate the source version, '+', and the kernel -# package revision without the epoch. - -afs_version=`head -1 debian/changelog | sed -e 's/.*(\([^)]*\)).*/\1/'` -afs_epoch=`echo ${afs_kdrev} | sed -n -e 's/^\([0-9]*\):.*/\1/p'` -afs_version="${afs_version}+`echo ${afs_kdrev} | sed -e 's/^[0-9]*://'`" -if [ -n "$afs_epoch" ] ; then - afs_version="${afs_epoch}:${afs_version}" -fi - -echo "$afs_version" > debian/VERSION diff --git a/debian/rules b/debian/rules index 09378e44c..a01f1be98 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,9 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. +# Based on the 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-independent -# package. + +# Use quilt to manage patches. +include /usr/share/quilt/quilt.make # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -31,24 +30,10 @@ else DEBIAN_KERN_FLAGS = endif -# Find kernel build information. -ifndef KSRC - KSRC = /usr/src/linux -endif -ifndef KPKG_DEST_DIR - KPKG_DEST_DIR = .. -endif -KVERS := $(shell perl debian/kernel-version $(KSRC)) -export KSRC -export KVERS -export KPKG_DEST_DIR - -SYS_NAME := $(shell KSRC="$(KSRC)" KVERS="$(KVERS)" sh debian/sysname) +SYS_NAME := $(shell sh debian/sysname) package = openafs srcpkg = openafs-modules-source -modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH} -moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs # These packages have lintian overrides. LINTIAN_PACKAGES = openafs-dbserver openafs-client openafs-fileserver @@ -86,7 +71,7 @@ get-orig-source: gzip -9 openafs_$(DEBVERS).orig.tar configure: configure-stamp -configure-stamp: +configure-stamp: patch @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi dh_testdir sh regen.sh @@ -112,7 +97,7 @@ build-stamp: chmod +x debian/afs-rootvol debian/afs-newcell touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp @@ -160,6 +145,35 @@ install: build afs-newcell ) \ >debian/openafs-dbserver/usr/share/man/man8/afs-newcell.8 +# 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) \) -prune -o -print | \ + cpio -admp debian/$(srcpkg)/usr/src/modules/$(package) + mkdir -p debian/$(srcpkg)/usr/src/modules/$(package)/debian + cp debian/copyright debian/module/* \ + debian/$(srcpkg)/usr/src/modules/$(package)/debian/ + chmod 755 debian/$(srcpkg)/usr/src/modules/$(package)/debian/rules + cd debian/$(srcpkg)/usr/src/modules/$(package) && \ + $(MAKE) -f debian/rules clean + -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. # @@ -221,100 +235,5 @@ binary-arch: build install binary: binary-indep binary-arch -##################### Building openafs-modules-source ###################### - -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/$(srcpkg) -o -path \*/CVS \ - -o -path \*/.svn -o -path ./src/WINNT -o -path ./doc \ - -o -path ./obj -o -path ./$(SYS_NAME) \ - -o \( -path ./debian/\* -type d \) \ - -o -path ./debian/\*debhelper \) -prune -o -print | \ - cpio -admp debian/$(srcpkg)/usr/src/modules/$(package) - cd debian/$(srcpkg)/usr/src/modules/$(package) && \ - $(MAKE) -f debian/rules clean && \ - mv debian/kern-sysname debian/sysname - -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 - -#################### Module package support (make-kpkg) #################### - -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-stamp - $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-modules - KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \ - sh -v debian/genchanges.sh - $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean - -kdist_clean: - $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean - -######################## Kernel module build rules ######################### - -configure-modules: configure-modules-stamp -configure-modules-stamp: - @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi - @if test x"$(KVERS)" = x ; then \ - echo 'No version in $(KSRC)/include/linux/version.h' >&2 ; \ - exit 1 ; \ - fi - sh debian/prep-modules $(KSRC) - 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 - touch build-modules-stamp - -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 - -binary-modules: install-modules - dh_testdir - dh_testroot - dh_installchangelogs NEWS - 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)" - -.PHONY: binary binary-arch binary-indep binary-modules binary-source build -.PHONY: build-arch build-indep build-modules clean configure configure-modules -.PHONY: install install-modules kdist kdist_clean kdist_configure kdist_image +.PHONY: binary binary-arch binary-indep binary-source build build-arch +.PHONY: build-indep clean configure install