Imported Upstream version 1.4.3
[platform/upstream/gpgme.git] / tests / gpg / Makefile.am
1 # Copyright (C) 2000 Werner Koch (dd9jn)
2 # Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH
3 #
4 # This file is part of GPGME.
5 #
6 # GPGME is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2.1 of the
9 # License, or (at your option) any later version.
10 #
11 # GPGME is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
14 # Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20 ## Process this file with automake to produce Makefile.in
21
22 GPG = @GPG@
23 GPG_AGENT = @GPG_AGENT@
24
25 TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) LC_ALL=C GPG_AGENT_INFO=
26
27 # The keylist tests must come after the import and the edit test.
28 noinst_HEADERS = t-support.h
29
30 if HAVE_W32_SYSTEM
31 tests_unix =
32 else
33 tests_unix = t-eventloop t-thread1
34 endif
35
36 c_tests = \
37         t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers         \
38         t-decrypt t-verify t-decrypt-verify t-sig-notation t-export     \
39         t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait      \
40         t-encrypt-large t-file-name t-gpgconf $(tests_unix)
41
42 TESTS = initial.test $(c_tests) final.test
43
44 CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \
45         gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \
46         random_seed S.gpg-agent
47
48 private_keys = \
49         13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \
50         76F7E2B35832976B50A27A282D9B87E44577EB66 \
51         A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
52         13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F \
53         7A030357C0F253A5BBCD282FFC4E521B37558F5C
54
55
56 EXTRA_DIST = start-stop-agent initial.test final.test \
57         pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \
58         geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys)
59
60 INCLUDES = -I$(top_builddir)/src
61
62 AM_CPPFLAGS = @GPG_ERROR_CFLAGS@
63 LDADD = ../../src/libgpgme.la
64 t_thread1_LDADD = ../../src/libgpgme-pthread.la -lpthread
65
66 # We don't run t-genkey in the test suite, because it takes too long
67 noinst_PROGRAMS = $(c_tests) t-genkey
68
69 clean-local:
70         -$(srcdir)/start-stop-agent --stop
71         -rm -fR private-keys-v1.d
72
73 all-local: ./gpg.conf ./gpg-agent.conf ./pubring.gpg \
74            ./private-keys-v1.d/gpg-sample.stamp
75
76 export GNUPGHOME := $(abs_builddir)
77
78 export GPG_AGENT_INFO :=
79
80 ./private-keys-v1.d/gpg-sample.stamp: $(srcdir)/$(private_keys)
81         test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
82         for k in $(private_keys); do \
83           cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \
84         done
85         echo x > ./private-keys-v1.d/gpg-sample.stamp
86
87 ./pubring.gpg: $(srcdir)/pubdemo.asc
88         -$(GPG) --no-permission-warning \
89                 --import $(srcdir)/pubdemo.asc
90         -$(GPG) --no-permission-warning \
91                 --import $(srcdir)/secdemo.asc
92
93 ./gpg.conf:
94 # This is required for t-sig-notations.
95         echo no-force-v3-sigs > ./gpg.conf
96
97 ./gpg-agent.conf:
98 # This is required for gpg2, which does not support command fd.
99         echo pinentry-program $(abs_srcdir)/pinentry > ./gpg-agent.conf