]> git.proxmox.com Git - mirror_zfs-debian.git/blob - debian/rules
Fix /etc/sudoers.d/zfs mode regression.
[mirror_zfs-debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 LSB_DISTRIBUTOR := $(shell lsb_release -is)
4 NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META)
5 VERSION := $(shell dpkg-parsechangelog \
6 | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1)
7
8 override_dh_auto_configure:
9 @# Embed the downstream version in the module.
10 @sed -e 's/^Version:.*/Version: $(VERSION)/' -i.orig META
11
12 @# Create the makefiles and configure script.
13 ./autogen.sh
14
15 @# Build the userland, but don't build the kernel modules.
16 ./configure \
17 --prefix='' \
18 --libexecdir=/usr/libexec \
19 --libdir=/lib \
20 --includedir=/usr/include \
21 --datarootdir=/usr/share \
22 --with-config=user
23
24 override_dh_auto_test:
25 # The dh_auto_test rule is disabled because
26 # `make check` cannot run in an unprivileged build environment.
27
28 override_dh_auto_install:
29 @# Install the utilities.
30 make install DESTDIR='$(CURDIR)/debian/tmp'
31
32 @# Get a bare copy of the source code for DKMS.
33 @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree, which does not
34 @# contain the userland sources. NB: Remove-userland-dist-rules.patch
35 make distdir
36
37 @# This shunt allows DKMS to install the Module.symvers and zfs_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 @# Process templates and install the dkms.conf file.
48 dh_dkms -V $(VERSION)
49
50 @# Install the /etc/default/zfs options file.
51 dh_installinit --name=zfs
52
53 @# Install the /etc/init.d/zfs-mount script.
54 ifeq ($(LSB_DISTRIBUTOR),Debian)
55 @# Debian runs local mounts at sysv sequences [10..12] [08..09].
56 dh_installinit --name=zfs-mount \
57 --no-restart-on-upgrade --no-start -- defaults 13 07
58 else
59 dh_installinit --name=zfs-mount \
60 --no-restart-on-upgrade --no-start
61 endif
62
63 @# Install the /etc/init.d/zfs-share script.
64 ifeq ($(LSB_DISTRIBUTOR),Debian)
65 @# Debian runs nfs-kernel-server at sysv sequence 17 01.
66 dh_installinit --name=zfs-share \
67 --no-restart-on-upgrade --no-start -- defaults 18 00
68 else ifeq ($(LSB_DISTRIBUTOR),Ubuntu)
69 @# Ubuntu runs nfs-kernel-server at sysv sequence 20 80.
70 dh_installinit --name=zfs-share \
71 --no-restart-on-upgrade --no-start -- defaults 21 79
72 else
73 dh_installinit --name=zfs-share \
74 --no-restart-on-upgrade --no-start
75 endif
76
77 override_dh_fixperms:
78 @# Ubuntu 10.04 LTS Lucid Lynx, et al, compatibility.
79 @# (>= debhelper-8.0.0) does this automatically.
80 dh_fixperms
81 chmod 0440 debian/zfsutils/etc/sudoers.d/zfs
82
83 override_dh_shlibdeps:
84 @# Suppress libtool dependency_libs warnings that are caused by
85 @# inter-library dependencies. (eg: zfs -> libzfs -> libuuid)
86 @# @TODO: Add pkgconfig support instead.
87 dh_shlibdeps -- --warnings=0
88
89 override_dh_strip:
90 dh_strip -plibnvpair1 --dbg-package=libnvpair1-dbg
91 dh_strip -plibuutil1 --dbg-package=libuutil1-dbg
92 dh_strip -plibzfs1 --dbg-package=libzfs1-dbg
93 dh_strip -plibzpool1 --dbg-package=libzpool1-dbg
94 dh_strip -pzfsutils --dbg-package=zfsutils-dbg
95
96 override_dh_auto_clean:
97 dh_auto_clean
98 @if test -e META.orig; then mv META.orig META; fi
99
100 %:
101 dh $@