chiark / gitweb /
gpg agent threading bugs: Add some `xxx' comments.
[gnupg2.git] / debian / rules
1 #!/usr/bin/make -f
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.
6
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
12
13 include /usr/share/dpkg/architecture.mk
14
15 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
16
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"
21 else
22 GPGV_STATIC_HARDENING = ""
23 endif
24
25 %:
26         dh $@ --with=autoreconf --builddirectory=build
27
28 GPGV_UDEB_UNNEEDED = gpgtar bzip2 gpgsm scdaemon dirmngr doc tofu exec ldap gnutls sqlite libdns
29
30 WIN32_FLAGS=LDFLAGS="-Xlinker --no-insert-timestamp -static" CFLAGS="-g -Os" CPPFLAGS=
31
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
39
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
47
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
63
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