@@@ keys.retire-recov
[distorted-keys] / Makefile.am
CommitLineData
53263601
MW
1### -*-makefile-*-
2###
3### Build script for distorted.org.uk key management
4###
5### (c) 2011 Mark Wooding
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
599c8f75
MW
10### This file is part of the distorted.org.uk key management suite.
11###
12### distorted-keys is free software; you can redistribute it and/or modify
53263601
MW
13### it under the terms of the GNU General Public License as published by
14### the Free Software Foundation; either version 2 of the License, or
15### (at your option) any later version.
16###
599c8f75 17### distorted-keys is distributed in the hope that it will be useful,
53263601
MW
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU General Public License for more details.
21###
22### You should have received a copy of the GNU General Public License
599c8f75 23### along with distorted-keys; if not, write to the Free Software Foundation,
53263601
MW
24### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
c0979a8f
MW
26pkgconfdir = $(sysconfdir)/$(PACKAGE)
27profiledir = $(pkgconfdir)/profile.d
28
53263601 29bin_SCRIPTS =
c47f2aba 30sbin_SCRIPTS =
3f98ee81
MW
31man_MANS =
32dist_man_MANS =
a36c4bb5
MW
33dist_pkgdata_SCRIPTS =
34dist_pkgdata_DATA =
35pkgdata_DATA =
c0979a8f 36dist_profile_DATA =
b401ccf1
MW
37noinst_DATA =
38USERV_CONFIG =
39KEYS_CONFIG =
40TOPLEVEL_CONFIG =
53263601
MW
41
42EXTRA_DIST =
43CLEANFILES =
44DISTCLEANFILES =
45
46###--------------------------------------------------------------------------
47### Substitution of configuration data.
48
49confsubst = $(top_srcdir)/config/confsubst
50EXTRA_DIST += config/confsubst
51
52SUBSTVARS = \
a85aae03 53 PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
53263601 54 PYTHON="$(PYTHON)" \
c122b713 55 bindir="$(bindir)" sbindir="$(sbindir)" \
33aa94e8 56 sysconfdir="$(sysconfdir)" pkgconfdir="$(pkgconfdir)" \
c0979a8f 57 pkgstatedir="$(localstatedir)/lib/$(PACKAGE)" \
a36c4bb5 58 pkgdatadir="$(pkgdatadir)" \
c122b713 59 user="$(user)"
53263601 60
59d0e78e
MW
61V_SUBST = $(V_SUBST_$V)
62V_SUBST_= $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
63V_SUBST_0 = @printf " SUBST %s\n" $@;
64
65SUBST = $(V_SUBST)$(confsubst)
53263601
MW
66
67###--------------------------------------------------------------------------
68### Utility programs.
69
70## Shamir secret-sharing.
71bin_SCRIPTS += shamir
72EXTRA_DIST += shamir.in
3f98ee81 73dist_man_MANS += shamir.1
53263601
MW
74CLEANFILES += shamir
75shamir: shamir.in Makefile
76 $(SUBST) $(srcdir)/shamir.in $(SUBSTVARS) >shamir.new && \
77 chmod +x shamir.new && mv shamir.new shamir
78
c47f2aba
MW
79## Property expansion.
80bin_SCRIPTS += extract-profile
81EXTRA_DIST += extract-profile.in
a218eb12 82dist_man_MANS += extract-profile.1
c47f2aba
MW
83CLEANFILES += extract-profile
84extract-profile: extract-profile.in Makefile
85 $(SUBST) $(srcdir)/extract-profile.in $(SUBSTVARS) \
86 >extract-profile.new && \
87 chmod +x extract-profile.new && \
88 mv extract-profile.new extract-profile
89
90###--------------------------------------------------------------------------
53263601
MW
91### Main driver program and commands.
92
93## Main driver.
4c8c4065 94sbin_SCRIPTS += keys
53263601
MW
95EXTRA_DIST += keys.in
96CLEANFILES += keys
97keys: keys.in Makefile
98 $(SUBST) $(srcdir)/keys.in $(SUBSTVARS) >keys.new && \
99 chmod +x keys.new && mv keys.new keys
100
101## Utilities library.
a36c4bb5 102pkgdata_DATA += keyfunc.sh
53263601
MW
103EXTRA_DIST += keyfunc.sh.in
104CLEANFILES += keyfunc.sh
105keyfunc.sh: keyfunc.sh.in Makefile
106 $(SUBST) $(srcdir)/keyfunc.sh.in $(SUBSTVARS) >keyfunc.sh.new && \
107 mv keyfunc.sh.new keyfunc.sh
108
109## Commands.
a36c4bb5
MW
110dist_pkgdata_SCRIPTS += keys.conceal
111dist_pkgdata_SCRIPTS += keys.delete-keeper
8e63b990 112dist_pkgdata_SCRIPTS += keys.forget-keeper
a36c4bb5
MW
113dist_pkgdata_SCRIPTS += keys.keeper-cards
114dist_pkgdata_SCRIPTS += keys.keeper-nub
115dist_pkgdata_SCRIPTS += keys.list-keepers
116dist_pkgdata_SCRIPTS += keys.list-recov
117dist_pkgdata_SCRIPTS += keys.new-keeper
118dist_pkgdata_SCRIPTS += keys.new-recov
119dist_pkgdata_SCRIPTS += keys.recover
120dist_pkgdata_SCRIPTS += keys.reveal
121dist_pkgdata_SCRIPTS += keys.stash
53263601 122
b401ccf1
MW
123## Common profiles.
124dist_profile_DATA += profile.d/00base
125dist_profile_DATA += profile.d/02infra
126
127## Other configuration.
128KEYS_CONFIG += keys.conf
129EXTRA_DIST += keys.conf
130
131KEYS_CONFIG += admin.users admin.groups
132EXTRA_DIST += admin.users admin.groups
133
ac1aec3a
MW
134KEYS_CONFIG += keeper-cards.tex
135EXTRA_DIST += keeper-cards.tex
136
8f2a76c1
MW
137###--------------------------------------------------------------------------
138### Crypto operations.
139
140## Main driver program.
4c8c4065 141bin_SCRIPTS += cryptop
8f2a76c1
MW
142EXTRA_DIST += cryptop.in
143CLEANFILES += cryptop
144cryptop: cryptop.in Makefile
145 $(SUBST) $(srcdir)/cryptop.in $(SUBSTVARS) >cryptop.new && \
146 chmod +x cryptop.new && mv cryptop.new cryptop
147
148## Key type libraries.
a36c4bb5 149dist_pkgdata_DATA += ktype.gnupg
c0979a8f
MW
150dist_profile_DATA += profile.d/01gnupg
151
a36c4bb5 152dist_pkgdata_DATA += ktype.seccure
c0979a8f 153dist_profile_DATA += profile.d/01seccure
8f2a76c1 154
8e580e35
MW
155dist_pkgdata_DATA += ktype.reop
156dist_profile_DATA += profile.d/01reop
157
8f2a76c1 158## Commands.
a36c4bb5
MW
159dist_pkgdata_SCRIPTS += cryptop.archive
160dist_pkgdata_SCRIPTS += cryptop.genkey
161dist_pkgdata_SCRIPTS += cryptop.list
162dist_pkgdata_SCRIPTS += cryptop.delkey
163dist_pkgdata_SCRIPTS += cryptop.recover
164dist_pkgdata_SCRIPTS += cryptop.info
165dist_pkgdata_SCRIPTS += cryptop.public
166dist_pkgdata_SCRIPTS += cryptop.encrypt
167dist_pkgdata_SCRIPTS += cryptop.decrypt
168dist_pkgdata_SCRIPTS += cryptop.sign
169dist_pkgdata_SCRIPTS += cryptop.verify
8f2a76c1 170
c122b713 171## Userv services configuration.
b401ccf1 172USERV_CONFIG += userv/distorted-keys
14e6d4c9
MW
173EXTRA_DIST += userv/distorted-keys.in
174CLEANFILES += userv/distorted-keys
175userv/distorted-keys: userv/distorted-keys.in Makefile
176 $(AM_V_at)mkdir -p userv/
177 $(SUBST) $(srcdir)/userv/distorted-keys.in $(SUBSTVARS) \
178 >userv/distorted-keys.new && \
179 mv userv/distorted-keys.new userv/distorted-keys
c122b713 180
c0979a8f 181###--------------------------------------------------------------------------
b8691d14
MW
182### Standalone operations on public keys.
183
184bin_SCRIPTS += pubkeyop
185EXTRA_DIST += pubkeyop.in
186CLEANFILES += pubkeyop
187pubkeyop: pubkeyop.in Makefile
188 $(SUBST) $(srcdir)/pubkeyop.in $(SUBSTVARS) >pubkeyop.new && \
189 chmod +x pubkeyop.new && mv pubkeyop.new pubkeyop
190
191###--------------------------------------------------------------------------
33aa94e8
MW
192### Secure storage management.
193
194## Ephemeral filesystem construction.
195sbin_SCRIPTS += mount-ephemeral
196EXTRA_DIST += mount-ephemeral
197
198## Directory claiming service.
b401ccf1 199USERV_CONFIG += userv/claim-dir
33aa94e8
MW
200EXTRA_DIST += userv/claim-dir.in
201CLEANFILES += userv/claim-dir
202userv/claim-dir: userv/claim-dir.in Makefile
203 $(AM_V_at)mkdir -p userv/
204 $(SUBST) $(srcdir)/userv/claim-dir.in $(SUBSTVARS) \
205 >userv/claim-dir.new && \
206 mv userv/claim-dir.new userv/claim-dir
207
208## Configuration file.
b401ccf1 209TOPLEVEL_CONFIG += claim-dir.tab
33aa94e8
MW
210EXTRA_DIST += claim-dir.tab
211
212###--------------------------------------------------------------------------
b401ccf1
MW
213### Installing configuration.
214
215## Install userv configuration.
216noinst_DATA += $(USERV_CONFIG)
217install-data-local::
218 $(MKDIR_P) $(DESTDIR)$(uservconfdir)
219 @for i in $(USERV_CONFIG); do \
220 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
221 if [ -f $(DESTDIR)$(uservconfdir)/$$b ]; then continue; fi; \
222 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
223 echo $(INSTALL_DATA) $$s $(DESTDIR)$(uservconfdir); \
224 $(INSTALL_DATA) $$s $(DESTDIR)$(uservconfdir) || exit 1; \
225 done
226uninstall-local::
227 @for i in $(USERV_CONFIG); do \
228 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
229 echo rm -f $(DESTDIR)$(uservconfdir)/$$b; \
230 rm -f $(DESTDIR)$(uservconfdir)/$$b; \
231 done
232
233## Install keys configuration.
234noinst_DATA += $(KEYS_CONFIG)
235install-data-local::
236 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)
237 @for i in $(KEYS_CONFIG); do \
238 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
239 if [ -f $(DESTDIR)$(pkgconfdir)/$$b ]; then continue; fi; \
240 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
241 echo $(INSTALL_DATA) $$s $(DESTDIR)$(pkgconfdir); \
242 $(INSTALL_DATA) $$s $(DESTDIR)$(pkgconfdir) || exit 1; \
243 done
244uninstall-local::
245 @for i in $(KEYS_CONFIG); do \
246 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
247 echo rm -f $(DESTDIR)$(pkgconfdir)/$$b; \
248 rm -f $(DESTDIR)$(pkgconfdir)/$$b; \
249 done
250
251## Install toplevel configuration.
252noinst_DATA += $(TOPLEVEL_CONFIG)
253install-data-local::
254 $(MKDIR_P) $(DESTDIR)$(sysconfdir)
255 @for i in $(TOPLEVEL_CONFIG); do \
256 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
257 if [ -f $(DESTDIR)$(sysconfdir)/$$b ]; then continue; fi; \
258 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
259 echo $(INSTALL_DATA) $$s $(DESTDIR)$(sysconfdir); \
260 $(INSTALL_DATA) $$s $(DESTDIR)$(sysconfdir) || exit 1; \
261 done
262uninstall-local::
263 @for i in $(TOPLEVEL_CONFIG); do \
264 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
265 echo rm -f $(DESTDIR)$(sysconfdir)/$$b; \
266 rm -f $(DESTDIR)$(sysconfdir)/$$b; \
267 done
125f634c 268
d38dc450
MW
269###--------------------------------------------------------------------------
270### Release setup.
271
272dist-hook::
273 echo $(VERSION) >$(distdir)/RELEASE
274
275EXTRA_DIST += config/auto-version
276
f012ad83
MW
277###--------------------------------------------------------------------------
278### Debian packaging.
279
280EXTRA_DIST += debian/changelog debian/control debian/copyright
281EXTRA_DIST += debian/rules debian/compat
282
315ad13e
MW
283EXTRA_DIST += debian/distorted-keys-base.install
284
f012ad83
MW
285EXTRA_DIST += debian/distorted-keys.install
286EXTRA_DIST += debian/distorted-keys.postinst
287
33aa94e8
MW
288EXTRA_DIST += debian/claim-dir.install
289
53263601 290###----- That's all, folks --------------------------------------------------