File: rules

package info (click to toggle)
gnupg2 2.1.18-8~deb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,748 kB
  • sloc: ansic: 222,789; sh: 7,531; lisp: 5,090; makefile: 1,459; awk: 126; sed: 16; python: 16; php: 14; perl: 13
file content (73 lines) | stat: -rwxr-xr-x 2,900 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/make -f
# debian/rules file - for GnuPG
# Copyright 1994,1995 by Ian Jackson.
# Copyright 1998-2003 by James Troup.
# Copyright 2003-2004 by Matthias Urlichs.
# 
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# avoid -pie for gpgv-static on hppa, kfreebsd-amd64, and x32
# platforms, which cannot support it by default:
ifeq (,$(filter $(DEB_HOST_ARCH), hppa kfreebsd-amd64 x32))
GPGV_STATIC_HARDENING = "-pie"
else
GPGV_STATIC_HARDENING = ""
endif

%:
	dh $@ --with=autoreconf --builddirectory=build

GPGV_UDEB_UNNEEDED = gpgtar bzip2 gpgsm scdaemon dirmngr doc tofu exec ldap gnutls sqlite libdns

WIN32_FLAGS=LDFLAGS="-Xlinker --no-insert-timestamp -static" CFLAGS="-g -Os" CPPFLAGS=

override_dh_auto_configure:
	dh_auto_configure --builddirectory=build-gpgv-udeb -- \
		--enable-gpg2-is-gpg \
	   	$(foreach x, $(GPGV_UDEB_UNNEEDED), --disable-$(x))
	dh_auto_configure --builddirectory=build -- --libexecdir=\$${prefix}/lib/gnupg \
		--enable-gpg2-is-gpg \
		--enable-symcryptrun --enable-large-secmem

override_dh_auto_build-arch:
	dh_auto_build --builddirectory=build-gpgv-udeb
	dh_auto_build --builddirectory=build
	cp -a build-gpgv-udeb build-gpgv-static
	rm -f build-gpgv-static/g10/gpgv
	cd build-gpgv-static/g10 && $(MAKE) LDFLAGS="$$LDFLAGS $(GPGV_STATIC_HARDENING) -static" gpgv
	mv build-gpgv-static/g10/gpgv build-gpgv-static/g10/gpgv-static

override_dh_auto_build-indep:
	mkdir -p build-gpgv-win32
	cd build-gpgv-win32 && $(WIN32_FLAGS) ../configure \
	   	$(foreach x, $(GPGV_UDEB_UNNEEDED), --disable-$(x)) \
		$(foreach x, libgpg-error libgcrypt libassuan ksba npth, --with-$x-prefix=/usr/i686-w64-mingw32) \
		--enable-gpg2-is-gpg \
		--with-zlib=/usr/i686-w64-mingw \
		--prefix=/usr/i686-w64-mingw32 \
		--host i686-w64-mingw32
	cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libcommon.a
	cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libgpgrl.a
	cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libsimple-pwquery.a
	cd build-gpgv-win32/kbx && $(WIN32_FLAGS) $(MAKE) libkeybox.a
	cd build-gpgv-win32/g10 && $(WIN32_FLAGS) $(MAKE) gpgv.exe
	strip build-gpgv-win32/g10/gpgv.exe

override_dh_shlibdeps:
# Make ldap a recommends rather than a hard dependency.
	dpkg-shlibdeps -Tdebian/dirmngr.substvars -dRecommends debian/dirmngr/usr/lib/gnupg/dirmngr_ldap -dDepends debian/dirmngr/usr/bin/dirmngr*
	dh_shlibdeps -Ndirmngr

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test --builddirectory=build
	GPG=build/g10/gpg GPG_AGENT=build/agent/gpg-agent debian/tests/no-tty
endif