Imported Upstream version 2.2.11
[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/patches/atk-1.32.0.patch      \
59              build-aux/speedo/patches/libiconv-1.14.patch   \
60              build-aux/speedo/patches/pango-1.29.4.patch    \
61              build-aux/speedo/patches/gpgme-1.12.0.patch    \
62              build-aux/speedo/patches/sqlite.patch
63
64
65 DISTCLEANFILES = g10defs.h
66
67 if BUILD_GPG
68 gpg = g10
69 else
70 gpg =
71 endif
72 if BUILD_GPGSM
73 sm = sm
74 else
75 sm =
76 endif
77 if BUILD_AGENT
78 agent = agent
79 else
80 agent =
81 endif
82 if BUILD_SCDAEMON
83 scd = scd
84 else
85 scd =
86 endif
87 if BUILD_G13
88 g13 = g13
89 else
90 g13 =
91 endif
92 if BUILD_DIRMNGR
93 dirmngr = dirmngr
94 else
95 dirmngr =
96 endif
97 if BUILD_DOC
98 doc = doc
99 else
100 doc =
101 endif
102
103 SUBDIRS = m4 common kbx \
104           ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
105           tools po ${doc} tests
106
107 dist_doc_DATA = README
108
109
110 dist-hook: gen-ChangeLog
111
112 distcheck-hook:
113         set -e; ( \
114         pref="#+macro: gnupg22_" ;\
115         reldate="$$(date -u +%Y-%m-%d)" ;\
116         echo "$${pref}ver  $(PACKAGE_VERSION)"  ;\
117         echo "$${pref}date $${reldate}" ;\
118         list='$(DIST_ARCHIVES)'; for i in $$list; do \
119           case "$$i" in *.tar.bz2) \
120             echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
121             echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
122             echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
123           esac;\
124         done ) | tee $(distdir).swdb
125
126
127 if HAVE_W32_SYSTEM
128 install-data-hook:
129         set -e; \
130         for i in $$($(top_srcdir)/build-aux/potomo \
131                      --get-linguas $(top_srcdir)/po) ; do \
132            $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
133            rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" \
134                                                  2>/dev/null || true; \
135            $(top_srcdir)/build-aux/potomo $(top_srcdir)/po/$$i.po \
136               "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" ; \
137         done
138 endif
139
140
141 gen_start_date = 2011-12-01T06:00:00
142 .PHONY: gen-ChangeLog
143 gen-ChangeLog:
144         if test -e $(top_srcdir)/.git; then                             \
145           (cd $(top_srcdir) &&                                          \
146             $(GITLOG_TO_CHANGELOG) --append-dot --tear-off              \
147             --amend=build-aux/git-log-fix                               \
148             --since=$(gen_start_date) ) > $(distdir)/cl-t;              \
149           cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;  \
150           rm -f $(distdir)/ChangeLog;                                   \
151           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
152         fi
153
154
155 stowinstall:
156         $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/gnupg
157
158 TESTS_ENVIRONMENT = \
159         LC_ALL=C \
160         EXEEXT=$(EXEEXT) \
161         PATH=$(abs_top_builddir)/tests/gpgscm:$(PATH) \
162         abs_top_srcdir=$(abs_top_srcdir) \
163         objdir=$(abs_top_builddir) \
164         GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
165
166 .PHONY: check-all release sign-release
167 check-all:
168         $(TESTS_ENVIRONMENT) \
169           $(abs_top_builddir)/tests/gpgscm/gpgscm \
170           $(abs_srcdir)/tests/run-tests.scm $(TESTFLAGS) $(TESTS)
171
172 # Names of to help the release target.
173 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
174 RELEASE_W32_STEM_NAME = $(PACKAGE_TARNAME)-w32-$(PACKAGE_VERSION)
175
176 release:
177         +(set -e;\
178          if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
179            echo "error: build directory must not be the source directory" >&2;\
180            exit 2;\
181          fi ;\
182          echo "/* Build started at $$(date -uIseconds) */" ;\
183          cd $(top_srcdir); \
184          ./autogen.sh --force; \
185          cd $(abs_top_builddir); \
186          rm -rf dist; mkdir dist ; cd dist ; \
187          $(abs_top_srcdir)/configure --enable-maintainer-mode; \
188          $(MAKE) distcheck TESTFLAGS=--parallel; \
189          $(TAR) xjf $(RELEASE_NAME).tar.bz2 ;\
190          $(MAKE) -f  $(RELEASE_NAME)/build-aux/speedo.mk w32-release ;\
191          echo "/* Build finished at $$(date -uIseconds) */" ;\
192          echo "/*" ;\
193          echo " * Please run the final step interactivly:" ;\
194          echo " *   make sign-release" ;\
195          echo " */" ;\
196         ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
197
198 sign-release:
199          +(set -e; \
200           cd dist; \
201           release_w32_name="$(RELEASE_W32_STEM_NAME)_$$(date -u +%Y%m%d)" ;\
202           files1="$(RELEASE_NAME).tar.bz2 \
203                   $${release_w32_name}.tar.xz \
204                   $${release_w32_name}.exe" ;\
205           files2="$(RELEASE_NAME).tar.bz2.sig \
206                   $(RELEASE_NAME).swdb \
207                   $(RELEASE_NAME).buildlog \
208                   $${release_w32_name}.tar.xz.sig \
209                   $${release_w32_name}.exe.sig    \
210                   $${release_w32_name}.exe.swdb" ;\
211           $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk w32-sign-installer ;\
212           echo "/* Signing the source tarball ..." ;\
213           gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\
214           echo "/* Signing the W32 source tarball ..." ;\
215           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.tar.xz ;\
216           echo "/* Signing the W32 installer ..." ;\
217           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.exe ;\
218           cat $(RELEASE_NAME).swdb >swdb.snippet;\
219           echo '#+macro: gnupg22_branch  STABLE-BRANCH-2-2' >>swdb.snippet;\
220           cat  $${release_w32_name}.exe.swdb >>swdb.snippet;\
221           echo >>swdb.snippet ;\
222           sha1sum $${files1} >>swdb.snippet ;\
223           cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
224                | gzip >$(RELEASE_NAME).buildlog ;\
225           echo "Release created - copying it to the local archive ..." ;\
226           scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\
227           echo '/*' ;\
228           echo ' * All done; for checksums see dist/swdb.snippet' ;\
229           echo ' */' ;\
230          )