/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-27 17:42:23 UTC
  • Revision ID: teddy@recompile.se-20131027174223-mq3a1h8xi5jcv9e6
Bug fix: Make sure systemd service file is installed.

* Makefile (install-server): Fix typo causing syntax error.
* debian/mandos.dirs (lib/systemd/system): New.

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.2
27
27
SED=sed
28
28
 
29
29
USER=$(firstword $(subst :, ,$(shell getent passwd _mandos || getent passwd nobody || echo 65534)))
47
47
STATEDIR=$(DESTDIR)/var/lib/mandos
48
48
##
49
49
 
 
50
SYSTEMD=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir)
 
51
 
50
52
GNUTLS_CFLAGS=$(shell pkg-config --cflags-only-I gnutls)
51
53
GNUTLS_LIBS=$(shell pkg-config --libs gnutls)
52
54
AVAHI_CFLAGS=$(shell pkg-config --cflags-only-I avahi-core)
56
58
        getconf LFS_LDFLAGS)
57
59
 
58
60
# Do not change these two
59
 
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
 
61
CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
60
62
        $(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS) \
61
63
        -DVERSION='"$(version)"'
62
 
LDFLAGS=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
 
64
LDFLAGS+=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
63
65
 
64
66
# Commands to format a DocBook <refentry> document into a manual page
65
67
DOCBOOKTOMAN=$(strip cd $(dir $<); xsltproc --nonet --xinclude \
68
70
        --param make.single.year.ranges         1 \
69
71
        --param man.output.quietly              1 \
70
72
        --param man.authors.section.enabled     0 \
71
 
         /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \
 
73
        /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \
72
74
        $(notdir $<); \
73
75
        $(MANPOST) $(notdir $@);\
74
 
        LANG=en_US.UTF-8 MANWIDTH=80 man --warnings --encoding=UTF-8 \
75
 
        --local-file $(notdir $@) >/dev/null)
 
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)
76
80
# DocBook-to-man post-processing to fix a '\n' escape bug
77
81
MANPOST=$(SED) --in-place --expression='s,\\\\en,\\en,g;s,\\n,\\en,g'
78
82
 
239
243
 
240
244
check:  all
241
245
        ./mandos --check
 
246
        ./mandos-ctl --check
242
247
 
243
248
# Run the client with a local config and key
244
249
run-client: all keydir/seckey.txt keydir/pubkey.txt
255
260
        @echo "###################################################################"
256
261
        ./plugin-runner --plugin-dir=plugins.d \
257
262
                --config-file=plugin-runner.conf \
258
 
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt \
 
263
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt,--network-hook-dir=network-hooks.d \
259
264
                $(CLIENTARGS)
260
265
 
261
266
# Used by run-client
264
269
        ./mandos-keygen --dir keydir --force
265
270
 
266
271
# Run the server with a local config
267
 
run-server: confdir/mandos.conf confdir/clients.conf
 
272
run-server: confdir/mandos.conf confdir/clients.conf statedir
268
273
        ./mandos --debug --no-dbus --configdir=confdir \
269
274
                --statedir=statedir $(SERVERARGS)
270
275
 
304
309
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
305
310
        install --mode=u=rwx,go=rx init.d-mandos \
306
311
                $(DESTDIR)/etc/init.d/mandos
 
312
        if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
 
313
                install --mode=u=rw,go=r mandos.service $(SYSTEMD); \
 
314
        fi
307
315
        install --mode=u=rw,go=r default-mandos \
308
316
                $(DESTDIR)/etc/default/mandos
309
317
        if [ -z $(DESTDIR) ]; then \
319
327
                > $(MANDIR)/man5/mandos.conf.5.gz
320
328
        gzip --best --to-stdout mandos-clients.conf.5 \
321
329
                > $(MANDIR)/man5/mandos-clients.conf.5.gz
 
330
        gzip --best --to-stdout intro.8mandos \
 
331
                > $(MANDIR)/man8/intro.8mandos.gz
322
332
 
323
333
install-client-nokey: all doc
324
334
        install --directory $(PREFIX)/lib/mandos $(CONFDIR)
328
338
                install --mode=u=rwx \
329
339
                        --directory "$(CONFDIR)/plugins.d"; \
330
340
        fi
 
341
        install --mode=u=rwx,go=rx --directory \
 
342
                "$(CONFDIR)/network-hooks.d"
331
343
        install --mode=u=rwx,go=rx \
332
344
                --target-directory=$(PREFIX)/lib/mandos plugin-runner
333
345
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
429
441
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
430
442
                $(DESTDIR)/etc/default/mandos \
431
443
                $(DESTDIR)/etc/init.d/mandos \
 
444
                $(SYSTEMD)/mandos.service \
 
445
                $(DESTDIR)/run/mandos.pid \
432
446
                $(DESTDIR)/var/run/mandos.pid
433
447
        -rmdir $(CONFDIR)
434
448