]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Add support for building modules source tarball
authorSam Hartman <hartmans@debian.org>
Mon, 6 Nov 2000 16:54:33 +0000 (16:54 +0000)
committerSam Hartman <hartmans@debian.org>
Mon, 6 Nov 2000 16:54:33 +0000 (16:54 +0000)
debian/changelog
debian/control
debian/control.module [new file with mode: 0644]
debian/control.module-image [new file with mode: 0644]
debian/genchanges.sh [new file with mode: 0644]
debian/openafs-client.dirs
debian/postinst.mod [new file with mode: 0644]
debian/prep-modules [new file with mode: 0644]
debian/prerm.mod [new file with mode: 0644]
debian/rules

index bfd66823f351f04ad325a67fa3e44170b5dd1ee9..6538e5984c51f7de7703538f5dd912e8bd74f306 100644 (file)
@@ -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
 
- --
+ --  <hartmans@mit.edu>  Mon,  6 Nov 2000 09:39:11 -0500
 
 openafs (1.0.snap20001103-1) unstable; urgency=low
 
index d1ae095d4d1bf8b3e2fa3026e1cccfdcbd046a35..b3cbe4e99990aee6bf951c623ca4fb65382818ee 100644 (file)
@@ -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 (file)
index 0000000..b2fbd9c
--- /dev/null
@@ -0,0 +1,16 @@
+Source: openafs
+Section: non-us
+Priority: optional
+Maintainer: Sam Hartman <hartmans@mit.edu>
+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 (file)
index 0000000..495a9cb
--- /dev/null
@@ -0,0 +1,17 @@
+Source: openafs
+Section: non-us
+Priority: optional
+Maintainer: Sam Hartman <hartmans@mit.edu>
+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 (file)
index 0000000..d5e6dc5
--- /dev/null
@@ -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"
index 2df2637033c3a961ab78c8887882ad712120beef..4d84506fde56c91ce90031bef8169fc77c3a5f93 100644 (file)
@@ -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 (file)
index 0000000..667894f
--- /dev/null
@@ -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 (file)
index 0000000..939976d
--- /dev/null
@@ -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 (file)
index 0000000..f11f4e1
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh -e
+exit 0
index ae49c24168b9682aba9b2ea063067c38d47c9cdb..d7d7c2e5fb8d9335c4085d2c40e2a1c64f115fef 100755 (executable)
@@ -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)