/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-01 19:52:59 UTC
  • Revision ID: teddy@recompile.se-20190801195259-nhu15rxjx3wz2kos
Break some long lines and refine documentation

* Makefile (LINUXVERSION): New.
  (LIBDIR): Break long line.
  (SYSTEMD, TMPFILES): Change ":=" to "=" to not run unless required.
  (run-client): Break long lines, and add two more harmless warnings
                to informational message.
  (install-server): Break long line.
  (install-client-nokey): - '' -
  (install-client): Shorten long line by using $(LINUXVERSION).
  (uninstall-client): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
GROUP:=$(firstword $(subst :, ,$(shell getent group _mandos \
51
51
        || getent group nogroup || echo 65534)))
52
52
 
 
53
LINUXVERSION:=$(shell uname --kernel-release)
 
54
 
53
55
## Use these settings for a traditional /usr/local install
54
56
# PREFIX:=$(DESTDIR)/usr/local
55
57
# CONFDIR:=$(DESTDIR)/etc/mandos
71
73
STATEDIR:=$(DESTDIR)/var/lib/mandos
72
74
LIBDIR:=$(shell \
73
75
        for d in \
74
 
        "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`" \
 
76
        "/usr/lib/`dpkg-architecture \
 
77
                        -qDEB_HOST_MULTIARCH 2>/dev/null`" \
75
78
        "`rpm --eval='%{_libdir}' 2>/dev/null`" /usr/lib; do \
76
79
                if [ -d "$$d" -a "$$d" = "$${d%/}" ]; then \
77
80
                        echo "$(DESTDIR)$$d"; \
80
83
        done)
81
84
##
82
85
 
83
 
SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir)
 
86
SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd \
 
87
                        --variable=systemdsystemunitdir)
84
88
TMPFILES:=$(DESTDIR)$(shell pkg-config systemd --variable=tmpfilesdir)
85
89
 
86
90
GNUTLS_CFLAGS:=$(shell pkg-config --cflags-only-I gnutls)
312
316
        ./dracut-module/password-agent --test
313
317
 
314
318
# Run the client with a local config and key
315
 
run-client: all keydir/seckey.txt keydir/pubkey.txt keydir/tls-privkey.pem keydir/tls-pubkey.pem
316
 
        @echo "###################################################################"
317
 
        @echo "# The following error messages are harmless and can be safely     #"
318
 
        @echo "# ignored:                                                        #"
319
 
        @echo "# From plugin-runner: setgid: Operation not permitted             #"
320
 
        @echo "#                     setuid: Operation not permitted             #"
321
 
        @echo "# From askpass-fifo:  mkfifo: Permission denied                   #"
322
 
        @echo "# From mandos-client:                                             #"
323
 
        @echo "#             Failed to raise privileges: Operation not permitted #"
324
 
        @echo "#             Warning: network hook \"*\" exited with status *      #"
325
 
        @echo "#                                                                 #"
326
 
        @echo "# (The messages are caused by not running as root, but you should #"
327
 
        @echo "# NOT run \"make run-client\" as root unless you also unpacked and  #"
328
 
        @echo "# compiled Mandos as root, which is also NOT recommended.)        #"
329
 
        @echo "###################################################################"
 
319
run-client: all keydir/seckey.txt keydir/pubkey.txt \
 
320
                        keydir/tls-privkey.pem keydir/tls-pubkey.pem
 
321
        @echo '######################################################'
 
322
        @echo '# The following error messages are harmless and can  #'
 
323
        @echo '#  be safely ignored:                                #'
 
324
        @echo '## From plugin-runner:                               #'
 
325
        @echo '# setgid: Operation not permitted                    #'
 
326
        @echo '# setuid: Operation not permitted                    #'
 
327
        @echo '## From askpass-fifo:                                #'
 
328
        @echo '# mkfifo: Permission denied                          #'
 
329
        @echo '## From mandos-client:                               #'
 
330
        @echo '# Failed to raise privileges: Operation not permi... #'
 
331
        @echo '# Warning: network hook "*" exited with status *     #'
 
332
        @echo '# ioctl SIOCSIFFLAGS +IFF_UP: Operation not permi... #'
 
333
        @echo '# Failed to bring up interface "*": Operation not... #'
 
334
        @echo '#                                                    #'
 
335
        @echo '# (The messages are caused by not running as root,   #'
 
336
        @echo '# but you should NOT run "make run-client" as root   #'
 
337
        @echo '# unless you also unpacked and compiled Mandos as    #'
 
338
        @echo '# root, which is also NOT recommended.)              #'
 
339
        @echo '######################################################'
330
340
# We set GNOME_KEYRING_CONTROL to block pam_gnome_keyring
331
341
        ./plugin-runner --plugin-dir=plugins.d \
332
342
                --plugin-helper-dir=plugin-helpers \
372
382
        elif install --directory --mode=u=rwx $(STATEDIR); then \
373
383
                chown -- $(USER):$(GROUP) $(STATEDIR) || :; \
374
384
        fi
375
 
        if [ "$(TMPFILES)" != "$(DESTDIR)" -a -d "$(TMPFILES)" ]; then \
 
385
        if [ "$(TMPFILES)" != "$(DESTDIR)" \
 
386
                        -a -d "$(TMPFILES)" ]; then \
376
387
                install --mode=u=rw,go=r tmpfiles.d-mandos.conf \
377
388
                        $(TMPFILES)/mandos.conf; \
378
389
        fi
425
436
        install --mode=u=rwx,go=rx \
426
437
                --target-directory=$(LIBDIR)/mandos plugin-runner
427
438
        install --mode=u=rwx,go=rx \
428
 
                --target-directory=$(LIBDIR)/mandos mandos-to-cryptroot-unlock
 
439
                --target-directory=$(LIBDIR)/mandos \
 
440
                mandos-to-cryptroot-unlock
429
441
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
430
442
                mandos-keygen
431
443
        install --mode=u=rwx,go=rx \
494
506
        if command -v update-initramfs >/dev/null; then \
495
507
            update-initramfs -k all -u; \
496
508
        elif command -v dracut >/dev/null; then \
497
 
            for initrd in $(DESTDIR)/boot/initr*-$(shell uname --kernel-release); do \
 
509
            for initrd in $(DESTDIR)/boot/initr*-$(LINUXVERSION); do \
498
510
                if [ -w "$$initrd" ]; then \
499
511
                    chmod go-r "$$initrd"; \
500
512
                    dracut --force "$$initrd"; \
553
565
        if command -v update-initramfs >/dev/null; then \
554
566
            update-initramfs -k all -u; \
555
567
        elif command -v dracut >/dev/null; then \
556
 
            for initrd in $(DESTDIR)/boot/initr*-$(shell uname --kernel-release); do \
 
568
            for initrd in $(DESTDIR)/boot/initr*-$(LINUXVERSION); do \
557
569
                test -w "$$initrd" && dracut --force "$$initrd"; \
558
570
            done; \
559
571
        fi