From: Sam Hartman Date: Mon, 6 Nov 2000 16:54:33 +0000 (+0000) Subject: Add support for building modules source tarball X-Git-Tag: debian/1.0.snap20001104-1~3 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=74b7b90e25843bcdd15b642b163426e995129b9b;p=packages%2Fo%2Fopenafs.git Add support for building modules source tarball --- diff --git a/debian/changelog b/debian/changelog index bfd66823f..6538e5984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ openafs (1.0.snap20001104-1) unstable; urgency=low * Fix path to afsd in /etc/init.d/openafs-client * Build openafs module packages - -- + -- Mon, 6 Nov 2000 09:39:11 -0500 openafs (1.0.snap20001103-1) unstable; urgency=low diff --git a/debian/control b/debian/control index d1ae095d4..b3cbe4e99 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.1.1 Package: openafs-client Architecture: any -Depends: ${shlibs:Depends}, debconf +Depends: ${shlibs:Depends}, debconf, openafs-modules Description: The AFS distributed filesystem- client support AFS is a distributed filesystem allowing cross-platform sharing of files among multiple computers. Facilities are provided for access diff --git a/debian/control.module b/debian/control.module new file mode 100644 index 000000000..b2fbd9ce1 --- /dev/null +++ b/debian/control.module @@ -0,0 +1,16 @@ +Source: openafs +Section: non-us +Priority: optional +Maintainer: Sam Hartman +Standards-Version: 3.1.1 + +Package: openafs-modules-=KVERS +Conflicts: openafs-client (= 1.0.snap20001103-1) +Provides: openafs-modules +Architecture: any +Description: The 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 kernel module for the filesystem diff --git a/debian/control.module-image b/debian/control.module-image new file mode 100644 index 000000000..495a9cb1c --- /dev/null +++ b/debian/control.module-image @@ -0,0 +1,17 @@ +Source: openafs +Section: non-us +Priority: optional +Maintainer: Sam Hartman +Standards-Version: 3.1.1 + +Package: openafs-modules-=KVERS +Conflicts: openafs-client (= 1.0.snap20001103-1) +Provides: openafs-modules +Architecture: any +Recommends: kernel-image-=KVERS (= =KREVS) +Description: The 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 kernel module for the filesystem diff --git a/debian/genchanges.sh b/debian/genchanges.sh new file mode 100644 index 000000000..d5e6dc573 --- /dev/null +++ b/debian/genchanges.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# genchanges.sh - generate a changes file for a deb file generated via +# the make-kpkg utility + +# KSRC KMAINT and KEMAIL are expected to be passed through the environment + +set -e +umask 022 + +#KVERS=`cat debian/KVERS` +MODVERS=`cat debian/VERSION | sed s/:/\+/` +ARCH=`dpkg --print-architecture` + +mprefix=`grep Package: debian/control.module | cut -d' ' -f 2 | cut -d= -f 1` + +# the changes file's name +chfile="$KSRC/../$mprefix${KVERS}_${MODVERS}_${ARCH}.changes" + +dpkg-genchanges -b ${KMAINT:+-m"$KMAINT <$KEMAIL>"} -u"$KSRC/.." \ + -cdebian/control > "$chfile.pt" +pgp -fast ${KMAINT:+-u"$KMAINT"} < "$chfile.pt" > "$chfile" +rm "$chfile.pt" diff --git a/debian/openafs-client.dirs b/debian/openafs-client.dirs index 2df263703..4d84506fd 100644 --- a/debian/openafs-client.dirs +++ b/debian/openafs-client.dirs @@ -1,3 +1,4 @@ +afs var/cache/openafs etc/openafs etc/init.d diff --git a/debian/postinst.mod b/debian/postinst.mod new file mode 100644 index 000000000..667894f19 --- /dev/null +++ b/debian/postinst.mod @@ -0,0 +1,6 @@ +#!/bin/sh -e + +depmod -a +update-modules + +exit 0 diff --git a/debian/prep-modules b/debian/prep-modules new file mode 100644 index 000000000..939976d7a --- /dev/null +++ b/debian/prep-modules @@ -0,0 +1,54 @@ +#! /bin/sh + +set -e + +if [ $# -ne 2 ]; then + echo Usage: $0 kernelsource-location control-template + exit 1 +fi + + +changelog="$1/debian/changelog" +if [ -n "$KVERS" ] && [ -n "$KDREV" ]; then + linuxversion=$KVERS + kernversion=$KDREV + +elif [ ! -f $changelog ]; then + linuxversion=`awk '{ if (NR==1) v=$3; else if (NR==2) p=$3; else if (NR==3) s=$3; \ + else if (NR==4) { e=$3; exit; } } \ + END { printf("%s.%s.%s%s\n",v,p,s,e); }' $1/Makefile` + + if [ -z "$KDREV" ]; then + kernversion=$linuxversion-0 + else + kernversion=$KDREV + fi + +else + linuxversion=`head -1 $changelog | \ + sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\1/'` + kernversion=`head -1 $changelog | \ + sed -e 's/.*source-\([^ ]*\) (\([^)]*\)).*/\2/'` +fi + +pkgversion=`head -1 debian/changelog | \ + sed -e 's/.*(\([^)]*\)).*/\1/'` + +pkgupversion=`echo $pkgversion | cut -d- -f 1` +pkgupversion2=`perl -e "\"$pkgupversion\" =~ /(.*?)(\d+)\D*$/;"'printf $1 . ($2+1);'` + +sed -e s/=KVERS/$linuxversion/g -e s/=KREVS/$kernversion/g -e s/=AVERS/$pkgupversion/g -e s/=2AVERS/$pkgupversion2/g $2 + +mprefix=`grep Package: $2 | cut -d' ' -f 2 | cut -d= -f 1` + +rm -f debian/tmp/usr/share/doc/$mprefix$linuxversion + + +epochversion=`echo $kernversion | sed -n -e 's/^\([0-9]*\):.*/\1/p' -e 's/.*//'` +kernversion="$pkgversion+`echo $kernversion | sed -e 's/^[0-9]*://'`" + +if [ -n "$epochversion" ]; then + kernversion=$epochversion:$kernversion +fi +echo "$kernversion" > debian/VERSION +echo "$linuxversion" > debian/KVERS diff --git a/debian/prerm.mod b/debian/prerm.mod new file mode 100644 index 000000000..f11f4e184 --- /dev/null +++ b/debian/prerm.mod @@ -0,0 +1,2 @@ +#!/bin/sh -e +exit 0 diff --git a/debian/rules b/debian/rules index ae49c2416..d7d7c2e5f 100755 --- a/debian/rules +++ b/debian/rules @@ -18,8 +18,8 @@ export DH_OPTIONS # The AFS sysname is determined by a script SYS_NAME=$(shell debian/sysname) package=openafs -srcpkg = openafs-module-source -modulepkg=openafs-module-$(KVERS) +srcpkg = openafs-modules-source +modulepkg=$(shell echo openafs-modules-$(KVERS)) ifndef KSRC KSRC=/usr/src/linux endif @@ -28,6 +28,8 @@ KVERS=`awk '{ if (NR==1) v=$$3; else if (NR==2) p=$$3; else if (NR==3) s=$$3; \ else if (NR==4) { e=$$3; exit; } } \ END { printf("%s.%s.%s%s\n",v,p,s,e); }' $(KSRC)/Makefile` +export KSRC +export KVERS configure: configure-stamp @@ -79,7 +81,7 @@ install: build # Build architecture-independent files here. # Pass -i to all debhelper commands in this target to reduce clutter. binary-indep: DH_OPTIONS=-i -binary-indep: build install +binary-indep: build install binary-source # Need this version of debhelper for DH_OPTIONS to work. dh_testversion 1.1.17 dh_testdir @@ -142,15 +144,15 @@ binary-arch: build install dh_md5sums dh_builddeb -binary: binary-arch +binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install configure ############################Module package support -kdist_image: build +kdist_image: build-modules $(MAKE) $(MFLAGS) -f debian/rules MODDIR=$(KSRC)/.. binary-modules $(MAKE) $(MFLAGS) -f debian/rules MODDIR=$(KSRC)/.. clean -kdist: build +kdist: build-modules $(MAKE) $(MFLAGS) -f debian/rules MODDIR=$(KSRC)/.. KERNEL_DEPENDS=y binary-modules KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \ sh -v debian/genchanges.sh @@ -174,7 +176,8 @@ binary-source: install -d debian/$(srcpkg) # Clean up the sources install -d debian/$(srcpkg)/usr/src/modules/$(package) - find . \( -name \*.o -o -path ./debian/$(srcpkg) -o -path \*/CVS \) -prune -o -print | \ + find . \( -name \*.o -o -path ./debian/$(srcpkg) -o -path \*/CVS -o -path ./src/WINNT \ + -o -path ./obj -o -path ./$(SYS_NAME) \) -prune -o -print | \ cpio -admp debian/$(srcpkg)/usr/src/modules/$(package) ( cd debian/$(srcpkg)/usr/src/modules/$(package); \ $(MAKE) -f debian/rules clean) @@ -230,7 +233,7 @@ endif sed -e 's#debian/$(modulepkg)/##' > debian/$(modulepkg)/DEBIAN/md5sums dpkg-gencontrol -isp \ - -p`\ls -1 debian/$(modulepkg)/usr/share/doc` \ + -p$(modulepkg) \ -v`cat debian/VERSION` \ -Pdebian/$(modulepkg) chown -R root.root debian/$(modulepkg)