]>
Commit | Line | Data |
---|---|---|
0fbe1fc0 DH |
1 | #!/usr/bin/make -f |
2 | ||
a9655987 DH |
3 | NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META) |
4 | VERSION := $(shell dpkg-parsechangelog \ | |
5 | | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1) | |
0fbe1fc0 DH |
6 | |
7 | override_dh_auto_configure: | |
a9655987 DH |
8 | @# Embed the downstream version in the module. |
9 | @sed -e 's/^Version:.*/Version: $(VERSION)/' -i.orig META | |
10 | ||
11 | @# Create the makefiles and configure script. | |
287506cd DH |
12 | ./autogen.sh |
13 | ||
a9655987 | 14 | @# Build the userland, but don't build the kernel modules. |
0fbe1fc0 DH |
15 | ./configure --prefix=/usr --with-config=user |
16 | ||
17 | override_dh_auto_test: | |
18 | # scripts/check.sh tries insmod and rmmod, so it cannot | |
19 | # run in an unprivileged build environment. | |
20 | ||
21 | override_dh_auto_install: | |
a9655987 | 22 | @# Install the utilities. |
0fbe1fc0 DH |
23 | make install DESTDIR='$(CURDIR)/debian/tmp' |
24 | ||
a9655987 DH |
25 | @# Create a dummy hostid file for the zfs-initramfs package. |
26 | @# NB: Commentary in the spl.postinst script. | |
5702dc92 DH |
27 | mkdir -p '$(CURDIR)/debian/tmp/etc/' |
28 | /usr/bin/printf '\xFF\xFF\xFF\xFF' >'$(CURDIR)/debian/tmp/etc/hostid' | |
29 | ||
a9655987 DH |
30 | @# Get a bare copy of the source code. |
31 | @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree. | |
0fbe1fc0 DH |
32 | make distdir |
33 | ||
a9655987 | 34 | @# Delete boilerplate to satisfy the lintian extra-license-file check. |
c30c9032 DH |
35 | rm '$(CURDIR)/$(NAME)-$(VERSION)/COPYING' |
36 | ||
a9655987 DH |
37 | @# This shunt allows DKMS to install the Module.symvers and spl_config.h |
38 | @# files to the ${dkms_tree} area through the POST_INSTALL directive. | |
28aa9037 DH |
39 | echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp' |
40 | echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
41 | chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
0fbe1fc0 DH |
42 | |
43 | # Install the DKMS source. | |
44 | mkdir -p '$(CURDIR)/debian/tmp/usr/src/' | |
45 | mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/' | |
46 | ||
47 | # Install the dkms.conf file. | |
48 | dh_dkms -V $(VERSION) | |
a9655987 DH |
49 | |
50 | override_dh_auto_clean: | |
51 | dh_auto_clean | |
52 | @if test -e META.orig; then mv META.orig META; fi | |
53 | ||
54 | %: | |
55 | dh $@ |