chiark / gitweb /
Makefile: Install configuration files.
[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
8f2a76c1
MW
128###--------------------------------------------------------------------------
129### Crypto operations.
130
131## Main driver program.
4c8c4065 132bin_SCRIPTS += cryptop
8f2a76c1
MW
133EXTRA_DIST += cryptop.in
134CLEANFILES += cryptop
135cryptop: cryptop.in Makefile
136 $(SUBST) $(srcdir)/cryptop.in $(SUBSTVARS) >cryptop.new && \
137 chmod +x cryptop.new && mv cryptop.new cryptop
138
139## Key type libraries.
140dist_pkglib_DATA += ktype.gnupg
c0979a8f
MW
141dist_profile_DATA += profile.d/01gnupg
142
8f2a76c1 143dist_pkglib_DATA += ktype.seccure
c0979a8f 144dist_profile_DATA += profile.d/01seccure
8f2a76c1
MW
145
146## Commands.
410343d6 147dist_pkglib_SCRIPTS += cryptop.archive
8f2a76c1 148dist_pkglib_SCRIPTS += cryptop.genkey
f5673211 149dist_pkglib_SCRIPTS += cryptop.list
8f2a76c1
MW
150dist_pkglib_SCRIPTS += cryptop.delkey
151dist_pkglib_SCRIPTS += cryptop.recover
152dist_pkglib_SCRIPTS += cryptop.info
153dist_pkglib_SCRIPTS += cryptop.public
154dist_pkglib_SCRIPTS += cryptop.encrypt
155dist_pkglib_SCRIPTS += cryptop.decrypt
156dist_pkglib_SCRIPTS += cryptop.sign
157dist_pkglib_SCRIPTS += cryptop.verify
158
c122b713 159## Userv services configuration.
b401ccf1 160USERV_CONFIG += userv/distorted-keys
14e6d4c9
MW
161EXTRA_DIST += userv/distorted-keys.in
162CLEANFILES += userv/distorted-keys
163userv/distorted-keys: userv/distorted-keys.in Makefile
164 $(AM_V_at)mkdir -p userv/
165 $(SUBST) $(srcdir)/userv/distorted-keys.in $(SUBSTVARS) \
166 >userv/distorted-keys.new && \
167 mv userv/distorted-keys.new userv/distorted-keys
c122b713 168
c0979a8f 169###--------------------------------------------------------------------------
b8691d14
MW
170### Standalone operations on public keys.
171
172bin_SCRIPTS += pubkeyop
173EXTRA_DIST += pubkeyop.in
174CLEANFILES += pubkeyop
175pubkeyop: pubkeyop.in Makefile
176 $(SUBST) $(srcdir)/pubkeyop.in $(SUBSTVARS) >pubkeyop.new && \
177 chmod +x pubkeyop.new && mv pubkeyop.new pubkeyop
178
179###--------------------------------------------------------------------------
33aa94e8
MW
180### Secure storage management.
181
182## Ephemeral filesystem construction.
183sbin_SCRIPTS += mount-ephemeral
184EXTRA_DIST += mount-ephemeral
185
186## Directory claiming service.
b401ccf1 187USERV_CONFIG += userv/claim-dir
33aa94e8
MW
188EXTRA_DIST += userv/claim-dir.in
189CLEANFILES += userv/claim-dir
190userv/claim-dir: userv/claim-dir.in Makefile
191 $(AM_V_at)mkdir -p userv/
192 $(SUBST) $(srcdir)/userv/claim-dir.in $(SUBSTVARS) \
193 >userv/claim-dir.new && \
194 mv userv/claim-dir.new userv/claim-dir
195
196## Configuration file.
b401ccf1 197TOPLEVEL_CONFIG += claim-dir.tab
33aa94e8
MW
198EXTRA_DIST += claim-dir.tab
199
200###--------------------------------------------------------------------------
b401ccf1
MW
201### Installing configuration.
202
203## Install userv configuration.
204noinst_DATA += $(USERV_CONFIG)
205install-data-local::
206 $(MKDIR_P) $(DESTDIR)$(uservconfdir)
207 @for i in $(USERV_CONFIG); do \
208 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
209 if [ -f $(DESTDIR)$(uservconfdir)/$$b ]; then continue; fi; \
210 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
211 echo $(INSTALL_DATA) $$s $(DESTDIR)$(uservconfdir); \
212 $(INSTALL_DATA) $$s $(DESTDIR)$(uservconfdir) || exit 1; \
213 done
214uninstall-local::
215 @for i in $(USERV_CONFIG); do \
216 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
217 echo rm -f $(DESTDIR)$(uservconfdir)/$$b; \
218 rm -f $(DESTDIR)$(uservconfdir)/$$b; \
219 done
220
221## Install keys configuration.
222noinst_DATA += $(KEYS_CONFIG)
223install-data-local::
224 $(MKDIR_P) $(DESTDIR)$(pkgconfdir)
225 @for i in $(KEYS_CONFIG); do \
226 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
227 if [ -f $(DESTDIR)$(pkgconfdir)/$$b ]; then continue; fi; \
228 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
229 echo $(INSTALL_DATA) $$s $(DESTDIR)$(pkgconfdir); \
230 $(INSTALL_DATA) $$s $(DESTDIR)$(pkgconfdir) || exit 1; \
231 done
232uninstall-local::
233 @for i in $(KEYS_CONFIG); do \
234 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
235 echo rm -f $(DESTDIR)$(pkgconfdir)/$$b; \
236 rm -f $(DESTDIR)$(pkgconfdir)/$$b; \
237 done
238
239## Install toplevel configuration.
240noinst_DATA += $(TOPLEVEL_CONFIG)
241install-data-local::
242 $(MKDIR_P) $(DESTDIR)$(sysconfdir)
243 @for i in $(TOPLEVEL_CONFIG); do \
244 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
245 if [ -f $(DESTDIR)$(sysconfdir)/$$b ]; then continue; fi; \
246 if [ -f $$i ]; then s=$$i; else s=$(srcdir)/$$i; fi; \
247 echo $(INSTALL_DATA) $$s $(DESTDIR)$(sysconfdir); \
248 $(INSTALL_DATA) $$s $(DESTDIR)$(sysconfdir) || exit 1; \
249 done
250uninstall-local::
251 @for i in $(TOPLEVEL_CONFIG); do \
252 b=$$(expr /$$i : '.*/\([^/]*\)$$'); \
253 echo rm -f $(DESTDIR)$(sysconfdir)/$$b; \
254 rm -f $(DESTDIR)$(sysconfdir)/$$b; \
255 done
125f634c 256
d38dc450
MW
257###--------------------------------------------------------------------------
258### Release setup.
259
260dist-hook::
261 echo $(VERSION) >$(distdir)/RELEASE
262
263EXTRA_DIST += config/auto-version
264
f012ad83
MW
265###--------------------------------------------------------------------------
266### Debian packaging.
267
268EXTRA_DIST += debian/changelog debian/control debian/copyright
269EXTRA_DIST += debian/rules debian/compat
270
315ad13e
MW
271EXTRA_DIST += debian/distorted-keys-base.install
272
f012ad83
MW
273EXTRA_DIST += debian/distorted-keys.install
274EXTRA_DIST += debian/distorted-keys.postinst
275
33aa94e8
MW
276EXTRA_DIST += debian/claim-dir.install
277
53263601 278###----- That's all, folks --------------------------------------------------