#!/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.
modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH}
moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs
-configure: configure-modules-stamp
-configure-stamp:
+%:
+ dh $@
+
+override_dh_auto_configure:
@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 \
+ sh configure --prefix=$(CURDIR)/debian/tmp \
+ --with-afs-sysname=$(SYS_NAME) \
+ --with-linux-kernel-headers=$(KSRC) \
--with-linux-kernel-packaging --enable-disconnected \
--enable-debug --enable-debug-lwp --enable-debug-kernel \
$(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS)
- touch $@
-build: build-arch build-indep
-build-arch: build-stamp
-build-indep:
-build-stamp: configure-stamp
- $(MAKE)
- touch $@
+override_dh_auto_install:
+ cd src/libafs && make install DESTDIR=$(CURDIR)/debian/tmp
+ install -d -g root -o root -m 755 $(moduledir)
+ install -g root -o root -m 644 \
+ debian/tmp/lib/modules/*/extra/openafs/*o $(moduledir)/
-clean:
- dh_testdir
- dh_testroot
+override_dh_clean:
rm -rf src/libafs/MODLOAD-* *-stamp
dh_clean Makefile config.log config.status src/libafs/Makefile \
src/libafs/Makefile.common src/libafs/asm src/libafs/asm-generic \
src/libafs/h src/libafs/linux src/libafs/net src/libafs/netinet \
src/libafs/rpc src/libafs/sys
-install: install-stamp
-install-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_clean -k
- cd src/libafs && make install DESTDIR=$(CURDIR)/debian/tmp
- install -d -g root -o root -m 755 $(moduledir)
- install -g root -o root -m 644 \
- debian/tmp/lib/modules/*/extra/openafs/*o $(moduledir)/
- touch $@
-
-binary: binary-arch binary-indep
-binary-indep:
-binary-arch: install-stamp
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installmodules
- dh_strip
- dh_link
- dh_compress
- dh_fixperms
- dh_installdeb
+override_dh_gencontrol:
dh_gencontrol -- -v`cat debian/VERSION`
- dh_md5sums
- dh_builddeb --destdir="$(KPKG_DEST_DIR)"
-#################### Module package support (make-kpkg) ####################
+override_dh_builddeb:
+ dh_builddeb --destdir="$(KPKG_DEST_DIR)"
-kdist_configure: configure-stamp
+kdist_configure: override_dh_auto_configure
-kdist_image: build-stamp
+kdist_image:
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
-kdist: build-stamp
+kdist:
$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch
KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \
sh -v debian/genchanges
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
+.PHONY: kdist kdist_clean kdist_configure kdist_image