]> git.proxmox.com Git - mirror_zfs-debian.git/blob - debian/rules
Split /etc/init.d/zfs into zfs-mount and zfs-share
[mirror_zfs-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 LSB_DISTRIBUTOR := $(shell lsb_release -is)
6
7 %:
8 dh $@
9
10 override_dh_auto_configure:
11 ./autogen.sh
12
13 @# Build the userland, but don't build the kernel modules.
14 ./configure \
15 --prefix='' \
16 --libexecdir=/usr/libexec \
17 --libdir=/lib \
18 --includedir=/usr/include \
19 --datarootdir=/usr/share \
20 --with-config=user
21
22 override_dh_auto_test:
23 # The dh_auto_test rule is disabled because
24 # `make check` cannot run in an unprivileged build environment.
25
26 override_dh_auto_install:
27 @# Install the utilities.
28 make install DESTDIR='$(CURDIR)/debian/tmp'
29
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
33 make distdir
34
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.
37 echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
38 echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
39 chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
40
41 @# Install the DKMS source.
42 mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
43 mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
44
45 @# Process templates and install the dkms.conf file.
46 dh_dkms -V $(VERSION)
47
48 @# Install the /etc/default/zfs options file.
49 dh_installinit --name=zfs
50
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
75 override_dh_shlibdeps:
76 @# Suppress libtool dependency_libs warnings that are caused by
77 @# inter-library dependencies. (eg: zfs -> libzfs -> libuuid)
78 @# @TODO: Add pkgconfig support instead.
79 dh_shlibdeps -- --warnings=0