]> git.proxmox.com Git - zfsonlinux.git/blob - debian/rules
d/rules: drop --parallel flag, useless for dh-compat >= 10
[zfsonlinux.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4
5 VERSION := $(DEB_VERSION_UPSTREAM)
6 REVISION := $(shell echo $(DEB_VERSION) | cut -d- -f2)
7
8 SPHINX_BUILD = $(shell dpkg -L python3-sphinx | grep -m 1 "/sphinx-build$$")
9
10 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
11
12 %:
13 dh $@ --with autoreconf,python3,sphinxdoc
14
15 adapt_meta_file:
16 @# Embed the downstream version in the module.
17 @sed \
18 -e 's/^Version:.*/Version: $(VERSION)/' \
19 -e 's/^Release:.*/Release: $(REVISION)/' \
20 -i.orig META
21
22
23 override_dh_autoreconf: adapt_meta_file
24 dh_autoreconf
25
26 override_dh_auto_configure:
27 @# Build the userland, but don't build the kernel modules.
28 dh_auto_configure -- \
29 --bindir=/usr/bin \
30 --sbindir=/sbin \
31 --libdir=/lib/"$(DEB_HOST_MULTIARCH)" \
32 --with-udevdir=/lib/udev \
33 --with-zfsexecdir=/usr/lib/zfs-linux \
34 --enable-systemd \
35 --enable-pyzfs \
36 --with-python=python3 \
37 --with-pammoduledir='/lib/$(DEB_HOST_MULTIARCH)/security' \
38 --with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \
39 --with-systemdunitdir=/lib/systemd/system \
40 --with-systemdpresetdir=/lib/systemd/system-preset \
41 --with-systemdgeneratordir=/lib/systemd/system-generators \
42 --with-config=user
43
44 for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \
45 basename "$$i" | grep _KVERS_ && continue ; \
46 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' "$$i" > "$${i%%.in}" ; \
47 done
48
49 override_dh_auto_test:
50 override_dh_auto_test:
51 ifeq (amd64,$(DEB_HOST_ARCH))
52 # Upstream provides an ABI guarantee that we validate here
53 -$(MAKE) checkabi
54 endif
55
56 # The dh_auto_test rule is disabled because
57 # `make check` cannot run in an unprivileged build environment.
58
59 override_dh_auto_install:
60 @# Install the utilities.
61 $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
62
63 # Use upstream's bash completion
64 install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \
65 '$(CURDIR)/contrib/bash_completion.d/zfs'
66
67 # Move from bin_dir to /usr/sbin
68 # Remove suffix (.py) as per policy 10.4 - Scripts
69 # https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
70 mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
71 mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
72 mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
73 mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
74
75 @# Zed has dependencies outside of the system root.
76 mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
77
78 mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
79 for i in `ls $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/*.so`; do \
80 ln -s /lib/$(DEB_HOST_MULTIARCH)/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/`basename $${i}`; \
81 rm $${i}; \
82 done
83
84 chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
85 chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
86 chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs'
87
88 override_dh_python3:
89 dh_python3 -p python3-pyzfs
90
91 override_dh_makeshlibs:
92 dh_makeshlibs -a -V
93
94 override_dh_auto_clean:
95 find . -name .gitignore -delete
96 rm -rf zfs-$(DEB_VERSION_UPSTREAM)
97 dh_auto_clean
98 @if test -e META.orig; then mv META.orig META; fi
99
100 override_dh_install:
101 find debian/tmp/lib -name *.la -delete
102 dh_install
103
104 override_dh_missing:
105 dh_missing --fail-missing
106
107 override_dh_installsystemd:
108 # these to lines prevent the restarting of all systemd services, except
109 # zfs-zed - they should not be restarted (importing, mounting, creating
110 # links in /dev, and can cause erros in the log
111 # (upon major.minor change)
112 dh_installsystemd --no-stop-on-upgrade -X zfs-zed.service
113 dh_installsystemd --name zfs-zed
114
115 override_dh_installdocs:
116 dh_installdocs
117 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
118 http_proxy='127.0.0.1:9' $(SPHINX_BUILD) -N -bhtml "$(CURDIR)/contrib/pyzfs/docs/source/" debian/pyzfs-doc/usr/share/doc/pyzfs-doc/html/
119 endif
120
121 # ------------
122
123 debian-copyright:
124 cme update dpkg-copyright -file debian/copyright.cme