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