]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - debian/rules
Fix typo in debconf templates
[mirror_zfs-debian.git] / debian / rules
index c5fb4f33d6020c9ff3893885a12bd4da30a3e4c1..800df22e0b7ee79ce5213d2cab54acd85a28c79f 100755 (executable)
@@ -8,8 +8,6 @@ VERSION := $(shell dpkg-parsechangelog \
 DKMSFILES := module include config zfs.release.in autogen.sh META AUTHORS \
                DISCLAIMER COPYRIGHT OPENSOLARIS.LICENSE README.markdown
 
-export SHLIB_MAJOR = 1
-
 ifndef BUILD_UDEB
 BUILD_UDEB=false
 endif
@@ -22,6 +20,14 @@ ifndef KVERS
 KVERS=$(shell uname -r)
 endif
 
+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)
@@ -29,7 +35,7 @@ pmodules = $(PACKAGE)-modules-$(non_epoch_version)
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
-       dh $@ --with dkms --parallel
+       dh $@ --with autoreconf,dkms,python3,systemd --parallel
 
 override_dh_auto_configure:
        @cp debian/control.in debian/control
@@ -40,15 +46,14 @@ endif
        @# Embed the downstream version in the module.
        @sed -e 's/^Version:.*/Version:      $(VERSION)/' -i.orig META
 
-       @# Create the makefiles and configure script.
-       ./autogen.sh
-
        @# 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:
@@ -59,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
@@ -86,8 +104,7 @@ override_dh_auto_install:
 
        @# This shunt allows DKMS to install the Module.symvers and zfs_config.h
        @# files to the ${dkms_tree} area through the POST_INSTALL directive.
-       echo '#!/bin/sh'  >'$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(VERSION)/cp'
-       echo 'cp "$$@"'  >>'$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(VERSION)/cp'
+       printf '#!/bin/sh\ncp "$$@"\n' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(VERSION)/cp'
        chmod 755 '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(VERSION)/cp'
 
        mkdir -p $(CURDIR)/debian/tmp/usr/lib
@@ -96,35 +113,8 @@ override_dh_auto_install:
                rm $${i}; \
        done
 
-override_dh_installinit:
-       @# Install the /etc/default/zfs options file.
-       dh_installinit --name=zfs
-
-       @# Install the /etc/init.d/zfs-mount script.
-ifeq ($(LSB_DISTRIBUTOR),Debian)
-       @# Debian runs local mounts at sysv sequences [10..12] [08..09].
-       dh_installinit --name=zfs-mount \
-         --no-restart-on-upgrade --no-start -- defaults 13 07
-else
-       dh_installinit --name=zfs-mount \
-         --no-restart-on-upgrade --no-start
-endif
-
-       @# Install the /etc/init.d/zfs-share script.
-ifeq ($(LSB_DISTRIBUTOR),Debian)
-       @# Debian runs nfs-kernel-server at sysv sequence 17 01,
-       @# iscsitarget at 02 01, and samba at 01 02.
-       dh_installinit --name=zfs-share \
-         --no-restart-on-upgrade --no-start -- defaults 18 00
-else ifeq ($(LSB_DISTRIBUTOR),Ubuntu)
-       @# Ubuntu runs nfs-kernel-server at sysv sequence 20 80,
-       @# iscsitarget at 20 20, and samba through upstart.
-       dh_installinit --name=zfs-share \
-         --no-restart-on-upgrade --no-start -- defaults 21 19
-else
-       dh_installinit --name=zfs-share \
-         --no-restart-on-upgrade --no-start
-endif
+       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)
@@ -132,25 +122,28 @@ override_dh_dkms:
 override_dh_makeshlibs:
        dh_makeshlibs -a
 ifeq ($(BUILD_UDEB), true)
-       dh_makeshlibs -plibnvpair$(SHLIB_MAJOR) --add-udeb=libnvpair$(SHLIB_MAJOR)-udeb
-       dh_makeshlibs -plibuutil$(SHLIB_MAJOR) --add-udeb=libuutil$(SHLIB_MAJOR)-udeb
-       dh_makeshlibs -plibzfs$(SHLIB_MAJOR) --add-udeb=libzfs$(SHLIB_MAJOR)-udeb
-       dh_makeshlibs -plibzpool$(SHLIB_MAJOR) --add-udeb=libzpool$(SHLIB_MAJOR)-udeb
-       dh_makeshlibs -pzfsutils --add-udeb=zfsutils-udeb
-   endif
+       dh_makeshlibs -plibnvpair1linux --add-udeb=libnvpair1-udeb
+       dh_makeshlibs -plibuutil1linux --add-udeb=libuutil1-udeb
+       dh_makeshlibs -plibzfs2linux --add-udeb=libzfs2-udeb
+       dh_makeshlibs -plibzpool2linux --add-udeb=libzpool2-udeb
+       dh_makeshlibs -pzfsutils-linux --add-udeb=zfsutils-udeb
+endif
 
 override_dh_strip:
        dh_strip --dbg-package=zfs-dbg
 ifeq ($(BUILD_UDEB), true)
-       dh_strip -plibnvpair$(SHLIB_MAJOR)-udeb
-       dh_strip -plibuutil$(SHLIB_MAJOR)-udeb
-       dh_strip -plibzfs$(SHLIB_MAJOR)-udeb
-       dh_strip -plibzpool$(SHLIB_MAJOR)-udeb
+       dh_strip -plibnvpair1-udeb
+       dh_strip -plibuutil1-udeb
+       dh_strip -plibzfs2-udeb
+       dh_strip -plibzpool2-udeb
        dh_strip -pzfsutils-udeb
 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
        cp debian/control.in debian/control
 ifeq ($(BUILD_UDEB), true)
@@ -159,7 +152,7 @@ endif
 
 override_dh_install:
        find . -name lib*.la -delete
-       dh_install
+       dh_install --fail-missing
 
 # ------------
 
@@ -177,7 +170,9 @@ override_dh_configure_modules_udeb_stamp:
                --without-selinux \
                --with-config=kernel \
                --with-linux=$(KSRC) \
-               --with-linux-obj=$(KOBJ)
+               --with-linux-obj=$(KOBJ) \
+               --with-spl=$(SPL) \
+               --with-spl-obj=$(SPLOBJ)
        touch override_dh_configure_modules_udeb_stamp
 
 override_dh_configure_modules: override_dh_configure_modules_stamp
@@ -185,7 +180,9 @@ override_dh_configure_modules_stamp:
        ./configure \
                --with-config=kernel \
                --with-linux=$(KSRC) \
-               --with-linux-obj=$(KOBJ)
+               --with-linux-obj=$(KOBJ) \
+               --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
@@ -217,5 +214,7 @@ override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_mod
        dh_installdeb -p${pmodules}
        dh_gencontrol -p${pmodules}
        dh_md5sums -p${pmodules}
-
        dh_builddeb -p${pmodules}
+
+debian-copyright:
+       cme update dpkg-copyright -file debian/copyright.cme