]> git.proxmox.com Git - zfsonlinux.git/blame - zfs/debian/rules
add python3-pyzfs binary package
[zfsonlinux.git] / zfs / debian / rules
CommitLineData
28f635be
FG
1#!/usr/bin/make -f
2
3include /usr/share/dpkg/default.mk
4
5dccc949
SI
5VERSION := $(DEB_VERSION_UPSTREAM)
6REVISION := $(shell echo $(DEB_VERSION) | cut -d- -f2)
7
92886af5
SI
8SPHINX_BUILD = $(shell dpkg -L python3-sphinx | grep "sphinx-build$$")
9
28f635be
FG
10export DEB_BUILD_MAINT_OPTIONS = hardening=+all
11
12%:
92886af5 13 dh $@ --with autoreconf,python3,systemd,sphinxdoc --parallel
28f635be 14
5dccc949 15adapt_meta_file:
28f635be 16 @# Embed the downstream version in the module.
5dccc949
SI
17 @sed \
18 -e 's/^Version:.*/Version: $(VERSION)/' \
19 -e 's/^Release:.*/Release: $(REVISION)/' \
20 -i.orig META
21
28f635be 22
5dccc949 23override_dh_autoreconf: adapt_meta_file
28f635be
FG
24 dh_autoreconf
25
26override_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 \
32 --with-udevdir=/lib/udev \
d56eab87 33 --with-zfsexecdir=/usr/lib/zfs-linux \
28f635be 34 --enable-systemd \
92886af5 35 --enable-pyzfs \
28f635be
FG
36 --with-systemdunitdir=/lib/systemd/system \
37 --with-systemdpresetdir=/lib/systemd/system-preset \
4114f700 38 --with-systemdgeneratordir=/lib/systemd/system-generators \
28f635be
FG
39 --with-config=user
40
41override_dh_auto_test:
42 # The dh_auto_test rule is disabled because
43 # `make check` cannot run in an unprivileged build environment.
44
45override_dh_auto_install:
46 @# Install the utilities.
47 $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
48
49 # Use upstream's bash completion
50 install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \
51 '$(CURDIR)/contrib/bash_completion.d/zfs'
52
53 # Move from bin_dir to /usr/sbin
54 # Remove suffix (.py) as per policy 10.4 - Scripts
55 # https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
56 mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
4114f700
SI
57 mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
58 mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
59 mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
28f635be
FG
60
61 @# Zed has dependencies outside of the system root.
62 mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
63
64 mkdir -p $(CURDIR)/debian/tmp/usr/lib
65 for i in `ls $(CURDIR)/debian/tmp/lib/*.so`; do \
66 ln -s /lib/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/`basename $${i}`; \
67 rm $${i}; \
68 done
69
70 chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
71 chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
72 chmod a-x '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/zfs'
73
92886af5
SI
74override_dh_python3:
75 dh_python3 -p python3-pyzfs
76
28f635be
FG
77override_dh_makeshlibs:
78 dh_makeshlibs -a -V
79ifeq ($(BUILD_UDEB), true)
80 dh_makeshlibs -V -plibnvpair1linux
81 dh_makeshlibs -V -plibuutil1linux
82 dh_makeshlibs -V -plibzfs2linux
83 dh_makeshlibs -V -plibzpool2linux
84 dh_makeshlibs -V -pzfsutils-linux
85endif
86
87override_dh_strip:
88 dh_strip --dbg-package=zfs-dbg
89
90override_dh_auto_clean:
91 find . -name .gitignore -delete
92 rm -rf zfs-$(DEB_VERSION_UPSTREAM)
93 dh_auto_clean
94 @if test -e META.orig; then mv META.orig META; fi
95
96override_dh_install:
97 find . -name lib*.la -delete
98 dh_install --fail-missing
99
92886af5
SI
100override_dh_installdocs:
101 dh_installdocs
102ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
103 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/
104endif
105
28f635be
FG
106# ------------
107
108debian-copyright:
109 cme update dpkg-copyright -file debian/copyright.cme