]>
Commit | Line | Data |
---|---|---|
7e4739a2 DH |
1 | #!/usr/bin/make -f |
2 | ||
3 | NAME := $(shell awk '/^Name:/{print $$2}' META) | |
4 | VERSION := $(shell awk '/^Version:/{print $$2}' META) | |
fb579137 | 5 | LSB_DISTRIBUTOR := $(shell lsb_release -is) |
7e4739a2 DH |
6 | |
7 | %: | |
b90307e7 | 8 | dh $@ |
7e4739a2 DH |
9 | |
10 | override_dh_auto_configure: | |
2a9c6adc DH |
11 | ./autogen.sh |
12 | ||
37316e2f | 13 | @# Build the userland, but don't build the kernel modules. |
ab520f13 | 14 | ./configure \ |
4f023100 | 15 | --prefix='' \ |
ab520f13 | 16 | --libexecdir=/usr/libexec \ |
44bb78ce | 17 | --libdir=/lib \ |
ab520f13 DH |
18 | --includedir=/usr/include \ |
19 | --datarootdir=/usr/share \ | |
37316e2f DH |
20 | --with-config=user |
21 | ||
7e4739a2 | 22 | override_dh_auto_test: |
37316e2f | 23 | # The dh_auto_test rule is disabled because |
7e4739a2 DH |
24 | # `make check` cannot run in an unprivileged build environment. |
25 | ||
26 | override_dh_auto_install: | |
37316e2f | 27 | @# Install the utilities. |
7e4739a2 DH |
28 | make install DESTDIR='$(CURDIR)/debian/tmp' |
29 | ||
37316e2f DH |
30 | @# Get a bare copy of the source code for DKMS. |
31 | @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree, which does not | |
32 | @# contain the userland sources. NB: Remove-userland-dist-rules.patch | |
7e4739a2 DH |
33 | make distdir |
34 | ||
37316e2f DH |
35 | @# This shunt allows DKMS to install the Module.symvers and zfs_config.h |
36 | @# files to the ${dkms_tree} area through the POST_INSTALL directive. | |
b2260a0c DH |
37 | echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp' |
38 | echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
39 | chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp' | |
7e4739a2 | 40 | |
37316e2f | 41 | @# Install the DKMS source. |
7e4739a2 DH |
42 | mkdir -p '$(CURDIR)/debian/tmp/usr/src/' |
43 | mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/' | |
44 | ||
37316e2f | 45 | @# Process templates and install the dkms.conf file. |
7e4739a2 DH |
46 | dh_dkms -V $(VERSION) |
47 | ||
fb579137 | 48 | @# Install the /etc/default/zfs options file. |
9e5db36f | 49 | dh_installinit --name=zfs |
9b360ccf | 50 | |
fb579137 DH |
51 | @# Install the /etc/init.d/zfs-mount script. |
52 | ifeq ($(LSB_DISTRIBUTOR),Debian) | |
53 | @# Debian runs local mounts at sysv sequences [10..12] [08..09]. | |
54 | dh_installinit --name=zfs-mount \ | |
55 | --no-restart-on-upgrade --no-start -- defaults 13 07 | |
56 | else | |
57 | dh_installinit --name=zfs-mount \ | |
58 | --no-restart-on-upgrade --no-start | |
59 | endif | |
60 | ||
61 | @# Install the /etc/init.d/zfs-share script. | |
62 | ifeq ($(LSB_DISTRIBUTOR),Debian) | |
63 | @# Debian runs nfs-kernel-server at sysv sequence 17 01. | |
64 | dh_installinit --name=zfs-share \ | |
65 | --no-restart-on-upgrade --no-start -- defaults 18 00 | |
66 | else ifeq ($(LSB_DISTRIBUTOR),Ubuntu) | |
67 | @# Ubuntu runs nfs-kernel-server at sysv sequence 20 80. | |
68 | dh_installinit --name=zfs-share \ | |
69 | --no-restart-on-upgrade --no-start -- defaults 21 79 | |
70 | else | |
71 | dh_installinit --name=zfs-share \ | |
72 | --no-restart-on-upgrade --no-start | |
73 | endif | |
74 | ||
44d35d79 DH |
75 | override_dh_fixperms: |
76 | # Ubuntu 12.04 LTS Lucid Lynx compatibility. | |
77 | # (>= debhelper-8.0.0) does this automatically. | |
78 | dh_fixperms | |
79 | chmod 0440 debian/zfsutils/etc/sudoers.d/zfs | |
80 | ||
9b360ccf | 81 | override_dh_shlibdeps: |
37316e2f DH |
82 | @# Suppress libtool dependency_libs warnings that are caused by |
83 | @# inter-library dependencies. (eg: zfs -> libzfs -> libuuid) | |
84 | @# @TODO: Add pkgconfig support instead. | |
9b360ccf | 85 | dh_shlibdeps -- --warnings=0 |