1# Copyright (C) 1998,1999,2000,2001,2003,2010,2011,
2#               2012 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 <http://www.gnu.org/licenses/>.
18## Process this file with automake to produce Makefile.in
19
20ACLOCAL_AMFLAGS = -I m4
21# We can't use --enable-selinux-support because some of our regression
22# tests are importing secret keys and that is not allowed if
23# selinux-support is enabled.
24DISTCHECK_CONFIGURE_FLAGS = --enable-mailto
25
26GITLOG_TO_CHANGELOG=gitlog-to-changelog
27
28if CROSS_COMPILING
29checks =
30else
31checks = checks
32endif
33
34if HAVE_W32_SYSTEM
35bzlib = bzlib
36else
37bzlib =
38endif
39
40SUBDIRS = m4 intl zlib ${bzlib} util mpi cipher tools \
41          g10 keyserver po doc ${checks}
42
43EXTRA_DIST = scripts/config.rpath PROJECTS BUGS config.h.in	\
44             autogen.sh ChangeLog-2011 po/ChangeLog-2011	\
45             util/ChangeLog-2011 scripts/ChangeLog-2011		\
46             doc/ChangeLog-2011 tools/ChangeLog-2011		\
47             zlib/ChangeLog-2011 m4/ChangeLog-2011		\
48             include/ChangeLog-2011 g10/ChangeLog-2011		\
49             checks/ChangeLog-2011 cipher/ChangeLog-2011	\
50             intl/ChangeLog-2011 keyserver/ChangeLog-2011	\
51             tests/ChangeLog-2011 mpi/ChangeLog-2011
52
53
54DISTCLEANFILES =
55
56# We do not install README into the doc directory because that would
57# conflict with GnuPG-2.
58# dist_doc_DATA = README
59
60
61# Add all the files listed in "distfiles" files to the distribution,
62# apply version numbers to some files and create a VERSION file which
63# we need for the Prereq: patch file trick.
64dist-hook: gen-ChangeLog
65	@set -e; \
66	 for file in `cd $(top_srcdir); \
67		     find scripts mpi include -type f -name distfiles`; do \
68	    dir=`dirname $$file` ; $(mkinstalldirs) $(distdir)/$$dir ; \
69	    for i in distfiles `cat $(top_srcdir)/$$file` ; do \
70		ln $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i 2> /dev/null \
71		|| cp -p $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \
72	    done ; \
73	done
74	@set -e; \
75	sed -e 's/@pkg_version@/$(VERSION)/g' \
76	    $(top_srcdir)/scripts/gnupg.spec.in \
77	    > $(distdir)/gnupg.spec
78	echo "$(VERSION)" > $(distdir)/VERSION
79
80distcheck-hook:
81	set -e; ( \
82	pref="#+macro: gnupg1_" ;\
83	reldate="$$(date -u +%Y-%m-%d)" ;\
84        echo "$${pref}ver  $(PACKAGE_VERSION)"  ;\
85        echo "$${pref}date $${reldate}" ;\
86        list='$(DIST_ARCHIVES)'; for i in $$list; do \
87	  case "$$i" in *.tar.bz2) \
88            echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
89	    echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
90	    echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
91	  esac;\
92	done ) | tee $(distdir).swdb
93
94gen_start_date = 2011-12-01T06:00:00
95.PHONY: gen-ChangeLog
96gen-ChangeLog:
97	set -e; 							\
98	if test -e $(top_srcdir)/.git; then				\
99	  (cd $(top_srcdir) &&                      			\
100	    $(GITLOG_TO_CHANGELOG) --append-dot --tear-off		\
101	    --amend=scripts/git-log-fix	 				\
102	    --since=$(gen_start_date) ) > $(distdir)/cl-t;		\
103          cat $(top_srcdir)/scripts/git-log-footer >> $(distdir)/cl-t;  \
104	  rm -f $(distdir)/ChangeLog;					\
105	  mv $(distdir)/cl-t $(distdir)/ChangeLog;			\
106	fi
107