New key type `reop'.
[distorted-keys] / Makefile.am
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
26 pkgconfdir = $(sysconfdir)/$(PACKAGE)
27 profiledir = $(pkgconfdir)/profile.d
28
29 bin_SCRIPTS =
30 sbin_SCRIPTS =
31 dist_pkgdata_SCRIPTS =
32 dist_pkgdata_DATA =
33 pkgdata_DATA =
34 dist_profile_DATA =
35 noinst_DATA =
36 USERV_CONFIG =
37 KEYS_CONFIG =
38 TOPLEVEL_CONFIG =
39
40 EXTRA_DIST =
41 CLEANFILES =
42 DISTCLEANFILES =
43
44 ###--------------------------------------------------------------------------
45 ### Substitution of configuration data.
46
47 confsubst = $(top_srcdir)/config/confsubst
48 EXTRA_DIST += config/confsubst
49
50 SUBSTVARS = \
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
59 V_SUBST = $(V_SUBST_$V)
60 V_SUBST_= $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
61 V_SUBST_0 = @printf " SUBST %s\n" $@;
62
63 SUBST = $(V_SUBST)$(confsubst)
64
65 ###--------------------------------------------------------------------------
66 ### Utility programs.
67
68 ## Shamir secret-sharing.
69 bin_SCRIPTS += shamir
70 EXTRA_DIST += shamir.in
71 CLEANFILES += shamir
72 shamir: shamir.in Makefile
73 $(SUBST) $(srcdir)/shamir.in $(SUBSTVARS) >shamir.new && \
74 chmod +x shamir.new && mv shamir.new shamir
75
76 ## Property expansion.
77 bin_SCRIPTS += extract-profile
78 EXTRA_DIST += extract-profile.in
79 CLEANFILES += extract-profile
80 extract-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.
90 sbin_SCRIPTS += keys
91 EXTRA_DIST += keys.in
92 CLEANFILES += keys
93 keys: keys.in Makefile
94 $(SUBST) $(srcdir)/keys.in $(SUBSTVARS) >keys.new && \
95 chmod +x keys.new && mv keys.new keys
96
97 ## Utilities library.
98 pkgdata_DATA += keyfunc.sh
99 EXTRA_DIST += keyfunc.sh.in
100 CLEANFILES += keyfunc.sh
101 keyfunc.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.
106 dist_pkgdata_SCRIPTS += keys.conceal
107 dist_pkgdata_SCRIPTS += keys.delete-keeper
108 dist_pkgdata_SCRIPTS += keys.keeper-cards
109 dist_pkgdata_SCRIPTS += keys.keeper-nub
110 dist_pkgdata_SCRIPTS += keys.list-keepers
111 dist_pkgdata_SCRIPTS += keys.list-recov
112 dist_pkgdata_SCRIPTS += keys.new-keeper
113 dist_pkgdata_SCRIPTS += keys.new-recov
114 dist_pkgdata_SCRIPTS += keys.recover
115 dist_pkgdata_SCRIPTS += keys.reveal
116 dist_pkgdata_SCRIPTS += keys.stash
117
118 ## Common profiles.
119 dist_profile_DATA += profile.d/00base
120 dist_profile_DATA += profile.d/02infra
121
122 ## Other configuration.
123 KEYS_CONFIG += keys.conf
124 EXTRA_DIST += keys.conf
125
126 KEYS_CONFIG += admin.users admin.groups
127 EXTRA_DIST += admin.users admin.groups
128
129 KEYS_CONFIG += keeper-cards.tex
130 EXTRA_DIST += keeper-cards.tex
131
132 ###--------------------------------------------------------------------------
133 ### Crypto operations.
134
135 ## Main driver program.
136 bin_SCRIPTS += cryptop
137 EXTRA_DIST += cryptop.in
138 CLEANFILES += cryptop
139 cryptop: 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.
144 dist_pkgdata_DATA += ktype.gnupg
145 dist_profile_DATA += profile.d/01gnupg
146
147 dist_pkgdata_DATA += ktype.seccure
148 dist_profile_DATA += profile.d/01seccure
149
150 dist_pkgdata_DATA += ktype.reop
151 dist_profile_DATA += profile.d/01reop
152
153 ## Commands.
154 dist_pkgdata_SCRIPTS += cryptop.archive
155 dist_pkgdata_SCRIPTS += cryptop.genkey
156 dist_pkgdata_SCRIPTS += cryptop.list
157 dist_pkgdata_SCRIPTS += cryptop.delkey
158 dist_pkgdata_SCRIPTS += cryptop.recover
159 dist_pkgdata_SCRIPTS += cryptop.info
160 dist_pkgdata_SCRIPTS += cryptop.public
161 dist_pkgdata_SCRIPTS += cryptop.encrypt
162 dist_pkgdata_SCRIPTS += cryptop.decrypt
163 dist_pkgdata_SCRIPTS += cryptop.sign
164 dist_pkgdata_SCRIPTS += cryptop.verify
165
166 ## Userv services configuration.
167 USERV_CONFIG += userv/distorted-keys
168 EXTRA_DIST += userv/distorted-keys.in
169 CLEANFILES += userv/distorted-keys
170 userv/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
179 bin_SCRIPTS += pubkeyop
180 EXTRA_DIST += pubkeyop.in
181 CLEANFILES += pubkeyop
182 pubkeyop: 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.
190 sbin_SCRIPTS += mount-ephemeral
191 EXTRA_DIST += mount-ephemeral
192
193 ## Directory claiming service.
194 USERV_CONFIG += userv/claim-dir
195 EXTRA_DIST += userv/claim-dir.in
196 CLEANFILES += userv/claim-dir
197 userv/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.
204 TOPLEVEL_CONFIG += claim-dir.tab
205 EXTRA_DIST += claim-dir.tab
206
207 ###--------------------------------------------------------------------------
208 ### Installing configuration.
209
210 ## Install userv configuration.
211 noinst_DATA += $(USERV_CONFIG)
212 install-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
221 uninstall-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.
229 noinst_DATA += $(KEYS_CONFIG)
230 install-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
239 uninstall-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.
247 noinst_DATA += $(TOPLEVEL_CONFIG)
248 install-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
257 uninstall-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
267 dist-hook::
268 echo $(VERSION) >$(distdir)/RELEASE
269
270 EXTRA_DIST += config/auto-version
271
272 ###--------------------------------------------------------------------------
273 ### Debian packaging.
274
275 EXTRA_DIST += debian/changelog debian/control debian/copyright
276 EXTRA_DIST += debian/rules debian/compat
277
278 EXTRA_DIST += debian/distorted-keys-base.install
279
280 EXTRA_DIST += debian/distorted-keys.install
281 EXTRA_DIST += debian/distorted-keys.postinst
282
283 EXTRA_DIST += debian/claim-dir.install
284
285 ###----- That's all, folks --------------------------------------------------