289
289
--expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \
292
# Does the linker support the --no-warn-execstack option?
293
ifeq ($(shell echo 'int main(){}'|$(CC) --language=c /dev/stdin -o /dev/null -Xlinker --no-warn-execstack >/dev/null 2>&1 && echo yes),yes)
294
# These programs use nested functions, which uses an executable stack
295
plugin-runner: LDFLAGS += -Xlinker --no-warn-execstack
296
dracut-module/password-agent: LDFLAGS += -Xlinker --no-warn-execstack
297
plugins.d/password-prompt: LDFLAGS += -Xlinker --no-warn-execstack
298
plugins.d/mandos-client: LDFLAGS += -Xlinker --no-warn-execstack
299
plugins.d/plymouth: LDFLAGS += -Xlinker --no-warn-execstack
302
292
# Need to add the GnuTLS, Avahi and GPGME libraries
303
293
plugins.d/mandos-client: CFLAGS += $(GNUTLS_CFLAGS) $(strip \
304
294
) $(AVAHI_CFLAGS) $(GPGME_CFLAGS)
386
376
# Used by run-server
387
377
confdir/mandos.conf: mandos.conf
388
install -D --mode=u=rw,go=r $^ $@
378
install --directory confdir
379
install --mode=u=rw,go=r $^ $@
389
380
confdir/clients.conf: clients.conf keydir/seckey.txt keydir/tls-pubkey.pem
390
install -D --mode=u=rw $< $@
381
install --directory confdir
382
install --mode=u=rw $< $@
391
383
# Add a client password
392
384
./mandos-keygen --dir keydir --password --no-ssh >> $@
399
391
.PHONY: install-html
400
392
install-html: html
401
install -D --mode=u=rw,go=r --target-directory=$(htmldir) \
393
install --directory $(htmldir)
394
install --mode=u=rw,go=r --target-directory=$(htmldir) \
404
397
.PHONY: install-server
405
398
install-server: doc
399
install --directory $(CONFDIR)
406
400
if install --directory --mode=u=rwx --owner=$(USER) \
407
401
--group=$(GROUP) $(STATEDIR); then \
409
403
elif install --directory --mode=u=rwx $(STATEDIR); then \
410
404
chown -- $(USER):$(GROUP) $(STATEDIR) || :; \
412
if [ "$(TMPFILES)" != "$(DESTDIR)" ]; then \
413
install -D --mode=u=rw,go=r tmpfiles.d-mandos.conf \
406
if [ "$(TMPFILES)" != "$(DESTDIR)" \
407
-a -d "$(TMPFILES)" ]; then \
408
install --mode=u=rw,go=r tmpfiles.d-mandos.conf \
414
409
$(TMPFILES)/mandos.conf; \
416
if [ "$(SYSUSERS)" != "$(DESTDIR)" ]; then \
417
install -D --mode=u=rw,go=r sysusers.d-mandos.conf \
411
if [ "$(SYSUSERS)" != "$(DESTDIR)" \
412
-a -d "$(SYSUSERS)" ]; then \
413
install --mode=u=rw,go=r sysusers.d-mandos.conf \
418
414
$(SYSUSERS)/mandos.conf; \
420
install --directory $(PREFIX)/sbin
421
install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
416
install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
423
417
install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
425
419
install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
427
install --directory $(CONFDIR)
428
421
install --mode=u=rw,go=r --target-directory=$(CONFDIR) \
430
423
install --mode=u=rw --target-directory=$(CONFDIR) \
432
install -D --mode=u=rw,go=r dbus-mandos.conf \
425
install --mode=u=rw,go=r dbus-mandos.conf \
433
426
$(DBUSPOLICYDIR)/mandos.conf
434
install -D --mode=u=rwx,go=rx init.d-mandos \
427
install --mode=u=rwx,go=rx init.d-mandos \
435
428
$(DESTDIR)/etc/init.d/mandos
436
if [ "$(SYSTEMD)" != "$(DESTDIR)" ]; then \
437
install -D --mode=u=rw,go=r mandos.service \
429
if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
430
install --mode=u=rw,go=r mandos.service $(SYSTEMD); \
440
install -D --mode=u=rw,go=r default-mandos \
432
install --mode=u=rw,go=r default-mandos \
441
433
$(DESTDIR)/etc/default/mandos
442
434
if [ -z $(DESTDIR) ]; then \
443
435
update-rc.d mandos defaults 25 15;\
445
install --directory $(MANDIR)/man8 $(MANDIR)/man5
446
437
gzip --best --to-stdout mandos.8 \
447
438
> $(MANDIR)/man8/mandos.8.gz
448
439
gzip --best --to-stdout mandos-monitor.8 \
459
450
.PHONY: install-client-nokey
460
451
install-client-nokey: all doc
452
install --directory $(LIBDIR)/mandos $(CONFDIR)
461
453
install --directory --mode=u=rwx $(KEYDIR) \
462
454
$(LIBDIR)/mandos/plugins.d \
463
455
$(LIBDIR)/mandos/plugin-helpers
464
if [ "$(SYSUSERS)" != "$(DESTDIR)" ]; then \
465
install -D --mode=u=rw,go=r sysusers.d-mandos.conf \
456
if [ "$(SYSUSERS)" != "$(DESTDIR)" \
457
-a -d "$(SYSUSERS)" ]; then \
458
install --mode=u=rw,go=r sysusers.d-mandos.conf \
466
459
$(SYSUSERS)/mandos-client.conf; \
468
461
if [ "$(CONFDIR)" != "$(LIBDIR)/mandos" ]; then \
469
install --directory \
470
--mode=u=rwx "$(CONFDIR)/plugins.d" \
462
install --mode=u=rwx \
463
--directory "$(CONFDIR)/plugins.d" \
471
464
"$(CONFDIR)/plugin-helpers"; \
473
install --directory --mode=u=rwx,go=rx \
466
install --mode=u=rwx,go=rx --directory \
474
467
"$(CONFDIR)/network-hooks.d"
475
468
install --mode=u=rwx,go=rx \
476
469
--target-directory=$(LIBDIR)/mandos plugin-runner
477
470
install --mode=u=rwx,go=rx \
478
471
--target-directory=$(LIBDIR)/mandos \
479
472
mandos-to-cryptroot-unlock
480
install --directory $(PREFIX)/sbin
481
473
install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
483
475
install --mode=u=rwx,go=rx \
501
493
install --mode=u=rwx,go=rx \
502
494
--target-directory=$(LIBDIR)/mandos/plugin-helpers \
503
495
plugin-helpers/mandos-client-iprouteadddel
504
install -D initramfs-tools-hook \
496
install initramfs-tools-hook \
505
497
$(INITRAMFSTOOLS)/hooks/mandos
506
install -D --mode=u=rw,go=r initramfs-tools-conf \
498
install --mode=u=rw,go=r initramfs-tools-conf \
507
499
$(INITRAMFSTOOLS)/conf.d/mandos-conf
508
install -D --mode=u=rw,go=r initramfs-tools-conf-hook \
500
install --mode=u=rw,go=r initramfs-tools-conf-hook \
509
501
$(INITRAMFSTOOLS)/conf-hooks.d/zz-mandos
510
install -D initramfs-tools-script \
502
install initramfs-tools-script \
511
503
$(INITRAMFSTOOLS)/scripts/init-premount/mandos
512
install -D initramfs-tools-script-stop \
504
install initramfs-tools-script-stop \
513
505
$(INITRAMFSTOOLS)/scripts/local-premount/mandos
514
install -D --mode=u=rw,go=r \
515
--target-directory=$(DRACUTMODULE) \
506
install --directory $(DRACUTMODULE)
507
install --mode=u=rw,go=r --target-directory=$(DRACUTMODULE) \
516
508
dracut-module/ask-password-mandos.path \
517
509
dracut-module/ask-password-mandos.service
518
510
install --mode=u=rwxs,go=rx \
624
615
$(DESTDIR)/etc/dbus-1/system.d/mandos.conf
625
616
$(DESTDIR)/etc/default/mandos \
626
617
$(DESTDIR)/etc/init.d/mandos \
618
$(SYSTEMD)/mandos.service \
627
619
$(DESTDIR)/run/mandos.pid \
628
620
$(DESTDIR)/var/run/mandos.pid
629
if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
630
-rm --force -- $(SYSTEMD)/mandos.service; \
632
621
-rmdir $(CONFDIR)
634
623
.PHONY: purge-client