50
50
GROUP:=$(firstword $(subst :, ,$(shell getent group _mandos \
51
51
|| getent group nogroup || echo 65534)))
53
LINUXVERSION:=$(shell uname --kernel-release)
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
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"; \
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)
86
90
GNUTLS_CFLAGS:=$(shell pkg-config --cflags-only-I gnutls)
312
316
./dracut-module/password-agent --test
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 #"
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 * #"
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... #'
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) || :; \
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; \
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 \
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"; \