summaryrefslogtreecommitdiff
path: root/debian/rules
blob: f5b777cb288cdca5f957c198b70d4bce576301a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEB_HOST_ARCH        ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

export LDFLAGS += -Wl,--as-needed

ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),hurd-i386))
  RECVMMSG:=--enable-recvmmsg=no
else
  RECVMMSG:=--enable-recvmmsg=yes
endif

%:
	dh $@ --with systemd,autoreconf --parallel

override_dh_auto_configure:
	dh_auto_configure -- \
	  --sysconfdir=/etc \
	  --localstatedir=/var/lib \
	  --libexecdir=/usr/lib/knot \
	  --with-rundir=/run/knot \
	  --with-storage=/var/lib/knot \
	  $(RECVMMSG) \
	  --disable-silent-rules

override_dh_auto_make:
	dh_auto_make -- info pdf html

override_dh_auto_install:
	dh_auto_install -- install-info install-pdf install-html

override_dh_auto_test:
	-dh_auto_test

override_dh_strip:
	dh_strip --dbg-package=knot-dbg

override_dh_install:
	# Install sample conf as /etc/knot/knot.conf
	mv $(CURDIR)/debian/tmp/etc/knot/knot.sample.conf $(CURDIR)/debian/tmp/etc/knot/knot.conf
	# Remove useless example zone from /etc/knot
	rm $(CURDIR)/debian/tmp/etc/knot/example.com.zone
	# Install custom script which creates RUNDIR and chowns it according to conffile settings
	install -m 755 -d $(CURDIR)/debian/tmp/usr/lib/knot/
	install -m 755 $(CURDIR)/debian/prepare-environment $(CURDIR)/debian/tmp/usr/lib/knot/
	dh_install --fail-missing

	install -m 755 -d $(CURDIR)/debian/knot/etc/ufw/applications.d/
	install -m 644 $(CURDIR)/debian/knot.ufw $(CURDIR)/debian/knot/etc/ufw/applications.d/knot

override_dh_installchangelogs:
	dh_installchangelogs NEWS