]> git.proxmox.com Git - zfsonlinux.git/blob - zfs/debian/rules
debian/rules: adapt to ZFS 0.8
[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-systemdgeneratordir=/lib/systemd/system-generators \
36 --with-config=user
37
38 override_dh_auto_test:
39 # The dh_auto_test rule is disabled because
40 # `make check` cannot run in an unprivileged build environment.
41
42 override_dh_auto_install:
43 @# Install the utilities.
44 $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
45
46 # Use upstream's bash completion
47 install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \
48 '$(CURDIR)/contrib/bash_completion.d/zfs'
49
50 # Move from bin_dir to /usr/sbin
51 # Remove suffix (.py) as per policy 10.4 - Scripts
52 # https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
53 mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
54 mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
55 mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
56 mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
57
58 @# Zed has dependencies outside of the system root.
59 mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
60
61 mkdir -p $(CURDIR)/debian/tmp/usr/lib
62 for i in `ls $(CURDIR)/debian/tmp/lib/*.so`; do \
63 ln -s /lib/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/`basename $${i}`; \
64 rm $${i}; \
65 done
66
67 chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
68 chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
69 chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs'
70
71 override_dh_makeshlibs:
72 dh_makeshlibs -a -V
73 ifeq ($(BUILD_UDEB), true)
74 dh_makeshlibs -V -plibnvpair1linux
75 dh_makeshlibs -V -plibuutil1linux
76 dh_makeshlibs -V -plibzfs2linux
77 dh_makeshlibs -V -plibzpool2linux
78 dh_makeshlibs -V -pzfsutils-linux
79 endif
80
81 override_dh_strip:
82 dh_strip --dbg-package=zfs-dbg
83
84 override_dh_auto_clean:
85 find . -name .gitignore -delete
86 rm -rf zfs-$(DEB_VERSION_UPSTREAM)
87 dh_auto_clean
88 @if test -e META.orig; then mv META.orig META; fi
89
90 override_dh_install:
91 find . -name lib*.la -delete
92 dh_install --fail-missing
93
94 # ------------
95
96 debian-copyright:
97 cme update dpkg-copyright -file debian/copyright.cme