3 LSB_DISTRIBUTOR
:= $(shell lsb_release
-is
)
4 NAME
:= $(shell awk
'$$1 == "Name:" { print $$2; }' META
)
5 VERSION
:= $(shell dpkg-parsechangelog \
6 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f1
)
8 override_dh_auto_configure
:
9 @
# Embed the downstream version in the module.
10 @sed
-e
's/^Version:.*/Version: $(VERSION)/' -i.orig META
12 @
# Create the makefiles and configure script.
15 @
# Build the userland, but don't build the kernel modules.
18 --libexecdir
=/usr
/libexec \
20 --includedir=/usr
/include \
21 --datarootdir
=/usr
/share \
24 override_dh_auto_test
:
25 # The dh_auto_test rule is disabled because
26 # `make check` cannot run in an unprivileged build environment.
28 override_dh_auto_install
:
29 @
# Install the utilities.
30 make
install DESTDIR
='$(CURDIR)/debian/tmp'
32 @
# Get a bare copy of the source code for DKMS.
33 @
# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree, which does not
34 @
# contain the userland sources. NB: Remove-userland-dist-rules.patch
37 @
# This shunt allows DKMS to install the Module.symvers and zfs_config.h
38 @
# files to the ${dkms_tree} area through the POST_INSTALL directive.
39 echo
'#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
40 echo
'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
41 chmod
755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
43 @
# Install the DKMS source.
44 mkdir
-p
'$(CURDIR)/debian/tmp/usr/src/'
45 mv
'$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
47 @
# Process templates and install the dkms.conf file.
50 @
# Install the /etc/default/zfs options file.
51 dh_installinit
--name
=zfs
53 @
# Install the /etc/init.d/zfs-mount script.
54 ifeq ($(LSB_DISTRIBUTOR
),Debian
)
55 @
# Debian runs local mounts at sysv sequences [10..12] [08..09].
56 dh_installinit
--name
=zfs-mount \
57 --no-restart-on-upgrade
--no-start
-- defaults
13 07
59 dh_installinit
--name
=zfs-mount \
60 --no-restart-on-upgrade
--no-start
63 @
# Install the /etc/init.d/zfs-share script.
64 ifeq ($(LSB_DISTRIBUTOR
),Debian
)
65 @
# Debian runs nfs-kernel-server at sysv sequence 17 01.
66 dh_installinit
--name
=zfs-share \
67 --no-restart-on-upgrade
--no-start
-- defaults
18 00
68 else ifeq ($(LSB_DISTRIBUTOR
),Ubuntu
)
69 @
# Ubuntu runs nfs-kernel-server at sysv sequence 20 80.
70 dh_installinit
--name
=zfs-share \
71 --no-restart-on-upgrade
--no-start
-- defaults
21 79
73 dh_installinit
--name
=zfs-share \
74 --no-restart-on-upgrade
--no-start
78 @
# Ubuntu 10.04 LTS Lucid Lynx, et al, compatibility.
79 @
# (>= debhelper-8.0.0) does this automatically.
81 chmod
0440 debian
/zfsutils
/etc
/sudoers.d
/zfs
83 override_dh_shlibdeps
:
84 @
# Suppress libtool dependency_libs warnings that are caused by
85 @
# inter-library dependencies. (eg: zfs -> libzfs -> libuuid)
86 @
# @TODO: Add pkgconfig support instead.
87 dh_shlibdeps
-- --warnings
=0
90 dh_strip
-plibnvpair1
--dbg-package
=libnvpair1-dbg
91 dh_strip
-plibuutil1
--dbg-package
=libuutil1-dbg
92 dh_strip
-plibzfs1
--dbg-package
=libzfs1-dbg
93 dh_strip
-plibzpool1
--dbg-package
=libzpool1-dbg
94 dh_strip
-pzfsutils
--dbg-package
=zfsutils-dbg
96 override_dh_auto_clean
:
98 @if
test -e META.orig
; then mv META.orig META
; fi