]> git.proxmox.com Git - zfsonlinux.git/blob - spl-debian-pve/rules
add debian packaging files for spl
[zfsonlinux.git] / spl-debian-pve / 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 REVISION := $(shell dpkg-parsechangelog \
7 | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f2-)
8
9 %:
10 dh $@ --with autoreconf
11
12 override_dh_auto_configure:
13 @# Embed the downstream version in the module.
14 @sed \
15 -e 's/^Version:.*/Version: $(VERSION)/' \
16 -e 's/^Release:.*/Release: $(REVISION)/' \
17 -i.orig META
18
19 @# Create the makefiles and configure script.
20 ./autogen.sh
21
22 @# Build the userland, but don't build the kernel modules.
23 dh_auto_configure -- --with-config=user
24
25 override_dh_auto_test:
26 # scripts/check.sh tries insmod and rmmod, so it cannot
27 # run in an unprivileged build environment.
28
29 override_dh_auto_install:
30 @# Install the utilities.
31 make install DESTDIR='$(CURDIR)/debian/tmp'
32
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'
37
38 @# Get a bare copy of the source code.
39 @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
40 make distdir
41
42 @# Delete boilerplate to satisfy the lintian extra-license-file check.
43 rm '$(CURDIR)/$(NAME)-$(VERSION)/COPYING'
44
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'
50
51 # Install the DKMS source.
52 mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
53 mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
54
55 # Install the dkms.conf file.
56 dh_dkms -V $(VERSION)
57
58 override_dh_auto_clean:
59 dh_auto_clean
60 @if test -e META.orig; then mv META.orig META; fi
61
62 %:
63 dh $@