/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2013-10-20 23:27:38 UTC
  • Revision ID: teddy@recompile.se-20131020232738-5gjw6auqqxnp4v7t
* mandos (PGPEngine.password_encode): Bug fix: GnuPG can't handle
                                      really long passphrases - encode
                                      those differently.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
OPTIMIZE=-Os
24
24
LANGUAGE=-std=gnu99
25
25
htmldir=man
26
 
version=1.4.1
 
26
version=1.6.1
27
27
SED=sed
28
28
 
 
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
 
29
32
## Use these settings for a traditional /usr/local install
30
33
# PREFIX=$(DESTDIR)/usr/local
31
34
# CONFDIR=$(DESTDIR)/etc/mandos
32
35
# KEYDIR=$(DESTDIR)/etc/mandos/keys
33
36
# MANDIR=$(PREFIX)/man
34
37
# INITRAMFSTOOLS=$(DESTDIR)/etc/initramfs-tools
 
38
# STATEDIR=$(DESTDIR)/var/lib/mandos
35
39
##
36
40
 
37
41
## These settings are for a package-type install
40
44
KEYDIR=$(DESTDIR)/etc/keys/mandos
41
45
MANDIR=$(PREFIX)/share/man
42
46
INITRAMFSTOOLS=$(DESTDIR)/usr/share/initramfs-tools
 
47
STATEDIR=$(DESTDIR)/var/lib/mandos
43
48
##
44
49
 
45
50
GNUTLS_CFLAGS=$(shell pkg-config --cflags-only-I gnutls)
51
56
        getconf LFS_LDFLAGS)
52
57
 
53
58
# Do not change these two
54
 
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
 
59
CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
55
60
        $(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS) \
56
61
        -DVERSION='"$(version)"'
57
 
LDFLAGS=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
 
62
LDFLAGS+=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
58
63
 
59
64
# Commands to format a DocBook <refentry> document into a manual page
60
65
DOCBOOKTOMAN=$(strip cd $(dir $<); xsltproc --nonet --xinclude \
63
68
        --param make.single.year.ranges         1 \
64
69
        --param man.output.quietly              1 \
65
70
        --param man.authors.section.enabled     0 \
66
 
         /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \
 
71
        /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \
67
72
        $(notdir $<); \
68
73
        $(MANPOST) $(notdir $@);\
69
 
        LANG=en_US.UTF-8 MANWIDTH=80 man --warnings --encoding=UTF-8 \
70
 
        --local-file $(notdir $@) >/dev/null)
 
74
        if locale --all 2>/dev/null | grep --regexp='^en_US\.utf8$$' \
 
75
        && type man 2>/dev/null; then LANG=en_US.UTF-8 MANWIDTH=80 \
 
76
        man --warnings --encoding=UTF-8 --local-file $(notdir $@); \
 
77
        fi >/dev/null)
71
78
# DocBook-to-man post-processing to fix a '\n' escape bug
72
79
MANPOST=$(SED) --in-place --expression='s,\\\\en,\\en,g;s,\\n,\\en,g'
73
80
 
230
237
distclean: clean
231
238
mostlyclean: clean
232
239
maintainer-clean: clean
233
 
        -rm --force --recursive keydir confdir
 
240
        -rm --force --recursive keydir confdir statedir
234
241
 
235
242
check:  all
236
243
        ./mandos --check
 
244
        ./mandos-ctl --check
237
245
 
238
246
# Run the client with a local config and key
239
247
run-client: all keydir/seckey.txt keydir/pubkey.txt
250
258
        @echo "###################################################################"
251
259
        ./plugin-runner --plugin-dir=plugins.d \
252
260
                --config-file=plugin-runner.conf \
253
 
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt \
 
261
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt,--network-hook-dir=network-hooks.d \
254
262
                $(CLIENTARGS)
255
263
 
256
264
# Used by run-client
259
267
        ./mandos-keygen --dir keydir --force
260
268
 
261
269
# Run the server with a local config
262
 
run-server: confdir/mandos.conf confdir/clients.conf
263
 
        ./mandos --debug --no-dbus --configdir=confdir --no-restore \
264
 
        $(SERVERARGS)
 
270
run-server: confdir/mandos.conf confdir/clients.conf statedir
 
271
        ./mandos --debug --no-dbus --configdir=confdir \
 
272
                --statedir=statedir $(SERVERARGS)
265
273
 
266
274
# Used by run-server
267
275
confdir/mandos.conf: mandos.conf
272
280
        install --mode=u=rw $< $@
273
281
# Add a client password
274
282
        ./mandos-keygen --dir keydir --password >> $@
 
283
statedir:
 
284
        install --directory statedir
275
285
 
276
286
install: install-server install-client-nokey
277
287
 
282
292
 
283
293
install-server: doc
284
294
        install --directory $(CONFDIR)
 
295
        install --directory --mode=u=rwx --owner=$(USER) \
 
296
                --group=$(GROUP) $(STATEDIR)
285
297
        install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
286
298
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
287
299
                mandos-ctl
310
322
                > $(MANDIR)/man5/mandos.conf.5.gz
311
323
        gzip --best --to-stdout mandos-clients.conf.5 \
312
324
                > $(MANDIR)/man5/mandos-clients.conf.5.gz
 
325
        gzip --best --to-stdout intro.8mandos \
 
326
                > $(MANDIR)/man8/intro.8mandos.gz
313
327
 
314
328
install-client-nokey: all doc
315
329
        install --directory $(PREFIX)/lib/mandos $(CONFDIR)
319
333
                install --mode=u=rwx \
320
334
                        --directory "$(CONFDIR)/plugins.d"; \
321
335
        fi
 
336
        install --mode=u=rwx,go=rx --directory \
 
337
                "$(CONFDIR)/network-hooks.d"
322
338
        install --mode=u=rwx,go=rx \
323
339
                --target-directory=$(PREFIX)/lib/mandos plugin-runner
324
340
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
325
341
                mandos-keygen
 
342
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
 
343
                mandos-change-keytype
326
344
        install --mode=u=rwx,go=rx \
327
345
                --target-directory=$(PREFIX)/lib/mandos/plugins.d \
328
346
                plugins.d/password-prompt
391
409
        ! grep --regexp='^ *[^ #].*keyscript=[^,=]*/mandos/' \
392
410
                $(DESTDIR)/etc/crypttab
393
411
        -rm --force $(PREFIX)/sbin/mandos-keygen \
 
412
                $(PREFIX)/sbin/mandos-change-keytype \
394
413
                $(PREFIX)/lib/mandos/plugin-runner \
395
414
                $(PREFIX)/lib/mandos/plugins.d/password-prompt \
396
415
                $(PREFIX)/lib/mandos/plugins.d/mandos-client \
420
439
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
421
440
                $(DESTDIR)/etc/default/mandos \
422
441
                $(DESTDIR)/etc/init.d/mandos \
423
 
                $(DESTDIR)/var/run/mandos.pid
 
442
                $(DESTDIR)/run/mandos.pid
424
443
        -rmdir $(CONFDIR)
425
444
 
426
445
purge-client: uninstall-client