Adapt Makefile to build wkd dir and inspect it

Makefile:
Change the Makefile to build WKD dirs based on a given WKD_FQDN and add
them to WKD_BUILD_DIR.
This commit is contained in:
David Runge 2022-08-31 11:01:15 +02:00
parent 0a6ff56c80
commit 85dc87d167
No known key found for this signature in database
GPG Key ID: 139B09DA5BF0D338

View File

@ -1,7 +1,10 @@
PREFIX ?= /usr/local PREFIX ?= /usr/local
BUILD_DIR ?= build
KEYRING_TARGET_DIR ?= $(PREFIX)/share/pacman/keyrings/ KEYRING_TARGET_DIR ?= $(PREFIX)/share/pacman/keyrings/
SCRIPT_TARGET_DIR ?= $(PREFIX)/bin/ SCRIPT_TARGET_DIR ?= $(PREFIX)/bin/
SYSTEMD_SYSTEM_UNIT_DIR ?= $(shell pkgconf --variable systemd_system_unit_dir systemd) SYSTEMD_SYSTEM_UNIT_DIR ?= $(shell pkgconf --variable systemd_system_unit_dir systemd)
WKD_FQDN ?= archlinux.org
WKD_BUILD_DIR ?= $(BUILD_DIR)/wkd
KEYRING_FILE=archlinux.gpg KEYRING_FILE=archlinux.gpg
KEYRING_REVOKED_FILE=archlinux-revoked KEYRING_REVOKED_FILE=archlinux-revoked
KEYRING_TRUSTED_FILE=archlinux-trusted KEYRING_TRUSTED_FILE=archlinux-trusted
@ -33,13 +36,19 @@ test:
coverage report --fail-under=100.0 coverage report --fail-under=100.0
build: $(SOURCES) build: $(SOURCES)
./keyringctl -v build ./keyringctl -v $(BUILD_DIR)
wkd: build
sq -f wkd generate -s $(WKD_BUILD_DIR)/ $(WKD_FQDN) $(BUILD_DIR)/$(KEYRING_FILE)
wkd_inspect: wkd
for file in $(WKD_BUILD_DIR)/.well-known/openpgpkey/$(WKD_FQDN)/hu/*; do sq inspect $$file; done
wkd_sync_service: wkd_sync/$(WKD_SYNC_SERVICE_IN) wkd_sync_service: wkd_sync/$(WKD_SYNC_SERVICE_IN)
sed -e 's|SCRIPT_TARGET_DIR|$(SCRIPT_TARGET_DIR)|' wkd_sync/$(WKD_SYNC_SERVICE_IN) > build/$(WKD_SYNC_SERVICE) sed -e 's|SCRIPT_TARGET_DIR|$(SCRIPT_TARGET_DIR)|' wkd_sync/$(WKD_SYNC_SERVICE_IN) > $(BUILD_DIR)/$(WKD_SYNC_SERVICE)
clean: clean:
rm -rf build rm -rf $(BUILD_DIR) $(WKD_BUILD_DIR)
install: build wkd_sync_service install: build wkd_sync_service
install -vDm 644 build/{$(KEYRING_FILE),$(KEYRING_REVOKED_FILE),$(KEYRING_TRUSTED_FILE)} -t $(DESTDIR)$(KEYRING_TARGET_DIR) install -vDm 644 build/{$(KEYRING_FILE),$(KEYRING_REVOKED_FILE),$(KEYRING_TRUSTED_FILE)} -t $(DESTDIR)$(KEYRING_TARGET_DIR)
@ -59,4 +68,4 @@ uninstall:
rm -v $(DESTDIR)$(SYSTEMD_TIMER_DIR)/$(WKD_SYNC_TIMER) rm -v $(DESTDIR)$(SYSTEMD_TIMER_DIR)/$(WKD_SYNC_TIMER)
rmdir -pv --ignore-fail-on-non-empty $(DESTDIR)$(SYSTEMD_TIMER_DIR) rmdir -pv --ignore-fail-on-non-empty $(DESTDIR)$(SYSTEMD_TIMER_DIR)
.PHONY: all lint fmt check test clean install uninstall .PHONY: all lint fmt check test clean install uninstall wkd wkd_inspect