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