3 NAME
:= $(shell awk
'$$1 == "Name:" { print $$2; }' META
)
4 VERSION
:= $(shell dpkg-parsechangelog \
5 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f1
)
6 REVISION
:= $(shell dpkg-parsechangelog \
7 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f2-
)
10 dh
$@
--with autoreconf
12 override_dh_auto_configure
:
13 @
# Embed the downstream version in the module.
15 -e
's/^Version:.*/Version: $(VERSION)/' \
16 -e
's/^Release:.*/Release: $(REVISION)/' \
19 @
# Create the makefiles and configure script.
22 @
# Build the userland, but don't build the kernel modules.
23 dh_auto_configure
-- --with-config
=user
25 override_dh_auto_test
:
26 # scripts/check.sh tries insmod and rmmod, so it cannot
27 # run in an unprivileged build environment.
29 override_dh_auto_install
:
30 @
# Install the utilities.
31 make
install DESTDIR
='$(CURDIR)/debian/tmp'
33 @
# Create a dummy hostid file for the zfs-initramfs package.
34 @
# NB: Commentary in the spl.postinst script.
35 mkdir
-p
'$(CURDIR)/debian/tmp/etc/'
36 /usr
/bin
/printf
'\xFF\xFF\xFF\xFF' >'$(CURDIR)/debian/tmp/etc/hostid'
38 @
# Get a bare copy of the source code.
39 @
# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
42 @
# Delete boilerplate to satisfy the lintian extra-license-file check.
43 rm '$(CURDIR)/$(NAME)-$(VERSION)/COPYING'
45 @
# This shunt allows DKMS to install the Module.symvers and spl_config.h
46 @
# files to the ${dkms_tree} area through the POST_INSTALL directive.
47 echo
'#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
48 echo
'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
49 chmod
755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
51 # Install the DKMS source.
52 mkdir
-p
'$(CURDIR)/debian/tmp/usr/src/'
53 mv
'$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
55 # Install the dkms.conf file.
58 override_dh_auto_clean
:
60 @if
test -e META.orig
; then mv META.orig META
; fi