]> 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 '/^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
21 # Get a bare copy of the source code. This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
22 make distdir
23
24 # This shunt allows DKMS to delete header files that are peculiar to each
25 # module instance through the POST_REMOVE directive in the dkms.conf file.
26 echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/rm'
27 echo 'rm "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/rm'
28 chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/rm'
29
30 # Install the DKMS source.
31 mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
32 mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
33
34 # Install the dkms.conf file.
35 dh_dkms -V $(VERSION)
36
37 # @FIXME: `make distclean` fails when --with-config=user is set.
38 # Kludge by creating dummy makefiles.
39 echo 'distclean:' >$(CURDIR)/include/Makefile
40 echo ' -rm -f Makefile' >>$(CURDIR)/include/Makefile
41 echo 'distclean:' >$(CURDIR)/module/Makefile
42 echo ' -rm -f Makefile' >>$(CURDIR)/module/Makefile