]> git.proxmox.com Git - mirror_spl-debian.git/blob - debian/rules
Merge branch 'upstream'
[mirror_spl-debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META)
4 VERSION := $(shell dpkg-parsechangelog \
5 | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1)
6
7 override_dh_auto_configure:
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.
12 ./autogen.sh
13
14 @# Build the userland, but don't build the kernel modules.
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:
22 @# Install the utilities.
23 make install DESTDIR='$(CURDIR)/debian/tmp'
24
25 @# Create a dummy hostid file for the zfs-initramfs package.
26 @# NB: Commentary in the spl.postinst script.
27 mkdir -p '$(CURDIR)/debian/tmp/etc/'
28 /usr/bin/printf '\xFF\xFF\xFF\xFF' >'$(CURDIR)/debian/tmp/etc/hostid'
29
30 @# Get a bare copy of the source code.
31 @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
32 make distdir
33
34 @# Delete boilerplate to satisfy the lintian extra-license-file check.
35 rm '$(CURDIR)/$(NAME)-$(VERSION)/COPYING'
36
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.
39 echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
40 echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
41 chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
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)
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 $@