/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
1
WARN=-O -Wall -Wformat=2 -Winit-self -Wmissing-include-dirs \
2
	-Wswitch-default -Wswitch-enum -Wunused-parameter \
304 by Teddy Hogeborn
Four new interrelated features:
3
	-Wstrict-aliasing=1 -Wextra -Wfloat-equal -Wundef -Wshadow \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
4
	-Wunsafe-loop-optimizations -Wpointer-arith \
5
	-Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \
6
	-Wconversion -Wstrict-prototypes -Wold-style-definition \
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
7
	-Wpacked -Wnested-externs -Winline -Wvolatile-register-var
505.1.4 by Teddy Hogeborn
Removed superflous white space.
8
#	-Wunreachable-code
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
9
#DEBUG=-ggdb3
28 by Teddy Hogeborn
* server.conf: New file.
10
# For info about _FORTIFY_SOURCE, see
389 by Teddy Hogeborn
* plugins.d/splashy.c: Use exit codes from <sysexits.h>.
11
# <http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html>
12
# and <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>.
237.2.31 by Teddy Hogeborn
* Makefile: Don't use PIE if BROKEN_PIE is set.
13
FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC
14
LINK_FORTIFY_LD=-z relro -z now
15
LINK_FORTIFY=
399 by Teddy Hogeborn
* Makefile (BROKEN_PIE): Add comment.
16
17
# If BROKEN_PIE is set, do not build with -pie
237.2.31 by Teddy Hogeborn
* Makefile: Don't use PIE if BROKEN_PIE is set.
18
ifndef BROKEN_PIE
19
FORTIFY += -fPIE
20
LINK_FORTIFY += -pie
21
endif
24.1.90 by Björn Påhlsson
fixed two bugs:
22
#COVERAGE=--coverage
24.1.51 by Björn Påhlsson
Added configuration files support for mandos-client
23
OPTIMIZE=-Os
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
24
LANGUAGE=-std=gnu99
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
25
htmldir=man
237.4.37 by Teddy Hogeborn
* Makefile (version): Changed to "1.6.2".
26
version=1.6.2
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
27
SED=sed
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
28
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
29
USER=$(firstword $(subst :, ,$(shell getent passwd _mandos || getent passwd nobody || echo 65534)))
30
GROUP=$(firstword $(subst :, ,$(shell getent group _mandos || getent group nobody || echo 65534)))
31
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
32
## Use these settings for a traditional /usr/local install
33
# PREFIX=$(DESTDIR)/usr/local
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
34
# CONFDIR=$(DESTDIR)/etc/mandos
35
# KEYDIR=$(DESTDIR)/etc/mandos/keys
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
36
# MANDIR=$(PREFIX)/man
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
37
# INITRAMFSTOOLS=$(DESTDIR)/etc/initramfs-tools
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
38
# STATEDIR=$(DESTDIR)/var/lib/mandos
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
39
##
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
40
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
41
## These settings are for a package-type install
96 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR, MANDIR): Use $(DESTDIR).
42
PREFIX=$(DESTDIR)/usr
43
CONFDIR=$(DESTDIR)/etc/mandos
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
44
KEYDIR=$(DESTDIR)/etc/keys/mandos
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
45
MANDIR=$(PREFIX)/share/man
46
INITRAMFSTOOLS=$(DESTDIR)/usr/share/initramfs-tools
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
47
STATEDIR=$(DESTDIR)/var/lib/mandos
177 by Teddy Hogeborn
* Makefile (CONFDIR): Changed to be the same ("/etc/mandos") in both a
48
##
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
49
638 by Teddy Hogeborn
Add systemd service support for Mandos server.
50
SYSTEMD=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir)
51
345 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS): Use "pkg-config" instead of
52
GNUTLS_CFLAGS=$(shell pkg-config --cflags-only-I gnutls)
53
GNUTLS_LIBS=$(shell pkg-config --libs gnutls)
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
54
AVAHI_CFLAGS=$(shell pkg-config --cflags-only-I avahi-core)
55
AVAHI_LIBS=$(shell pkg-config --libs avahi-core)
317 by Teddy Hogeborn
Use "getconf" to get correct LFS compile and link flags.
56
GPGME_CFLAGS=$(shell gpgme-config --cflags; getconf LFS_CFLAGS)
57
GPGME_LIBS=$(shell gpgme-config --libs; getconf LFS_LIBS; \
58
	getconf LFS_LDFLAGS)
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
59
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
60
# Do not change these two
626 by Teddy Hogeborn
* Makefile (CFLAGS, LDFLAGS): Keep default flags from environment.
61
CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
62
	$(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS) \
63
	-DVERSION='"$(version)"'
626 by Teddy Hogeborn
* Makefile (CFLAGS, LDFLAGS): Keep default flags from environment.
64
LDFLAGS+=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
65
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
66
# Commands to format a DocBook <refentry> document into a manual page
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
67
DOCBOOKTOMAN=$(strip cd $(dir $<); xsltproc --nonet --xinclude \
62 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Do not generate AUTHORS section.
68
	--param man.charmap.use.subset		0 \
69
	--param make.year.ranges		1 \
70
	--param make.single.year.ranges		1 \
71
	--param man.output.quietly		1 \
84 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Use the local manpages/docbook.xsl file, do
72
	--param man.authors.section.enabled	0 \
595 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Don't show errors from "locale".
73
	/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \
91 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Include all DocBook-to-manpage-related
74
	$(notdir $<); \
505.1.14 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Also check manual pages for warnings.
75
	$(MANPOST) $(notdir $@);\
595 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Don't show errors from "locale".
76
	if locale --all 2>/dev/null | grep --regexp='^en_US\.utf8$$' \
77
	&& type man 2>/dev/null; then LANG=en_US.UTF-8 MANWIDTH=80 \
78
	man --warnings --encoding=UTF-8 --local-file $(notdir $@); \
79
	fi >/dev/null)
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
80
# DocBook-to-man post-processing to fix a '\n' escape bug
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
81
MANPOST=$(SED) --in-place --expression='s,\\\\en,\\en,g;s,\\n,\\en,g'
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
82
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
83
DOCBOOKTOHTML=$(strip xsltproc --nonet --xinclude \
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
84
	--param make.year.ranges		1 \
85
	--param make.single.year.ranges		1 \
86
	--param man.output.quietly		1 \
87
	--param man.authors.section.enabled	0 \
88
	--param citerefentry.link		1 \
89
	--output $@ \
90
	/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
91
	$<; $(HTMLPOST) $@)
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
92
# Fix citerefentry links
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
93
HTMLPOST=$(SED) --in-place \
94
	--expression='s/\(<a class="citerefentry" href="\)\("><span class="citerefentry"><span class="refentrytitle">\)\([^<]*\)\(<\/span>(\)\([^)]*\)\()<\/span><\/a>\)/\1\3.\5\2\3\4\5\6/g'
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
95
205 by Teddy Hogeborn
* Makefile (PLUGINS, uninstall-client,
96
PLUGINS=plugins.d/password-prompt plugins.d/mandos-client \
425 by Teddy Hogeborn
* Makefile: Compile and install new "plymouth" plugin.
97
	plugins.d/usplash plugins.d/splashy plugins.d/askpass-fifo \
98
	plugins.d/plymouth
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
99
CPROGS=plugin-runner $(PLUGINS)
430 by teddy at bsnet
* mandos-monitor.xml: New.
100
PROGS=mandos mandos-keygen mandos-ctl mandos-monitor $(CPROGS)
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
101
DOCS=mandos.8 mandos-keygen.8 mandos-monitor.8 mandos-ctl.8 \
102
	mandos.conf.5 mandos-clients.conf.5 plugin-runner.8mandos \
171 by Teddy Hogeborn
Renamed "password-request" to "mandos-client".
103
	plugins.d/mandos-client.8mandos \
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
104
	plugins.d/password-prompt.8mandos plugins.d/usplash.8mandos \
105
	plugins.d/splashy.8mandos plugins.d/askpass-fifo.8mandos \
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
106
	plugins.d/plymouth.8mandos intro.8mandos
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
107
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
108
htmldocs=$(addsuffix .xhtml,$(DOCS))
109
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
110
objects=$(addsuffix .o,$(CPROGS))
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
111
233 by Teddy Hogeborn
* Makefile (all): Also depend on "mandos.lsm".
112
all: $(PROGS) mandos.lsm
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
113
114
doc: $(DOCS)
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
115
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
116
html: $(htmldocs)
117
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
118
%.5: %.xml common.ent legalnotice.xml
119
	$(DOCBOOKTOMAN)
120
%.5.xhtml: %.xml common.ent legalnotice.xml
121
	$(DOCBOOKTOHTML)
122
123
%.8: %.xml common.ent legalnotice.xml
124
	$(DOCBOOKTOMAN)
125
%.8.xhtml: %.xml common.ent legalnotice.xml
126
	$(DOCBOOKTOHTML)
127
128
%.8mandos: %.xml common.ent legalnotice.xml
129
	$(DOCBOOKTOMAN)
130
%.8mandos.xhtml: %.xml common.ent legalnotice.xml
131
	$(DOCBOOKTOHTML)
132
493 by Teddy Hogeborn
* Makefile (DOCS): Added "intro.8mandos".
133
intro.8mandos: intro.xml common.ent legalnotice.xml
134
	$(DOCBOOKTOMAN)
135
intro.8mandos.xhtml: intro.xml common.ent legalnotice.xml
136
	$(DOCBOOKTOHTML)
137
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
138
mandos.8: mandos.xml common.ent mandos-options.xml overview.xml \
139
		legalnotice.xml
140
	$(DOCBOOKTOMAN)
141
mandos.8.xhtml: mandos.xml common.ent mandos-options.xml \
142
		overview.xml legalnotice.xml
143
	$(DOCBOOKTOHTML)
144
145
mandos-keygen.8: mandos-keygen.xml common.ent overview.xml \
146
		legalnotice.xml
147
	$(DOCBOOKTOMAN)
148
mandos-keygen.8.xhtml: mandos-keygen.xml common.ent overview.xml \
149
		 legalnotice.xml
150
	$(DOCBOOKTOHTML)
151
430 by teddy at bsnet
* mandos-monitor.xml: New.
152
mandos-monitor.8: mandos-monitor.xml common.ent overview.xml \
153
		legalnotice.xml
154
	$(DOCBOOKTOMAN)
155
mandos-monitor.8.xhtml: mandos-monitor.xml common.ent overview.xml \
156
		 legalnotice.xml
157
	$(DOCBOOKTOHTML)
158
434 by teddy at bsnet
* mandos-ctl.xml: New.
159
mandos-ctl.8: mandos-ctl.xml common.ent overview.xml \
160
		legalnotice.xml
161
	$(DOCBOOKTOMAN)
162
mandos-ctl.8.xhtml: mandos-ctl.xml common.ent overview.xml \
163
		 legalnotice.xml
164
	$(DOCBOOKTOHTML)
165
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
166
mandos.conf.5: mandos.conf.xml common.ent mandos-options.xml \
167
		legalnotice.xml
168
	$(DOCBOOKTOMAN)
169
mandos.conf.5.xhtml: mandos.conf.xml common.ent mandos-options.xml \
170
		legalnotice.xml
171
	$(DOCBOOKTOHTML)
172
173
plugin-runner.8mandos: plugin-runner.xml common.ent overview.xml \
174
		legalnotice.xml
175
	$(DOCBOOKTOMAN)
176
plugin-runner.8mandos.xhtml: plugin-runner.xml common.ent \
177
		overview.xml legalnotice.xml
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
178
	$(DOCBOOKTOHTML)
143 by Teddy Hogeborn
* Makefile (mandos.8): Add dependency on "overview.xml" and
179
171 by Teddy Hogeborn
Renamed "password-request" to "mandos-client".
180
plugins.d/mandos-client.8mandos: plugins.d/mandos-client.xml \
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
181
					common.ent \
143 by Teddy Hogeborn
* Makefile (mandos.8): Add dependency on "overview.xml" and
182
					mandos-options.xml \
183
					overview.xml legalnotice.xml
91 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Include all DocBook-to-manpage-related
184
	$(DOCBOOKTOMAN)
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
185
plugins.d/mandos-client.8mandos.xhtml: plugins.d/mandos-client.xml \
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
186
					common.ent \
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
187
					mandos-options.xml \
188
					overview.xml legalnotice.xml
189
	$(DOCBOOKTOHTML)
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
190
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
191
# Update all these files with version number $(version)
192
common.ent: Makefile
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
193
	$(strip $(SED) --in-place \
318 by Teddy Hogeborn
* Makefile (common.ent): Update "version" entity correctly.
194
		--expression='s/^\(<!ENTITY version "\)[^"]*">$$/\1$(version)">/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
195
		$@)
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
196
197
mandos: Makefile
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
198
	$(strip $(SED) --in-place \
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
199
		--expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
200
		$@)
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
201
202
mandos-keygen: Makefile
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
203
	$(strip $(SED) --in-place \
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
204
		--expression='s/^\(VERSION="\)[^"]*"$$/\1$(version)"/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
205
		$@)
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
206
24.1.121 by Björn Påhlsson
mandos-ctl: Added support for all client calls
207
mandos-ctl: Makefile
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
208
	$(strip $(SED) --in-place \
240 by Teddy Hogeborn
Merge "mandos-list" from belorn.
209
		--expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
210
		$@)
240 by Teddy Hogeborn
Merge "mandos-list" from belorn.
211
430 by teddy at bsnet
* mandos-monitor.xml: New.
212
mandos-monitor: Makefile
213
	$(strip $(SED) --in-place \
214
		--expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' \
215
		$@)
216
233 by Teddy Hogeborn
* Makefile (all): Also depend on "mandos.lsm".
217
mandos.lsm: Makefile
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
218
	$(strip $(SED) --in-place \
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
219
		--expression='s/^\(Version:\).*/\1\t$(version)/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
220
		$@)
221
	$(strip $(SED) --in-place \
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
222
		--expression='s/^\(Entered-date:\).*/\1\t$(shell date --rfc-3339=date --reference=Makefile)/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
223
		$@)
224
	$(strip $(SED) --in-place \
255 by Teddy Hogeborn
* Makefile (mandos.lsm): Also update file name using version number.
225
		--expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
226
		$@)
233 by Teddy Hogeborn
* Makefile (all): Also depend on "mandos.lsm".
227
398 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN, DOCBOOKTOHTML, common.ent, mandos,
228
plugins.d/mandos-client: plugins.d/mandos-client.c
485 by Teddy Hogeborn
Merge from Björn.
229
	$(LINK.c) $^ -lrt $(GNUTLS_LIBS) $(AVAHI_LIBS) $(strip\
484 by Teddy Hogeborn
* Makefile (plugins.d/mandos-client): Bug fix: Put $^ before all
230
		) $(GPGME_LIBS) $(LOADLIBES) $(LDLIBS) -o $@
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
231
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
232
.PHONY : all doc html clean distclean run-client run-server install \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
233
	install-server install-client uninstall uninstall-server \
234
	uninstall-client purge purge-server purge-client
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
235
1 by Björn Påhlsson
First working version with: IPv6, GnuTLS, X.509 certificates, DN
236
clean:
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
237
	-rm --force $(CPROGS) $(objects) $(htmldocs) $(DOCS) core
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
238
239
distclean: clean
240
mostlyclean: clean
241
maintainer-clean: clean
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
242
	-rm --force --recursive keydir confdir statedir
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
243
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
244
check:	all
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
245
	./mandos --check
608 by Teddy Hogeborn
* Makefile (check): Also check mandos-ctl.
246
	./mandos-ctl --check
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
247
141 by Teddy Hogeborn
* Makefile (run-client): Add "--config-file=plugin-runner.conf".
248
# Run the client with a local config and key
159 by Teddy Hogeborn
* Makefile (run-client): Do not depend on the key ring files.
249
run-client: all keydir/seckey.txt keydir/pubkey.txt
237.3.1 by teddy at bsnet
* Makefile (run-server, run-client): Add notices about harmless error
250
	@echo "###################################################################"
251
	@echo "# The following error messages are harmless and can be safely     #"
252
	@echo "# ignored.  The messages are caused by not running as root, but   #"
253
	@echo "# you should NOT run \"make run-client\" as root unless you also    #"
254
	@echo "# unpacked and compiled Mandos as root, which is NOT recommended. #"
255
	@echo "# From plugin-runner: setuid: Operation not permitted             #"
256
	@echo "# From askpass-fifo:  mkfifo: Permission denied                   #"
257
	@echo "# From mandos-client: setuid: Operation not permitted             #"
258
	@echo "#                     seteuid: Operation not permitted            #"
259
	@echo "#                     klogctl: Operation not permitted            #"
260
	@echo "###################################################################"
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
261
	./plugin-runner --plugin-dir=plugins.d \
141 by Teddy Hogeborn
* Makefile (run-client): Add "--config-file=plugin-runner.conf".
262
		--config-file=plugin-runner.conf \
505.3.11 by Teddy Hogeborn
* Makefile (run-client): Add "--network-hook-dir" option.
263
		--options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt,--network-hook-dir=network-hooks.d \
260 by Teddy Hogeborn
* Makefile (run-client): Pass $(CLIENTARGS) to plugin-runner.
264
		$(CLIENTARGS)
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
265
104 by Teddy Hogeborn
* Makefile (maintainer-clean): Also remove "confdir".
266
# Used by run-client
267
keydir/seckey.txt keydir/pubkey.txt: mandos-keygen
268
	install --directory keydir
269
	./mandos-keygen --dir keydir --force
270
271
# Run the server with a local config
574 by Teddy Hogeborn
* mandos: White space and other misc. format fixes only.
272
run-server: confdir/mandos.conf confdir/clients.conf statedir
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
273
	./mandos --debug --no-dbus --configdir=confdir \
274
		--statedir=statedir $(SERVERARGS)
104 by Teddy Hogeborn
* Makefile (maintainer-clean): Also remove "confdir".
275
276
# Used by run-server
277
confdir/mandos.conf: mandos.conf
278
	install --directory confdir
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
279
	install --mode=u=rw,go=r $^ $@
104 by Teddy Hogeborn
* Makefile (maintainer-clean): Also remove "confdir".
280
confdir/clients.conf: clients.conf keydir/seckey.txt
281
	install --directory confdir
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
282
	install --mode=u=rw $< $@
104 by Teddy Hogeborn
* Makefile (maintainer-clean): Also remove "confdir".
283
# Add a client password
284
	./mandos-keygen --dir keydir --password >> $@
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
285
statedir:
286
	install --directory statedir
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
287
182 by Teddy Hogeborn
* Makefile (install): Use "install-client-nokey".
288
install: install-server install-client-nokey
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
289
235 by Teddy Hogeborn
* INSTALL: Fixed typo.
290
install-html: html
217 by Teddy Hogeborn
* .bzrignore: Added "man" directory (created by "make install-html").
291
	install --directory $(htmldir)
292
	install --mode=u=rw,go=r --target-directory=$(htmldir) \
293
		$(htmldocs)
216 by Teddy Hogeborn
* Makefile: Add HTML rules for manual pages.
294
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
295
install-server: doc
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
296
	install --directory $(CONFDIR)
518.2.2 by Teddy Hogeborn
Directory with persistent state can now be changed with the "statedir"
297
	install --directory --mode=u=rwx --owner=$(USER) \
298
		--group=$(GROUP) $(STATEDIR)
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
299
	install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
430 by teddy at bsnet
* mandos-monitor.xml: New.
300
	install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
301
		mandos-ctl
302
	install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
303
		mandos-monitor
162 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): New variables.
304
	install --mode=u=rw,go=r --target-directory=$(CONFDIR) \
305
		mandos.conf
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
306
	install --mode=u=rw --target-directory=$(CONFDIR) \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
307
		clients.conf
420.1.1 by teddy at bsnet
* Makefile (install-server): Install dbus-mandos.conf as
308
	install --mode=u=rw,go=r dbus-mandos.conf \
309
		$(DESTDIR)/etc/dbus-1/system.d/mandos.conf
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
310
	install --mode=u=rwx,go=rx init.d-mandos \
311
		$(DESTDIR)/etc/init.d/mandos
638 by Teddy Hogeborn
Add systemd service support for Mandos server.
312
	if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
313
		install --mode=u=rw,go=r mandos.service $(SYSTEMD) \
314
	fi
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
315
	install --mode=u=rw,go=r default-mandos \
316
		$(DESTDIR)/etc/default/mandos
200 by Teddy Hogeborn
* Makefile: Put the init script before avahi-daemon.
317
	if [ -z $(DESTDIR) ]; then \
318
		update-rc.d mandos defaults 25 15;\
319
	fi
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
320
	gzip --best --to-stdout mandos.8 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
321
		> $(MANDIR)/man8/mandos.8.gz
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
322
	gzip --best --to-stdout mandos-monitor.8 \
323
		> $(MANDIR)/man8/mandos-monitor.8.gz
324
	gzip --best --to-stdout mandos-ctl.8 \
325
		> $(MANDIR)/man8/mandos-ctl.8.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
326
	gzip --best --to-stdout mandos.conf.5 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
327
		> $(MANDIR)/man5/mandos.conf.5.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
328
	gzip --best --to-stdout mandos-clients.conf.5 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
329
		> $(MANDIR)/man5/mandos-clients.conf.5.gz
549 by teddy at recompile
* Makefile (install-server): Add intro(8mandos) man page.
330
	gzip --best --to-stdout intro.8mandos \
331
		> $(MANDIR)/man8/intro.8mandos.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
332
182 by Teddy Hogeborn
* Makefile (install): Use "install-client-nokey".
333
install-client-nokey: all doc
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
334
	install --directory $(PREFIX)/lib/mandos $(CONFDIR)
335
	install --directory --mode=u=rwx $(KEYDIR) \
162 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): New variables.
336
		$(PREFIX)/lib/mandos/plugins.d
170 by Teddy Hogeborn
* Makefile (install-client): Add "/etc/plugins.d/README".
337
	if [ "$(CONFDIR)" != "$(PREFIX)/lib/mandos" ]; then \
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
338
		install --mode=u=rwx \
199 by Teddy Hogeborn
* Makefile: Bug fix: fix syntax error.
339
			--directory "$(CONFDIR)/plugins.d"; \
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
340
	fi
505.3.17 by Teddy Hogeborn
* Makefile (install-client-nokey): Create network hook directory.
341
	install --mode=u=rwx,go=rx --directory \
342
		"$(CONFDIR)/network-hooks.d"
162 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): New variables.
343
	install --mode=u=rwx,go=rx \
344
		--target-directory=$(PREFIX)/lib/mandos plugin-runner
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
345
	install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
346
		mandos-keygen
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
347
	install --mode=u=rwx,go=rx \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
348
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
349
		plugins.d/password-prompt
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
350
	install --mode=u=rwxs,go=rx \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
351
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
171 by Teddy Hogeborn
Renamed "password-request" to "mandos-client".
352
		plugins.d/mandos-client
208 by Teddy Hogeborn
* Makefile (PLUGINS): Added "plugins.d/usplash".
353
	install --mode=u=rwxs,go=rx \
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
354
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
355
		plugins.d/usplash
205 by Teddy Hogeborn
* Makefile (PLUGINS, uninstall-client,
356
	install --mode=u=rwxs,go=rx \
357
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
358
		plugins.d/splashy
214 by Teddy Hogeborn
* Makefile (PLUGINS): Added "plugins.d/askpass-fifo".
359
	install --mode=u=rwxs,go=rx \
360
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
361
		plugins.d/askpass-fifo
425 by Teddy Hogeborn
* Makefile: Compile and install new "plymouth" plugin.
362
	install --mode=u=rwxs,go=rx \
363
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
364
		plugins.d/plymouth
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
365
	install initramfs-tools-hook \
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
366
		$(INITRAMFSTOOLS)/hooks/mandos
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
367
	install --mode=u=rw,go=r initramfs-tools-hook-conf \
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
368
		$(INITRAMFSTOOLS)/conf-hooks.d/mandos
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
369
	install initramfs-tools-script \
302 by Teddy Hogeborn
* Makefile (install-client-nokey): Move "initramfs-tools-script" from
370
		$(INITRAMFSTOOLS)/scripts/init-premount/mandos
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
371
	install --mode=u=rw,go=r plugin-runner.conf $(CONFDIR)
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
372
	gzip --best --to-stdout mandos-keygen.8 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
373
		> $(MANDIR)/man8/mandos-keygen.8.gz
374
	gzip --best --to-stdout plugin-runner.8mandos \
375
		> $(MANDIR)/man8/plugin-runner.8mandos.gz
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
376
	gzip --best --to-stdout plugins.d/mandos-client.8mandos \
377
		> $(MANDIR)/man8/mandos-client.8mandos.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
378
	gzip --best --to-stdout plugins.d/password-prompt.8mandos \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
379
		> $(MANDIR)/man8/password-prompt.8mandos.gz
225 by Teddy Hogeborn
* Makefile (DOCS): Added "plugins.d/usplash.8mandos" and
380
	gzip --best --to-stdout plugins.d/usplash.8mandos \
381
		> $(MANDIR)/man8/usplash.8mandos.gz
382
	gzip --best --to-stdout plugins.d/splashy.8mandos \
383
		> $(MANDIR)/man8/splashy.8mandos.gz
226 by Teddy Hogeborn
* Makefile (DOCS): Added "plugins.d/askpass-fifo.8mandos".
384
	gzip --best --to-stdout plugins.d/askpass-fifo.8mandos \
385
		> $(MANDIR)/man8/askpass-fifo.8mandos.gz
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
386
	gzip --best --to-stdout plugins.d/plymouth.8mandos \
387
		> $(MANDIR)/man8/plymouth.8mandos.gz
182 by Teddy Hogeborn
* Makefile (install): Use "install-client-nokey".
388
389
install-client: install-client-nokey
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
390
# Post-installation stuff
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
391
	-$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
392
	update-initramfs -k all -u
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
393
	echo "Now run mandos-keygen --password --dir $(KEYDIR)"
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
394
395
uninstall: uninstall-server uninstall-client
396
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
397
uninstall-server:
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
398
	-rm --force $(PREFIX)/sbin/mandos \
430 by teddy at bsnet
* mandos-monitor.xml: New.
399
		$(PREFIX)/sbin/mandos-ctl \
400
		$(PREFIX)/sbin/mandos-monitor \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
401
		$(MANDIR)/man8/mandos.8.gz \
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
402
		$(MANDIR)/man8/mandos-monitor.8.gz \
403
		$(MANDIR)/man8/mandos-ctl.8.gz \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
404
		$(MANDIR)/man5/mandos.conf.5.gz \
405
		$(MANDIR)/man5/mandos-clients.conf.5.gz
162 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): New variables.
406
	update-rc.d -f mandos remove
163 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): Removed.
407
	-rmdir $(CONFDIR)
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
408
409
uninstall-client:
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
410
# Refuse to uninstall client if /etc/crypttab is explicitly configured
411
# to use it.
412
	! grep --regexp='^ *[^ #].*keyscript=[^,=]*/mandos/' \
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
413
		$(DESTDIR)/etc/crypttab
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
414
	-rm --force $(PREFIX)/sbin/mandos-keygen \
415
		$(PREFIX)/lib/mandos/plugin-runner \
416
		$(PREFIX)/lib/mandos/plugins.d/password-prompt \
171 by Teddy Hogeborn
Renamed "password-request" to "mandos-client".
417
		$(PREFIX)/lib/mandos/plugins.d/mandos-client \
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
418
		$(PREFIX)/lib/mandos/plugins.d/usplash \
205 by Teddy Hogeborn
* Makefile (PLUGINS, uninstall-client,
419
		$(PREFIX)/lib/mandos/plugins.d/splashy \
226 by Teddy Hogeborn
* Makefile (DOCS): Added "plugins.d/askpass-fifo.8mandos".
420
		$(PREFIX)/lib/mandos/plugins.d/askpass-fifo \
425 by Teddy Hogeborn
* Makefile: Compile and install new "plymouth" plugin.
421
		$(PREFIX)/lib/mandos/plugins.d/plymouth \
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
422
		$(INITRAMFSTOOLS)/hooks/mandos \
423
		$(INITRAMFSTOOLS)/conf-hooks.d/mandos \
302 by Teddy Hogeborn
* Makefile (install-client-nokey): Move "initramfs-tools-script" from
424
		$(INITRAMFSTOOLS)/scripts/init-premount/mandos \
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
425
		$(MANDIR)/man8/mandos-keygen.8.gz \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
426
		$(MANDIR)/man8/plugin-runner.8mandos.gz \
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
427
		$(MANDIR)/man8/mandos-client.8mandos.gz
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
428
		$(MANDIR)/man8/password-prompt.8mandos.gz \
225 by Teddy Hogeborn
* Makefile (DOCS): Added "plugins.d/usplash.8mandos" and
429
		$(MANDIR)/man8/usplash.8mandos.gz \
430
		$(MANDIR)/man8/splashy.8mandos.gz \
226 by Teddy Hogeborn
* Makefile (DOCS): Added "plugins.d/askpass-fifo.8mandos".
431
		$(MANDIR)/man8/askpass-fifo.8mandos.gz \
435 by teddy at bsnet
* Makefile (DOCS): Added "plymouth.8mandos".
432
		$(MANDIR)/man8/plymouth.8mandos.gz \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
433
	-rmdir $(PREFIX)/lib/mandos/plugins.d $(CONFDIR)/plugins.d \
166 by Teddy Hogeborn
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
434
		 $(PREFIX)/lib/mandos $(CONFDIR) $(KEYDIR)
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
435
	update-initramfs -k all -u
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
436
437
purge: purge-server purge-client
438
439
purge-server: uninstall-server
162 by Teddy Hogeborn
* Makefile (PIDDIR, USER, GROUP): New variables.
440
	-rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
420.1.1 by teddy at bsnet
* Makefile (install-server): Install dbus-mandos.conf as
441
		$(DESTDIR)/etc/dbus-1/system.d/mandos.conf
175 by Teddy Hogeborn
* Makefile: Clearly separate "local" install variable settings from
442
		$(DESTDIR)/etc/default/mandos \
443
		$(DESTDIR)/etc/init.d/mandos \
638 by Teddy Hogeborn
Add systemd service support for Mandos server.
444
		$(SYSTEMD)/mandos.service \
637 by Teddy Hogeborn
Fix fallback to /var/run if /run does not exist for Makefile.
445
		$(DESTDIR)/run/mandos.pid \
446
		$(DESTDIR)/var/run/mandos.pid
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
447
	-rmdir $(CONFDIR)
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
448
449
purge-client: uninstall-client
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
450
	-shred --remove $(KEYDIR)/seckey.txt
161 by Teddy Hogeborn
* Makefile (purge-client): Also remove "plugin-runner.conf".
451
	-rm --force $(CONFDIR)/plugin-runner.conf \
452
		$(KEYDIR)/pubkey.txt $(KEYDIR)/seckey.txt
160 by Teddy Hogeborn
* Makefile: Changed to use symbolic instead of octal modes throughout.
453
	-rmdir $(KEYDIR) $(CONFDIR)/plugins.d $(CONFDIR)