]> git.proxmox.com Git - zfsonlinux.git/blob - zfs/debian/rules
8f002c996d7888c943266da768c4a2ee3fc2bf79
[zfsonlinux.git] / zfs / 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 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9
10 %:
11 dh $@ --with autoreconf,python3,systemd --parallel
12
13 adapt_meta_file:
14 @# Embed the downstream version in the module.
15 @sed \
16 -e 's/^Version:.*/Version: $(VERSION)/' \
17 -e 's/^Release:.*/Release: $(REVISION)/' \
18 -i.orig META
19
20
21 override_dh_autoreconf: adapt_meta_file
22 dh_autoreconf
23
24 override_dh_auto_configure:
25 @# Build the userland, but don't build the kernel modules.
26 dh_auto_configure -- \
27 --bindir=/usr/bin \
28 --sbindir=/sbin \
29 --libdir=/lib \
30 --with-udevdir=/lib/udev \
31 --with-zfsexecdir=/usr/lib/zfs-linux \
32 --enable-systemd \
33 --with-systemdunitdir=/lib/systemd/system \
34 --with-systemdpresetdir=/lib/systemd/system-preset \
35 --with-config=user
36
37 override_dh_auto_test:
38 # The dh_auto_test rule is disabled because
39 # `make check` cannot run in an unprivileged build environment.
40
41 override_dh_auto_install:
42 @# Install the utilities.
43 $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
44
45 # Use upstream's bash completion
46 install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \
47 '$(CURDIR)/contrib/bash_completion.d/zfs'
48
49 # Move from bin_dir to /usr/sbin
50 # Remove suffix (.py) as per policy 10.4 - Scripts
51 # https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
52 mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
53 mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary.py' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
54 mv '$(CURDIR)/debian/tmp/usr/bin/arcstat.py' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
55 mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat.py' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
56
57 @# Zed has dependencies outside of the system root.
58 mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
59
60 mkdir -p $(CURDIR)/debian/tmp/usr/lib
61 for i in `ls $(CURDIR)/debian/tmp/lib/*.so`; do \
62 ln -s /lib/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/`basename $${i}`; \
63 rm $${i}; \
64 done
65
66 chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
67 chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
68 chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs'
69
70 override_dh_makeshlibs:
71 dh_makeshlibs -a -V
72 ifeq ($(BUILD_UDEB), true)
73 dh_makeshlibs -V -plibnvpair1linux
74 dh_makeshlibs -V -plibuutil1linux
75 dh_makeshlibs -V -plibzfs2linux
76 dh_makeshlibs -V -plibzpool2linux
77 dh_makeshlibs -V -pzfsutils-linux
78 endif
79
80 override_dh_strip:
81 dh_strip --dbg-package=zfs-dbg
82
83 override_dh_auto_clean:
84 find . -name .gitignore -delete
85 rm -rf zfs-$(DEB_VERSION_UPSTREAM)
86 dh_auto_clean
87 @if test -e META.orig; then mv META.orig META; fi
88
89 override_dh_install:
90 find . -name lib*.la -delete
91 dh_install --fail-missing
92
93 # ------------
94
95 debian-copyright:
96 cme update dpkg-copyright -file debian/copyright.cme