File: rules

package info (click to toggle)
openconnect 7.08-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,604 kB
  • sloc: ansic: 24,474; sh: 5,107; xml: 1,825; makefile: 715; java: 405; python: 185
file content (59 lines) | stat: -rwxr-xr-x 2,185 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
53
54
55
56
57
58
59
#!/usr/bin/make -f

AUTORECONF_SOURCES = aclocal.m4 config.guess config.sub configure install-sh \
		     ltmain.sh m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 \
		     m4/ltversion.m4 m4/lt~obsolete.m4 missing Makefile.in \
		     po/Makefile.in tests/Makefile.in www/Makefile.in \
		     www/images/Makefile.in www/inc/Makefile.in \
		     www/styles/Makefile.in
VERSION_UPSTREAM := $(shell sed -ne 's|.*AC_INIT[^,]*, *\([0-9.]\+\).*|\1|p' configure.ac)
VERSION_DEBIAN := $(shell dpkg-parsechangelog | sed -ne 's|^Version: *\(.*\)$$|\1|p')

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Link with --as-needed to eliminate unused or indirect library dependencies
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --list-missing

override_dh_auto_configure:
	dh_auto_configure -- \
		--disable-static \
		--with-gnutls \
		--htmldir=/usr/share/doc/openconnect/html \
		--with-system-cafile=/etc/ssl/certs/ca-certificates.crt \
		--with-vpnc-script=/usr/share/vpnc-scripts/vpnc-script
	# Ensure version.c gets the right version string, either the upstream
	# version if unmodified or the Debian version if building from a git
	# snapshot or if the source has been patched.
	[ -f version.c ] && cp -p version.c version.c.debian-backup \
	                 || touch version.c.debian-clean
	make version.c
	if ! grep '"v$(VERSION_UPSTREAM)"' version.c > /dev/null; then \
		sed -i -e 's|".*"|"v$(VERSION_DEBIAN)"|' version.c; \
	fi

override_dh_installchangelogs:
	dh_installchangelogs www/changelog.html

override_dh_compress:
	dh_compress -Xhtml/changelog.html

override_dh_strip:
	dh_strip -plibopenconnect5 --dbg-package=libopenconnect5-dbg
	dh_strip -popenconnect --dbg-package=openconnect-dbg

override_dh_autoreconf:
	for f in $(AUTORECONF_SOURCES); do \
		[ ! -f $$f ] || [ -f $$f.debian-backup ] || mv $$f $$f.debian-backup; \
	done
	dh_autoreconf --as-needed

override_dh_autoreconf_clean:
	dh_autoreconf_clean
	for f in $(AUTORECONF_SOURCES); do \
		[ ! -f $$f.debian-backup ] || mv $$f.debian-backup $$f; \
	done
	[ ! -f version.c.debian-backup ] || mv version.c.debian-backup version.c
	[ ! -f version.c.debian-clean ] || rm -f version.c.debian-clean version.c