File: rules

package info (click to toggle)
s-nail 14.9.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,020 kB
  • sloc: ansic: 65,994; sh: 8,496; perl: 494; makefile: 85
file content (52 lines) | stat: -rwxr-xr-x 1,335 bytes parent folder | download
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
#!/usr/bin/make -f

# https://pkg-perl.alioth.debian.org/debhelper.html#Occasionally_Useful
PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

# https://wiki.debian.org/HardeningWalkthrough
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

#export DH_VERBOSE=1

# Needed to pass the dh-generated buildflags to the configure script
export EXTRA_CFLAGS=$(CFLAGS) $(CPPFLAGS)
export EXTRA_LDFLAGS=$(LDFLAGS)

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean

	# Manually remove leftover file.
	rm -fv s-nail-uninstall.sh

override_dh_auto_configure:
	$(MAKE) config \
		VERBOSE=1 \
		VAL_PREFIX=/usr \
		VAL_LIBEXECDIR=/usr/lib/s-nail \
		VAL_SYSCONFDIR=/etc \
		VAL_MTA=/usr/sbin/sendmail \
		VAL_MAIL=/var/mail

override_dh_fixperms:
	dh_fixperms

	# This could be avoided with VAL_PRIVSEP_GROUP=mail, but this
	# setting has been deprecated upstream.
	chgrp mail $(TMP)/usr/lib/s-nail/s-nail-privsep

override_dh_auto_test: export HOME=$(shell mktemp -d "$$PWD/TESTHOME.XXXXXXXX")
override_dh_auto_test:
# Avoid override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	rm -rf TESTHOME.*
endif

override_dh_installchangelogs:
	dh_installchangelogs NEWS