2 # debian/rules file - for GnuPG
3 # Copyright 1994,1995 by Ian Jackson.
4 # Copyright 1998-2003 by James Troup.
5 # Copyright 2003-2004 by Matthias Urlichs.
7 # I hereby give you perpetual unlimited permission to copy,
8 # modify and relicense this file, provided that you do not remove
9 # my name from the file itself. (I assert my moral right of
10 # paternity under the Copyright, Designs and Patents Act 1988.)
11 # This file may have to be extensively modified
13 include /usr/share/dpkg/architecture.mk
15 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
17 # avoid -pie for gpgv-static on hppa, kfreebsd-amd64, and x32
18 # platforms, which cannot support it by default:
19 ifeq (,$(filter $(DEB_HOST_ARCH), hppa kfreebsd-amd64 x32))
20 GPGV_STATIC_HARDENING = "-pie"
22 GPGV_STATIC_HARDENING = ""
26 dh $@ --with=autoreconf --builddirectory=build
28 GPGV_UDEB_UNNEEDED = gpgtar bzip2 gpgsm scdaemon dirmngr doc tofu exec ldap gnutls sqlite libdns
30 WIN32_FLAGS=LDFLAGS="-Xlinker --no-insert-timestamp -static" CFLAGS="-g -Os" CPPFLAGS=
32 override_dh_auto_configure:
33 dh_auto_configure --builddirectory=build-gpgv-udeb -- \
34 --enable-gpg2-is-gpg \
35 $(foreach x, $(GPGV_UDEB_UNNEEDED), --disable-$(x))
36 dh_auto_configure --builddirectory=build -- --libexecdir=\$${prefix}/lib/gnupg \
37 --enable-gpg2-is-gpg \
38 --enable-symcryptrun --enable-large-secmem
40 override_dh_auto_build-arch:
41 dh_auto_build --builddirectory=build-gpgv-udeb
42 dh_auto_build --builddirectory=build
43 cp -a build-gpgv-udeb build-gpgv-static
44 rm -f build-gpgv-static/g10/gpgv
45 cd build-gpgv-static/g10 && $(MAKE) LDFLAGS="$$LDFLAGS $(GPGV_STATIC_HARDENING) -static" gpgv
46 mv build-gpgv-static/g10/gpgv build-gpgv-static/g10/gpgv-static
48 override_dh_auto_build-indep:
49 mkdir -p build-gpgv-win32
50 cd build-gpgv-win32 && $(WIN32_FLAGS) ../configure \
51 $(foreach x, $(GPGV_UDEB_UNNEEDED), --disable-$(x)) \
52 $(foreach x, libgpg-error libgcrypt libassuan ksba npth, --with-$x-prefix=/usr/i686-w64-mingw32) \
53 --enable-gpg2-is-gpg \
54 --with-zlib=/usr/i686-w64-mingw \
55 --prefix=/usr/i686-w64-mingw32 \
56 --host i686-w64-mingw32
57 cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libcommon.a
58 cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libgpgrl.a
59 cd build-gpgv-win32/common && $(WIN32_FLAGS) $(MAKE) libsimple-pwquery.a
60 cd build-gpgv-win32/kbx && $(WIN32_FLAGS) $(MAKE) libkeybox.a
61 cd build-gpgv-win32/g10 && $(WIN32_FLAGS) $(MAKE) gpgv.exe
62 strip build-gpgv-win32/g10/gpgv.exe
64 override_dh_shlibdeps:
65 # Make ldap a recommends rather than a hard dependency.
66 dpkg-shlibdeps -Tdebian/dirmngr.substvars -dRecommends debian/dirmngr/usr/lib/gnupg/dirmngr_ldap -dDepends debian/dirmngr/usr/bin/dirmngr*
67 dh_shlibdeps -Ndirmngr