/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: 2019-08-18 00:42:22 UTC
  • Revision ID: teddy@recompile.se-20190818004222-lfrgtnmqz766a08e
Client: Use the systemd sysusers.d mechanism, if present

* Makefile (install-client-nokey): Also install sysusers.d file, if
                                   $(SYSUSERS) exists.
* sysusers.d-mandos.conf: Adjust comment to match reality.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
# For info about _FORTIFY_SOURCE, see feature_test_macros(7)
31
31
# and <https://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>.
32
 
FORTIFY:=-D_FORTIFY_SOURCE=3 -fstack-protector-all -fPIC
 
32
FORTIFY:=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC
33
33
LINK_FORTIFY_LD:=-z relro -z now
34
34
LINK_FORTIFY:=
35
35
 
43
43
LANGUAGE:=-std=gnu11
44
44
FEATURES:=-D_FILE_OFFSET_BITS=64
45
45
htmldir:=man
46
 
version:=1.8.14
 
46
version:=1.8.7
47
47
SED:=sed
48
48
PKG_CONFIG?=pkg-config
49
49
 
156
156
 
157
157
objects:=$(addsuffix .o,$(CPROGS))
158
158
 
159
 
.PHONY: all
160
159
all: $(PROGS) mandos.lsm
161
160
 
162
 
.PHONY: doc
163
161
doc: $(DOCS)
164
162
 
165
 
.PHONY: html
166
163
html: $(htmldocs)
167
164
 
168
165
%.5: %.xml common.ent legalnotice.xml
285
282
                $@)
286
283
 
287
284
# Need to add the GnuTLS, Avahi and GPGME libraries
288
 
plugins.d/mandos-client: CFLAGS += $(GNUTLS_CFLAGS) $(strip \
289
 
        ) $(AVAHI_CFLAGS) $(GPGME_CFLAGS)
290
 
plugins.d/mandos-client: LDLIBS += $(GNUTLS_LIBS) $(strip \
291
 
        ) $(AVAHI_LIBS) $(GPGME_LIBS)
 
285
plugins.d/mandos-client: plugins.d/mandos-client.c
 
286
        $(LINK.c) $^ $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(strip\
 
287
                ) $(GPGME_CFLAGS) $(GNUTLS_LIBS) $(strip\
 
288
                ) $(AVAHI_LIBS) $(GPGME_LIBS) $(LOADLIBES) $(strip\
 
289
                ) $(LDLIBS) -o $@
292
290
 
293
291
# Need to add the libnl-route library
294
 
plugin-helpers/mandos-client-iprouteadddel: CFLAGS += $(LIBNL3_CFLAGS)
295
 
plugin-helpers/mandos-client-iprouteadddel: LDLIBS += $(LIBNL3_LIBS)
 
292
plugin-helpers/mandos-client-iprouteadddel: plugin-helpers/mandos-client-iprouteadddel.c
 
293
        $(LINK.c) $(LIBNL3_CFLAGS) $^ $(LIBNL3_LIBS) $(strip\
 
294
                ) $(LOADLIBES) $(LDLIBS) -o $@
296
295
 
297
296
# Need to add the GLib and pthread libraries
298
 
dracut-module/password-agent: CFLAGS += $(GLIB_CFLAGS)
299
 
# Note: -lpthread is unnecessary with the GNU C library 2.34 or later
300
 
dracut-module/password-agent: LDLIBS += $(GLIB_LIBS) -lpthread
301
 
 
302
 
.PHONY: clean
 
297
dracut-module/password-agent: dracut-module/password-agent.c
 
298
        $(LINK.c) $(GLIB_CFLAGS) $^ $(GLIB_LIBS) -lpthread $(strip\
 
299
                ) $(LOADLIBES) $(LDLIBS) -o $@
 
300
 
 
301
.PHONY : all doc html clean distclean mostlyclean maintainer-clean \
 
302
        check run-client run-server install install-html \
 
303
        install-server install-client-nokey install-client uninstall \
 
304
        uninstall-server uninstall-client purge purge-server \
 
305
        purge-client
 
306
 
303
307
clean:
304
308
        -rm --force $(CPROGS) $(objects) $(htmldocs) $(DOCS) core
305
309
 
306
 
.PHONY: distclean
307
310
distclean: clean
308
 
.PHONY: mostlyclean
309
311
mostlyclean: clean
310
 
.PHONY: maintainer-clean
311
312
maintainer-clean: clean
312
313
        -rm --force --recursive keydir confdir statedir
313
314
 
314
 
.PHONY: check
315
315
check: all
316
316
        ./mandos --check
317
317
        ./mandos-ctl --check
321
321
        ./dracut-module/password-agent --test
322
322
 
323
323
# Run the client with a local config and key
324
 
.PHONY: run-client
325
324
run-client: all keydir/seckey.txt keydir/pubkey.txt \
326
325
                        keydir/tls-privkey.pem keydir/tls-pubkey.pem
327
326
        @echo '######################################################'
355
354
keydir/seckey.txt keydir/pubkey.txt keydir/tls-privkey.pem keydir/tls-pubkey.pem: mandos-keygen
356
355
        install --directory keydir
357
356
        ./mandos-keygen --dir keydir --force
358
 
        if ! [ -e keydir/tls-privkey.pem ]; then \
359
 
                install --mode=u=rw /dev/null keydir/tls-privkey.pem; \
360
 
        fi
361
 
        if ! [ -e keydir/tls-pubkey.pem ]; then \
362
 
                install --mode=u=rw /dev/null keydir/tls-pubkey.pem; \
363
 
        fi
364
357
 
365
358
# Run the server with a local config
366
 
.PHONY: run-server
367
359
run-server: confdir/mandos.conf confdir/clients.conf statedir
368
360
        ./mandos --debug --no-dbus --configdir=confdir \
369
361
                --statedir=statedir $(SERVERARGS)
380
372
statedir:
381
373
        install --directory statedir
382
374
 
383
 
.PHONY: install
384
375
install: install-server install-client-nokey
385
376
 
386
 
.PHONY: install-html
387
377
install-html: html
388
378
        install --directory $(htmldir)
389
379
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
390
380
                $(htmldocs)
391
381
 
392
 
.PHONY: install-server
393
382
install-server: doc
394
383
        install --directory $(CONFDIR)
395
384
        if install --directory --mode=u=rwx --owner=$(USER) \
442
431
        gzip --best --to-stdout intro.8mandos \
443
432
                > $(MANDIR)/man8/intro.8mandos.gz
444
433
 
445
 
.PHONY: install-client-nokey
446
434
install-client-nokey: all doc
447
435
        install --directory $(LIBDIR)/mandos $(CONFDIR)
448
436
        install --directory --mode=u=rwx $(KEYDIR) \
527
515
        gzip --best --to-stdout dracut-module/password-agent.8mandos \
528
516
                > $(MANDIR)/man8/password-agent.8mandos.gz
529
517
 
530
 
.PHONY: install-client
531
518
install-client: install-client-nokey
532
519
# Post-installation stuff
533
520
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
543
530
        fi
544
531
        echo "Now run mandos-keygen --password --dir $(KEYDIR)"
545
532
 
546
 
.PHONY: uninstall
547
533
uninstall: uninstall-server uninstall-client
548
534
 
549
 
.PHONY: uninstall-server
550
535
uninstall-server:
551
536
        -rm --force $(PREFIX)/sbin/mandos \
552
537
                $(PREFIX)/sbin/mandos-ctl \
559
544
        update-rc.d -f mandos remove
560
545
        -rmdir $(CONFDIR)
561
546
 
562
 
.PHONY: uninstall-client
563
547
uninstall-client:
564
548
# Refuse to uninstall client if /etc/crypttab is explicitly configured
565
549
# to use it.
601
585
            done; \
602
586
        fi
603
587
 
604
 
.PHONY: purge
605
588
purge: purge-server purge-client
606
589
 
607
 
.PHONY: purge-server
608
590
purge-server: uninstall-server
609
591
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
610
592
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
615
597
                $(DESTDIR)/var/run/mandos.pid
616
598
        -rmdir $(CONFDIR)
617
599
 
618
 
.PHONY: purge-client
619
600
purge-client: uninstall-client
620
601
        -shred --remove $(KEYDIR)/seckey.txt $(KEYDIR)/tls-privkey.pem
621
602
        -rm --force $(CONFDIR)/plugin-runner.conf \