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