]> git.proxmox.com Git - mirror_zfs-debian.git/blame - debian/rules
Refresh debian/patches after upstream merge.
[mirror_zfs-debian.git] / debian / rules
CommitLineData
7e4739a2
DH
1#!/usr/bin/make -f
2
3NAME := $(shell awk '/^Name:/{print $$2}' META)
4VERSION := $(shell awk '/^Version:/{print $$2}' META)
fb579137 5LSB_DISTRIBUTOR := $(shell lsb_release -is)
7e4739a2
DH
6
7%:
b90307e7 8 dh $@
7e4739a2
DH
9
10override_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 22override_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
26override_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.
52ifeq ($(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
56else
57 dh_installinit --name=zfs-mount \
58 --no-restart-on-upgrade --no-start
59endif
60
61 @# Install the /etc/init.d/zfs-share script.
62ifeq ($(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
66else 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
70else
71 dh_installinit --name=zfs-share \
72 --no-restart-on-upgrade --no-start
73endif
74
44d35d79
DH
75override_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 81override_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