]>
Commit | Line | Data |
---|---|---|
0fbe1fc0 DH |
1 | #!/usr/bin/make -f |
2 | ||
3 | NAME := $(shell awk '/^Name:/{print $$2}' META) | |
4 | VERSION := $(shell awk '/^Version:/{print $$2}' META) | |
5 | ||
6 | %: | |
7 | dh $@ | |
8 | ||
9 | override_dh_auto_configure: | |
10 | # Build the userland, but don't build the kernel modules. | |
11 | ./configure --prefix=/usr --with-config=user | |
12 | ||
13 | override_dh_auto_test: | |
14 | # scripts/check.sh tries insmod and rmmod, so it cannot | |
15 | # run in an unprivileged build environment. | |
16 | ||
17 | override_dh_auto_install: | |
18 | # Install the utilities. | |
19 | make install DESTDIR='$(CURDIR)/debian/tmp' | |
20 | ||
5702dc92 DH |
21 | # Create a dummy hostid file for the zfs-initramfs package. |
22 | # NB: Commentary in the spl.postinst script. | |
23 | mkdir -p '$(CURDIR)/debian/tmp/etc/' | |
24 | /usr/bin/printf '\xFF\xFF\xFF\xFF' >'$(CURDIR)/debian/tmp/etc/hostid' | |
25 | ||
26 | # Get a bare copy of the source code. | |
27 | # This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree. | |
0fbe1fc0 DH |
28 | make distdir |
29 | ||
28aa9037 DH |
30 | # This shunt allows DKMS to install the Module.symvers and spl_config.h |
31 | # files to the ${dkms_tree} area through the POST_INSTALL directive. | |
32 | echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
33 | echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
34 | chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
0fbe1fc0 DH |
35 | |
36 | # Install the DKMS source. | |
37 | mkdir -p '$(CURDIR)/debian/tmp/usr/src/' | |
38 | mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/' | |
39 | ||
40 | # Install the dkms.conf file. | |
41 | dh_dkms -V $(VERSION) |