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