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