]> git.proxmox.com Git - mirror_spl-debian.git/blobdiff - debian/rules
Merge tag 'upstream/0.6.2'
[mirror_spl-debian.git] / debian / rules
index 71a775f61ee507b99509a32942de29ba4ac6ccc4..f86f91977c5af0a72400c7e8a7871501a5143780 100755 (executable)
@@ -7,6 +7,14 @@ VERSION := $(shell dpkg-parsechangelog \
 DKMSFILES := module include config spl.release.in autogen.sh \
                META AUTHORS DISCLAIMER
 
+ifndef DEB_HOST_ARCH
+DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+endif
+
+ifndef KVERS
+KVERS=$(shell uname -r)
+endif
+
 non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
 PACKAGE=spl
 pmodules = $(PACKAGE)-modules-$(non_epoch_version)
@@ -70,40 +78,41 @@ override_dh_dkms:
 override_dh_auto_clean:
        dh_auto_clean
        @if test -e META.orig; then mv META.orig META; fi
+       cp debian/control.in debian/control
 
 # ------------
 
 override_dh_prep-deb-files:
        for templ in $(wildcard $(CURDIR)/debian/*_KVERS_*.in); do \
-               sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g  ' \
-               < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g' -e 's/\.in$$//'` ; \
+               sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ;  s/_ARCH_/$(DEB_HOST_ARCH)/g' \
+               < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g ; s/\.in$$//'` ; \
        done
-       sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g  ' \
+       sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g' \
        < debian/control.modules.in > debian/control
 
 override_dh_configure_modules: override_dh_configure_modules_stamp
 override_dh_configure_modules_stamp:
        ./configure --with-config=kernel --with-linux=$(KSRC) \
-               --with-linux-obj=$(KSRC)
+               --with-linux-obj=$(KOBJ)
        touch override_dh_configure_modules_stamp
 
 override_dh_binary-modules-udeb: override_dh_prep-deb-files override_dh_configure_modules
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
 
        $(MAKE) -C $(CURDIR)/module modules
 
-       dh_installdirs -p${pmodules}-amd64-di
-       dh_install -p${pmodules}-amd64-di
-       dh_gencontrol -p${pmodules}-amd64-di
+       dh_installdirs -p${pmodules}-di
+       dh_install -p${pmodules}-di
+       dh_gencontrol -p${pmodules}-di
 
-       dh_builddeb -p${pmodules}-amd64-di --destdir=$(DEB_DESTDIR)
+       dh_builddeb -p${pmodules}-di
 
 override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_modules
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
 
        $(MAKE) -C $(CURDIR)/module modules
 
@@ -114,7 +123,7 @@ override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_mod
        dh_strip -p${pmodules}
        dh_fixperms -p${pmodules}
        dh_installdeb -p${pmodules}
-       dh_gencontrol -p${pmodules} -- -v$(VERSION)
+       dh_gencontrol -p${pmodules}
        dh_md5sums -p${pmodules}
 
-       dh_builddeb -p${pmodules} --destdir=$(DEB_DESTDIR)
+       dh_builddeb -p${pmodules}