Clean up the tests correctly.
[gpgme.git] / tests / gpgsm / Makefile.am
1 # Copyright (C) 2000 Werner Koch (dd9jn)
2 # Copyright (C) 2001 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 GPGSM = @GPGSM@
23
24 TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= 
25
26 noinst_HEADERS = t-support.h
27 TESTS = t-import t-keylist t-encrypt t-verify t-decrypt t-sign t-export
28
29 EXTRA_DIST = cert_dfn_pca01.der cert_dfn_pca15.der cert_g10code_test1.der \
30         $(key_id)
31
32 INCLUDES = -I$(top_builddir)/src
33
34 AM_CPPFLAGS = @GPG_ERROR_CFLAGS@
35 LDADD = ../../src/libgpgme.la
36
37 # We don't run t-genkey in the test suite, because it takes too long
38 # and needs a working pinentry.
39 noinst_PROGRAMS = $(TESTS) t-genkey cms-keylist cms-decrypt
40
41 key_id = 32100C27173EF6E9C4E9A25D3D69F86D37A4F939
42
43 CLEANFILES = pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \
44         random_seed S.gpg-agent  
45
46 clean-local:
47         -gpg-connect-agent KILLAGENT /bye
48         -rm -fR private-keys-v1.d
49
50 all-local: ./pubring.kbx ./gpgsm.conf ./private-keys-v1.d/$(key_id).key ./trustlist.txt
51
52 export GNUPGHOME := $(abs_builddir)
53
54 export GPG_AGENT_INFO := 
55
56 ./pubring.kbx: $(srcdir)/cert_g10code_test1.der
57         $(GPGSM) --import $(srcdir)/cert_g10code_test1.der
58
59 ./gpgsm.conf:
60         echo disable-crl-checks > ./gpgsm.conf
61         echo faked-system-time 1008241200 >> ./gpgsm.conf
62
63 ./private-keys-v1.d/$(key_id).key: $(srcdir)/$(key_id)
64         test -d ./private-keys-v1.d || mkdir ./private-keys-v1.d
65         cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key
66
67 ./trustlist.txt:
68         echo $(key_id) > ./trustlist.txt
69         echo >> ./trustlist.txt
70         echo "# CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE" >> ./trustlist.txt
71         echo "3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E S" >> ./trustlist.txt
72