From 871eccf50033f76b6eb9aa1d431ed8a54e47127e Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 20 Aug 2007 04:48:31 +0000 Subject: [PATCH] * 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). --- debian/changelog | 11 ++ debian/control | 5 +- debian/module/compat | 1 + debian/{control.module => module/control} | 4 +- debian/{ => module}/kernel-version | 0 debian/{ => module}/prep-modules | 0 debian/module/rules | 125 +++++++++++++++++ debian/{kern-sysname => module/sysname} | 0 debian/rules | 157 ++++++---------------- 9 files changed, 180 insertions(+), 123 deletions(-) create mode 100644 debian/module/compat rename debian/{control.module => module/control} (89%) rename debian/{ => module}/kernel-version (100%) rename debian/{ => module}/prep-modules (100%) create mode 100755 debian/module/rules rename debian/{kern-sysname => module/sysname} (100%) 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/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/control.module b/debian/module/control similarity index 89% rename from debian/control.module rename to debian/module/control index 66aaad4eb..31c8aab3b 100644 --- a/debian/control.module +++ b/debian/module/control @@ -3,8 +3,8 @@ Section: net Priority: optional Maintainer: Sam Hartman Uploaders: Russ Allbery -Build-Depends: debhelper (>= 4.1.16), flex, bison -Standards-Version: 3.6.2 +Build-Depends: debhelper (>= 5), flex, bison +Standards-Version: 3.7.2 Package: openafs-modules-=KVERS Conflicts: openafs-client (<< 1.2.9) diff --git a/debian/kernel-version b/debian/module/kernel-version similarity index 100% rename from debian/kernel-version rename to debian/module/kernel-version diff --git a/debian/prep-modules b/debian/module/prep-modules similarity index 100% rename from debian/prep-modules rename to debian/module/prep-modules 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/kern-sysname b/debian/module/sysname similarity index 100% rename from debian/kern-sysname rename to debian/module/sysname 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 -- 2.39.5