7 META_NAME
:= $(shell awk
'$$1 == "Name:" { print $$2; }' META
)
8 VERSION
:= $(shell dpkg-parsechangelog \
9 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f1
)
10 REVISION
:= $(shell dpkg-parsechangelog \
11 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f2-
)
13 META_DISTDIR
:= $(CURDIR
)/$(META_NAME
)-$(VERSION
)/
16 dh
$@
--with autoreconf
,dkms
18 override_dh_auto_configure
:
19 @
# Embed the downstream version in the module.
21 -e
's/^Version:.*/Version: $(VERSION)/' \
22 -e
's/^Release:.*/Release: $(REVISION)/' \
25 @
# Build the userland, but don't build the kernel modules.
26 dh_auto_configure
-- \
30 --with-udevdir
=/lib
/udev \
33 override_dh_auto_test
:
34 # The dh_auto_test rule is disabled because
35 # `make check` cannot run in an unprivileged build environment.
37 override_dh_auto_install
:
38 @
# Install the utilities.
39 $(MAKE
) install DESTDIR
='$(CURDIR)/debian/tmp'
41 @
# Get a bare copy of the source code for DKMS.
42 @
# This creates the $(META_DISTDIR)/ tree.
45 @
# Delete components that are not required to build the kernel modules.
46 @
# This prevents several lintian complaints, discourages users from
47 @
# running `make install` in /usr/src, and reduces the installation
48 @
# size by one third. The printf creates a dummy automake file.
50 cd
'$(META_DISTDIR)' && \
51 for ii in
$$(find cmd dracut etc lib man rpm scripts udev
-type f
); do \
53 test "$$ii" != "$${ii%.in}" && printf
'%%:\n\t#\n' >"$$ii"; \
57 @
# This shunt allows DKMS to copy the Module.symvers and zfs_config.h
58 @
# files into the ${dkms_tree} area through the POST_INSTALL directive.
59 printf
'#!/bin/sh\ncp "$$@"\n' >'$(META_DISTDIR)/cp'
60 $(CHMOD
) 755 '$(META_DISTDIR)/cp'
62 @
# Install the DKMS source directly, avoiding dh_install.
63 $(INSTALL
) -d
'$(CURDIR)/debian/zfs-dkms/usr/src/'
64 mv
'$(META_DISTDIR)' '$(CURDIR)/debian/zfs-dkms/usr/src/'
70 @
# Exclude the upstream /usr/lib/udev/rules.d files.
71 dh_install
-X
/rules.d
/
73 @
# Ensure that /etc/zfs is in the zfsutils package
74 @
# because git has difficulty tracking empty directories.
75 $(INSTALL
) -d
'$(CURDIR)/debian/zfsutils/etc/zfs/'
77 @
# Resolve lintian errors regarding Debian Policy Manual Section 8.4
78 @
# by moving unversioned library links from /lib to /usr/lib in the
79 @
# development package. Look at libc6-dev for a packaging example if
80 @
# multiarch support ever becomes a concern here.
81 $(INSTALL
) -d
'$(CURDIR)/debian/libzfs-dev/usr/lib/'
82 cd
'$(CURDIR)/debian/libzfs-dev/lib' && \
83 for ii in
$$(find
-type l
); do \
84 ln
-s
"../../lib/$$(readlink "$$ii")" "../usr/lib/$$(basename "$$ii")" \
88 override_dh_installdocs
:
89 dh_installdocs
--link-doc
=zfs-doc
91 override_dh_installinit
:
92 @
# Install debian/zfsutils.zfs.default as /etc/default/zfs.
93 dh_installinit
--name
=zfs
95 @
# Install the /etc/init.d/zfs-mount script.
96 @
# Debian runs local mounts at sysv sequences [10..12] [08..09].
97 dh_installinit
--name
=zfs-mount \
98 --no-restart-on-upgrade
--no-start
-- defaults
13 07
100 @
# Debian runs nfs-kernel-server at sysv sequence 17 01,
101 @
# iscsitarget at 02 01, and samba at 01 02.
102 dh_installinit
--name
=zfs-share \
103 --no-restart-on-upgrade
--no-start
-- defaults
18 00
106 override_dh_installudev
:
107 dh_installudev
--name
=zvol
--priority
=60
108 dh_installudev
--name
=vdev
--priority
=69
111 dh_strip
-plibnvpair1
--dbg-package
=libnvpair1-dbg
112 dh_strip
-plibuutil1
--dbg-package
=libuutil1-dbg
113 dh_strip
-plibzfs2
--dbg-package
=libzfs2-dbg
114 dh_strip
-plibzpool2
--dbg-package
=libzpool2-dbg
115 dh_strip
-pzfsutils
--dbg-package
=zfsutils-dbg