]> git.proxmox.com Git - mirror_zfs-debian.git/blame - debian/rules
Merge branch 'upstream'
[mirror_zfs-debian.git] / debian / rules
CommitLineData
7e4739a2
DH
1#!/usr/bin/make -f
2
fb579137 3LSB_DISTRIBUTOR := $(shell lsb_release -is)
5cc6dd58
DH
4NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META)
5VERSION := $(shell dpkg-parsechangelog \
6 | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1)
7e4739a2
DH
7
8override_dh_auto_configure:
5cc6dd58
DH
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.
2a9c6adc
DH
13 ./autogen.sh
14
37316e2f 15 @# Build the userland, but don't build the kernel modules.
ab520f13 16 ./configure \
4f023100 17 --prefix='' \
ab520f13 18 --libexecdir=/usr/libexec \
44bb78ce 19 --libdir=/lib \
ab520f13
DH
20 --includedir=/usr/include \
21 --datarootdir=/usr/share \
37316e2f
DH
22 --with-config=user
23
7e4739a2 24override_dh_auto_test:
37316e2f 25 # The dh_auto_test rule is disabled because
7e4739a2
DH
26 # `make check` cannot run in an unprivileged build environment.
27
28override_dh_auto_install:
37316e2f 29 @# Install the utilities.
7e4739a2
DH
30 make install DESTDIR='$(CURDIR)/debian/tmp'
31
37316e2f
DH
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
7e4739a2
DH
35 make distdir
36
37316e2f
DH
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.
b2260a0c
DH
39 echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
40 echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
41 chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
7e4739a2 42
37316e2f 43 @# Install the DKMS source.
7e4739a2
DH
44 mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
45 mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
46
37316e2f 47 @# Process templates and install the dkms.conf file.
7e4739a2
DH
48 dh_dkms -V $(VERSION)
49
fb579137 50 @# Install the /etc/default/zfs options file.
9e5db36f 51 dh_installinit --name=zfs
9b360ccf 52
fb579137
DH
53 @# Install the /etc/init.d/zfs-mount script.
54ifeq ($(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
58else
59 dh_installinit --name=zfs-mount \
60 --no-restart-on-upgrade --no-start
61endif
62
63 @# Install the /etc/init.d/zfs-share script.
64ifeq ($(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
68else 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
72else
73 dh_installinit --name=zfs-share \
74 --no-restart-on-upgrade --no-start
75endif
76
648b2e07
DH
77override_dh_fixperms:
78 @# Ubuntu 10.04 LTS Lucid Lynx, et al, compatibility.
79 @# (>= debhelper-8.0.0) does this automatically.
80 chmod 0440 debian/zfsutils/etc/sudoers.d/zfs
81 dh_fixperms
82
9b360ccf 83override_dh_shlibdeps:
37316e2f
DH
84 @# Suppress libtool dependency_libs warnings that are caused by
85 @# inter-library dependencies. (eg: zfs -> libzfs -> libuuid)
86 @# @TODO: Add pkgconfig support instead.
9b360ccf 87 dh_shlibdeps -- --warnings=0
47ba6fdb
PF
88
89override_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
5cc6dd58
DH
95
96override_dh_auto_clean:
97 dh_auto_clean
98 @if test -e META.orig; then mv META.orig META; fi
99
100%:
101 dh $@