From 85dc87d167d7e55b943cb13010fb28bb6d1839f1 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 31 Aug 2022 11:01:15 +0200 Subject: [PATCH] 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. --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 031c252..7a6081e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ PREFIX ?= /usr/local +BUILD_DIR ?= build KEYRING_TARGET_DIR ?= $(PREFIX)/share/pacman/keyrings/ SCRIPT_TARGET_DIR ?= $(PREFIX)/bin/ 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_REVOKED_FILE=archlinux-revoked KEYRING_TRUSTED_FILE=archlinux-trusted @@ -33,13 +36,19 @@ test: coverage report --fail-under=100.0 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) - 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: - rm -rf build + rm -rf $(BUILD_DIR) $(WKD_BUILD_DIR) install: build wkd_sync_service 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) 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