Install WKD update script/service/timer with Makefile

Makefile:
Extend install target to also install the WKD update script and the
systemd service and timer.
Vendor enable the systemd timer.
This commit is contained in:
David Runge 2022-07-23 01:47:38 +02:00
parent 9f8c58f340
commit 87b1a4ab72
No known key found for this signature in database
GPG Key ID: 139B09DA5BF0D338

View File

@ -1,6 +1,12 @@
PREFIX ?= /usr/local
KEYRING_TARGET_DIR=$(DESTDIR)$(PREFIX)/share/pacman/keyrings/
KEYRING_FILES=$(wildcard build/*.gpg) $(wildcard build/*-revoked) $(wildcard build/*-trusted)
SCRIPT_TARGET_DIR=$(DESTDIR)$(PREFIX)/bin/
SCRIPT_FILES=wkd_sync/archlinux-keyring-wkd-sync
SYSTEMD_SYSTEM_UNIT_DIR=$(DESTDIR)$(shell pkgconf --variable systemd_system_unit_dir systemd)
SYSTEMD_FILES=$(wildcard wkd_sync/*.service) $(wildcard wkd_sync/*.timer)
SYSTEMD_TIMER_DIR=$(SYSTEMD_SYSTEM_UNIT_DIR)/timers.target.wants/
SYSTEMD_TIMER_FILE=archlinux-keyring-wkd-sync.timer
SOURCES := $(shell find keyring) $(shell find libkeyringctl -name '*.py' -or -type d) keyringctl
all: build
@ -31,6 +37,10 @@ clean:
install: build
install -vDm 755 $(KEYRING_FILES) -t $(KEYRING_TARGET_DIR)
install -vDm 755 $(SCRIPT_FILES) -t $(SCRIPT_TARGET_DIR)
install -vDm 644 $(SYSTEMD_FILES) -t $(SYSTEMD_SYSTEM_UNIT_DIR)
install -vdm 755 $(SYSTEMD_TIMER_DIR)
ln -sv ../$(SYSTEMD_TIMER_FILE) $(SYSTEMD_TIMER_DIR)/$(SYSTEMD_TIMER_FILE)
uninstall:
rm -f $(KEYRING_TARGET_DIR)/archlinux{.gpg,-trusted,-revoked}