1 # Makefile.am - Top level Makefile for GPGME.
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002, 2004, 2005, 2008, 2009 g10 Code GmbH
5 # This file is part of GPGME.
7 # GPGME is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2.1 of the
10 # License, or (at your option) any later version.
12 # GPGME is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15 # Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, see <https://gnu.org/licenses/>.
19 # SPDX-License-Identifier: LGPL-2.1-or-later
21 ## Process this file with automake to produce Makefile.in
23 # Location of the released tarball archives. This is prefixed by
24 # the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example:
25 # RELEASE_ARCHIVE=user@host:archive/tarballs
26 RELEASE_ARCHIVE_SUFFIX = gpgme
27 # The variable RELEASE_SIGNKEY in ~/.gnupg-autogen.rc is used
28 # to specify the key for signing. For example:
29 # RELEASE_SIGNKEY=D8692123C4065DEA5E0F3AB5249B39D24F25E3B6
33 ACLOCAL_AMFLAGS = -I m4
35 DISTCHECK_CONFIGURE_FLAGS =
37 EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in \
38 ChangeLog-2011 m4/ChangeLog-2011 \
39 conf/whatisthis VERSION
48 SUBDIRS = src ${tests} doc lang
50 # Fix the version of the spec file.
51 dist-hook: gen-ChangeLog
53 sed -e 's/@pkg_version@/$(PACKAGE_VERSION)/g' \
54 $(top_srcdir)/gpgme.spec.in > $(distdir)/gpgme.spec
58 pref="#+macro: gpgme_" ;\
59 reldate="$$(date -u +%Y-%m-%d)" ;\
60 echo "$${pref}ver $(PACKAGE_VERSION)" ;\
61 echo "$${pref}date $${reldate}" ;\
62 list='$(DIST_ARCHIVES)'; for i in $$list; do \
63 case "$$i" in *.tar.bz2) \
64 echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
65 echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
66 echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
68 done ) | tee $(distdir).swdb
70 .PHONY: gen-ChangeLog release sign-release
72 gen_start_date = 2011-12-01T00:00:00
74 if test -d $(top_srcdir)/.git; then \
75 (cd $(top_srcdir) && \
76 $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
77 --amend=build-aux/git-log-fix \
78 --since=$(gen_start_date) ) > $(distdir)/cl-t; \
79 cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\
80 rm -f $(distdir)/ChangeLog; \
81 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
85 # Macro to help the release target.
86 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
90 if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
91 echo "error: build directory must not be the source directory" >&2;\
94 echo "/* Build started at $$(date -uIseconds) */" ;\
96 ./autogen.sh --force; \
97 cd $(abs_top_builddir); \
98 rm -rf dist; mkdir dist ; cd dist ; \
99 $(abs_top_srcdir)/configure --enable-maintainer-mode; \
101 echo "/* Build finished at $$(date -uIseconds) */" ;\
103 echo " * Please run the final step interactively:" ;\
104 echo " * make sign-release" ;\
106 ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
111 x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
112 if [ -z "$$x" ]; then \
113 echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \
116 myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\
117 x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
118 if [ -z "$$x" ]; then \
119 echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \
123 files1="$(RELEASE_NAME).tar.bz2" ;\
124 files2="$(RELEASE_NAME).tar.bz2.sig \
125 $(RELEASE_NAME).swdb \
126 $(RELEASE_NAME).buildlog" ;\
127 echo "/* Signing the source tarball ..." ;\
128 gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\
129 cat $(RELEASE_NAME).swdb >swdb.snippet;\
130 echo >>swdb.snippet ;\
131 sha1sum $${files1} >>swdb.snippet ;\
132 cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
133 | gzip >$(RELEASE_NAME).buildlog ;\
134 echo "Copying to local archive ..." ;\
135 scp -p $${files1} $${files2} $$myarchive/ || true;\
136 echo "Uploading documentation ..." ;\
137 $(MAKE) -C doc online; \
139 echo ' * All done; for checksums see dist/swdb.snippet' ;\