]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - debian/rules
Add lintian override for zfs-test
[mirror_zfs-debian.git] / debian / rules
index 8e5e2d88416303d7bb7885804c341e39498f5d19..800df22e0b7ee79ce5213d2cab54acd85a28c79f 100755 (executable)
@@ -24,6 +24,10 @@ ifndef SPL
 SPL=/usr/src/spl-$(VERSION)
 endif
 
+ifndef SPLOBJ
+SPLOBJ=/var/lib/dkms/spl/$(VERSION)/$(KVERS)/$(shell dpkg-architecture -qDEB_TARGET_GNU_CPU)
+endif
+
 non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
 PACKAGE=zfs
 pmodules = $(PACKAGE)-modules-$(non_epoch_version)
@@ -31,7 +35,7 @@ pmodules = $(PACKAGE)-modules-$(non_epoch_version)
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
-       dh $@ --with autoreconf,dkms,python2,systemd --parallel
+       dh $@ --with autoreconf,dkms,python3,systemd --parallel
 
 override_dh_auto_configure:
        @cp debian/control.in debian/control
@@ -44,10 +48,12 @@ endif
 
        @# Build the userland, but don't build the kernel modules.
        dh_auto_configure -- \
-         --bindir=/bin \
+         --bindir=/usr/bin \
          --sbindir=/sbin \
          --libdir=/lib \
          --with-udevdir=/lib/udev \
+         --with-systemdunitdir=/lib/systemd/system \
+         --with-systemdpresetdir=/lib/systemd/system-preset \
          --with-config=user
 
 override_dh_auto_test:
@@ -58,6 +64,19 @@ override_dh_auto_install:
        @# Install the utilities.
        $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
 
+       # Move from bin_dir to /usr/sbin
+       # Remove suffix (.py) as per policy 10.4 - Scripts
+       # https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
+       mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
+       mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary.py' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
+       mv '$(CURDIR)/debian/tmp/usr/bin/arcstat.py' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
+       mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat.py' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
+
+       @# Zed has dependencies outside of the system root.
+       $(INSTALL) -d '$(CURDIR)/debian/tmp/usr/sbin/'
+       mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
+
        @# Get a bare copy of the source code for DKMS.
        @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree, which does not
        @# contain the userland sources. NB: Remove-userland-dist-rules.patch
@@ -94,8 +113,8 @@ override_dh_auto_install:
                rm $${i}; \
        done
 
-       chmod -x $(CURDIR)/debian/tmp/etc/zfs/zfs-functions
-       chmod -x $(CURDIR)/debian/tmp/etc/default/zfs
+       chmod a-x $(CURDIR)/debian/tmp/etc/zfs/zfs-functions
+       chmod a-x $(CURDIR)/debian/tmp/etc/default/zfs
 
 override_dh_dkms:
        dh_dkms -V $(VERSION)
@@ -121,6 +140,8 @@ ifeq ($(BUILD_UDEB), true)
 endif
 
 override_dh_auto_clean:
+       find . -name .gitignore -delete
+       rm -rf zfs-$(VERSION)
        dh_auto_clean
        debconf-updatepo
        @if test -e META.orig; then mv META.orig META; fi
@@ -131,7 +152,7 @@ endif
 
 override_dh_install:
        find . -name lib*.la -delete
-       dh_install --list-missing
+       dh_install --fail-missing
 
 # ------------
 
@@ -150,7 +171,8 @@ override_dh_configure_modules_udeb_stamp:
                --with-config=kernel \
                --with-linux=$(KSRC) \
                --with-linux-obj=$(KOBJ) \
-               --with-spl=$(SPL)
+               --with-spl=$(SPL) \
+               --with-spl-obj=$(SPLOBJ)
        touch override_dh_configure_modules_udeb_stamp
 
 override_dh_configure_modules: override_dh_configure_modules_stamp
@@ -159,7 +181,8 @@ override_dh_configure_modules_stamp:
                --with-config=kernel \
                --with-linux=$(KSRC) \
                --with-linux-obj=$(KOBJ) \
-               --with-spl=$(SPL)
+               --with-spl=$(SPL) \
+               --with-spl-obj=$(SPLOBJ)
        touch override_dh_configure_modules_stamp
 
 override_dh_binary-modules-udeb: override_dh_prep-deb-files override_dh_configure_modules_udeb
@@ -192,3 +215,6 @@ override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_mod
        dh_gencontrol -p${pmodules}
        dh_md5sums -p${pmodules}
        dh_builddeb -p${pmodules}
+
+debian-copyright:
+       cme update dpkg-copyright -file debian/copyright.cme