/mandos/release

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

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2019-07-29 16:35:53 UTC
  • mto: This revision was merged to the branch mainline in revision 384.
  • Revision ID: teddy@recompile.se-20190729163553-1i442i2cbx64c537
Make tests and man page examples match

Make the tests test_manual_page_example[1-5] match exactly what is
written in the manual page, and add comments to manual page as
reminders to keep tests and manual page examples in sync.

* mandos-ctl (Test_commands_from_options.test_manual_page_example_1):
  Remove "--verbose" option, since the manual does not have it as the
  first example, and change assertion to match.
* mandos-ctl.xml (EXAMPLE): Add comments to all examples documenting
  which test function they correspond to.  Also remove unnecessary
  quotes from option arguments in fourth example, and clarify language
  slightly in fifth example.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
OPTIMIZE:=-Os -fno-strict-aliasing
43
43
LANGUAGE:=-std=gnu11
44
44
htmldir:=man
45
 
version:=1.8.5
 
45
version:=1.8.4
46
46
SED:=sed
47
47
 
48
48
USER:=$(firstword $(subst :, ,$(shell getent passwd _mandos \
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
 
 
55
53
## Use these settings for a traditional /usr/local install
56
54
# PREFIX:=$(DESTDIR)/usr/local
57
55
# CONFDIR:=$(DESTDIR)/etc/mandos
73
71
STATEDIR:=$(DESTDIR)/var/lib/mandos
74
72
LIBDIR:=$(shell \
75
73
        for d in \
76
 
        "/usr/lib/`dpkg-architecture \
77
 
                        -qDEB_HOST_MULTIARCH 2>/dev/null`" \
 
74
        "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`" \
78
75
        "`rpm --eval='%{_libdir}' 2>/dev/null`" /usr/lib; do \
79
76
                if [ -d "$$d" -a "$$d" = "$${d%/}" ]; then \
80
77
                        echo "$(DESTDIR)$$d"; \
83
80
        done)
84
81
##
85
82
 
86
 
SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd \
87
 
                        --variable=systemdsystemunitdir)
 
83
SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir)
88
84
TMPFILES:=$(DESTDIR)$(shell pkg-config systemd --variable=tmpfilesdir)
89
85
 
90
86
GNUTLS_CFLAGS:=$(shell pkg-config --cflags-only-I gnutls)
316
312
        ./dracut-module/password-agent --test
317
313
 
318
314
# Run the client with a local config and key
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 '######################################################'
 
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 "###################################################################"
340
330
# We set GNOME_KEYRING_CONTROL to block pam_gnome_keyring
341
331
        ./plugin-runner --plugin-dir=plugins.d \
342
332
                --plugin-helper-dir=plugin-helpers \
382
372
        elif install --directory --mode=u=rwx $(STATEDIR); then \
383
373
                chown -- $(USER):$(GROUP) $(STATEDIR) || :; \
384
374
        fi
385
 
        if [ "$(TMPFILES)" != "$(DESTDIR)" \
386
 
                        -a -d "$(TMPFILES)" ]; then \
 
375
        if [ "$(TMPFILES)" != "$(DESTDIR)" -a -d "$(TMPFILES)" ]; then \
387
376
                install --mode=u=rw,go=r tmpfiles.d-mandos.conf \
388
377
                        $(TMPFILES)/mandos.conf; \
389
378
        fi
436
425
        install --mode=u=rwx,go=rx \
437
426
                --target-directory=$(LIBDIR)/mandos plugin-runner
438
427
        install --mode=u=rwx,go=rx \
439
 
                --target-directory=$(LIBDIR)/mandos \
440
 
                mandos-to-cryptroot-unlock
 
428
                --target-directory=$(LIBDIR)/mandos mandos-to-cryptroot-unlock
441
429
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
442
430
                mandos-keygen
443
431
        install --mode=u=rwx,go=rx \
506
494
        if command -v update-initramfs >/dev/null; then \
507
495
            update-initramfs -k all -u; \
508
496
        elif command -v dracut >/dev/null; then \
509
 
            for initrd in $(DESTDIR)/boot/initr*-$(LINUXVERSION); do \
 
497
            for initrd in $(DESTDIR)/boot/initr*-$(shell uname --kernel-release); do \
510
498
                if [ -w "$$initrd" ]; then \
511
499
                    chmod go-r "$$initrd"; \
512
500
                    dracut --force "$$initrd"; \
565
553
        if command -v update-initramfs >/dev/null; then \
566
554
            update-initramfs -k all -u; \
567
555
        elif command -v dracut >/dev/null; then \
568
 
            for initrd in $(DESTDIR)/boot/initr*-$(LINUXVERSION); do \
 
556
            for initrd in $(DESTDIR)/boot/initr*-$(shell uname --kernel-release); do \
569
557
                test -w "$$initrd" && dracut --force "$$initrd"; \
570
558
            done; \
571
559
        fi