Imported Upstream version 2.2.20
[platform/upstream/gpg2.git] / Makefile.am
1 # Makefile.am - main makefile for GnuPG
2 #       Copyright (C) 2001, 2004, 2010 Free Software Foundation, Inc.
3 #
4 # This file is part of GnuPG.
5 #
6 # GnuPG is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # GnuPG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 # Location of the released tarball archives.  Note that this is an
22 # internal archive and before uploading this to the public server,
23 # manual tests should be run and the git release tat set and pushed.
24 # Adjust as needed.
25 RELEASE_ARCHIVE_DIR  = wk@vigenere:tarballs/gnupg/v2.2
26
27 # The key used to sign the released sources.  Adjust as needed.
28 RELEASE_SIGNING_KEY  = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6
29
30
31 # Autoconf flags.
32 ACLOCAL_AMFLAGS = -I m4
33 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gnupg-builddir-envvar \
34   --enable-all-tests --enable-symcryptrun --enable-g13 \
35   --enable-gpgtar --enable-wks-tools --disable-ntbtls
36
37 GITLOG_TO_CHANGELOG=gitlog-to-changelog
38
39 EXTRA_DIST = build-aux/config.rpath build-aux/potomo autogen.sh autogen.rc \
40              ChangeLog-2011 po/ChangeLog-2011 build-aux/ChangeLog-2011     \
41              VERSION README.GIT build-aux/gitlog-to-changelog              \
42              COPYING.GPL2 COPYING.LGPL21 COPYING.LGPL3      \
43              COPYING.CC0 COPYING.other                      \
44              build-aux/git-log-fix build-aux/git-log-footer \
45              build-aux/getswdb.sh                           \
46              build-aux/speedo.mk                            \
47              build-aux/speedo/zlib.pc                       \
48              build-aux/speedo/w32/inst-options.ini          \
49              build-aux/speedo/w32/inst.nsi                  \
50              build-aux/speedo/w32/pkg-copyright.txt         \
51              build-aux/speedo/w32/g4wihelp.c                \
52              build-aux/speedo/w32/pango.modules             \
53              build-aux/speedo/w32/gdk-pixbuf-loaders.cache  \
54              build-aux/speedo/w32/exdll.h                   \
55              build-aux/speedo/w32/README.txt                \
56              build-aux/speedo/w32/gnupg-logo-150x57.bmp     \
57              build-aux/speedo/w32/gnupg-logo-164x314.bmp    \
58              build-aux/speedo/w32/wixlib.wxs                \
59              build-aux/speedo/patches/atk-1.32.0.patch      \
60              build-aux/speedo/patches/libiconv-1.14.patch   \
61              build-aux/speedo/patches/pango-1.29.4.patch    \
62              build-aux/speedo/patches/gpgme-1.12.0.patch    \
63              build-aux/speedo/patches/sqlite.patch
64
65
66 DISTCLEANFILES = g10defs.h
67
68 if BUILD_GPG
69 gpg = g10
70 else
71 gpg =
72 endif
73 if BUILD_GPGSM
74 sm = sm
75 else
76 sm =
77 endif
78 if BUILD_AGENT
79 agent = agent
80 else
81 agent =
82 endif
83 if BUILD_SCDAEMON
84 scd = scd
85 else
86 scd =
87 endif
88 if BUILD_G13
89 g13 = g13
90 else
91 g13 =
92 endif
93 if BUILD_DIRMNGR
94 dirmngr = dirmngr
95 else
96 dirmngr =
97 endif
98 if BUILD_DOC
99 doc = doc
100 else
101 doc =
102 endif
103
104 SUBDIRS = m4 common kbx \
105           ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
106           tools po ${doc} tests
107
108 dist_doc_DATA = README
109
110
111 dist-hook: gen-ChangeLog
112
113 distcheck-hook:
114         set -e; ( \
115         pref="#+macro: gnupg22_" ;\
116         reldate="$$(date -u +%Y-%m-%d)" ;\
117         echo "$${pref}ver  $(PACKAGE_VERSION)"  ;\
118         echo "$${pref}date $${reldate}" ;\
119         list='$(DIST_ARCHIVES)'; for i in $$list; do \
120           case "$$i" in *.tar.bz2) \
121             echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
122             echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
123             echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
124           esac;\
125         done ) | tee $(distdir).swdb
126
127
128 if HAVE_W32_SYSTEM
129 install-data-hook:
130         set -e; \
131         for i in $$($(top_srcdir)/build-aux/potomo \
132                      --get-linguas $(top_srcdir)/po) ; do \
133            $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
134            rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" \
135                                                  2>/dev/null || true; \
136            $(top_srcdir)/build-aux/potomo $(top_srcdir)/po/$$i.po \
137               "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" ; \
138         done
139 endif
140
141
142 gen_start_date = 2011-12-01T06:00:00
143 .PHONY: gen-ChangeLog
144 gen-ChangeLog:
145         if test -e $(top_srcdir)/.git; then                             \
146           (cd $(top_srcdir) &&                                          \
147             $(GITLOG_TO_CHANGELOG) --append-dot --tear-off              \
148             --amend=build-aux/git-log-fix                               \
149             --since=$(gen_start_date) ) > $(distdir)/cl-t;              \
150           cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;  \
151           rm -f $(distdir)/ChangeLog;                                   \
152           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
153         fi
154
155
156 stowinstall:
157         $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/gnupg
158
159 TESTS_ENVIRONMENT = \
160         LC_ALL=C \
161         EXEEXT=$(EXEEXT) \
162         PATH=$(abs_top_builddir)/tests/gpgscm:$(PATH) \
163         abs_top_srcdir=$(abs_top_srcdir) \
164         objdir=$(abs_top_builddir) \
165         GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
166
167 .PHONY: check-all release sign-release
168 check-all:
169         $(TESTS_ENVIRONMENT) \
170           $(abs_top_builddir)/tests/gpgscm/gpgscm \
171           $(abs_srcdir)/tests/run-tests.scm $(TESTFLAGS) $(TESTS)
172
173 # Names of to help the release target.
174 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
175 RELEASE_W32_STEM_NAME = $(PACKAGE_TARNAME)-w32-$(PACKAGE_VERSION)
176
177 release:
178         +(set -e;\
179          if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
180            echo "error: build directory must not be the source directory" >&2;\
181            exit 2;\
182          fi ;\
183          echo "/* Build started at $$(date -uIseconds) */" ;\
184          cd $(top_srcdir); \
185          ./autogen.sh --force; \
186          cd $(abs_top_builddir); \
187          rm -rf dist; mkdir dist ; cd dist ; \
188          $(abs_top_srcdir)/configure --enable-maintainer-mode; \
189          $(MAKE) distcheck TESTFLAGS=--parallel; \
190          $(TAR) xjf $(RELEASE_NAME).tar.bz2 ;\
191          $(MAKE) -f  $(RELEASE_NAME)/build-aux/speedo.mk w32-release ;\
192          echo "/* Build finished at $$(date -uIseconds) */" ;\
193          echo "/*" ;\
194          echo " * Please run the final step interactivly:" ;\
195          echo " *   make sign-release" ;\
196          echo " */" ;\
197         ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
198
199 sign-release:
200          +(set -e; \
201           cd dist; \
202           release_w32_name="$(RELEASE_W32_STEM_NAME)_$$(date -u +%Y%m%d)" ;\
203           files1="$(RELEASE_NAME).tar.bz2 \
204                   $${release_w32_name}.tar.xz \
205                   $${release_w32_name}.exe" ;\
206           files2="$(RELEASE_NAME).tar.bz2.sig \
207                   $(RELEASE_NAME).swdb \
208                   $(RELEASE_NAME).buildlog \
209                   $${release_w32_name}.tar.xz.sig \
210                   $${release_w32_name}.exe.sig    \
211                   $${release_w32_name}.exe.swdb" ;\
212           files3="$${release_w32_name}.wixlib"; \
213           $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk w32-sign-installer ;\
214           echo "/* Signing the source tarball ..." ;\
215           gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\
216           echo "/* Signing the W32 source tarball ..." ;\
217           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.tar.xz ;\
218           echo "/* Signing the W32 installer ..." ;\
219           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.exe ;\
220           cat $(RELEASE_NAME).swdb >swdb.snippet;\
221           echo '#+macro: gnupg22_branch  STABLE-BRANCH-2-2' >>swdb.snippet;\
222           cat  $${release_w32_name}.exe.swdb >>swdb.snippet;\
223           echo >>swdb.snippet ;\
224           sha1sum $${files1} >>swdb.snippet ;\
225           cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
226                | gzip >$(RELEASE_NAME).buildlog ;\
227           echo "Release created - copying it to the local archive ..." ;\
228           scp -p $${files1} $${files2} $${files3} $(RELEASE_ARCHIVE_DIR)/ || true;\
229           echo '/*' ;\
230           echo ' * All done; for checksums see dist/swdb.snippet' ;\
231           echo ' */' ;\
232          )