2021-10-16 17:41:17 -05:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
KEYRING_TARGET_DIR=$(DESTDIR)$(PREFIX)/share/pacman/keyrings/
|
2021-10-21 14:04:16 -05:00
|
|
|
KEYRING_FILES=$(wildcard build/*.gpg) $(wildcard build/*-revoked) $(wildcard build/*-trusted)
|
2022-07-22 18:47:38 -05:00
|
|
|
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
|
2021-11-26 16:40:11 -06:00
|
|
|
SOURCES := $(shell find keyring) $(shell find libkeyringctl -name '*.py' -or -type d) keyringctl
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-10-16 17:41:17 -05:00
|
|
|
all: build
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-10-16 17:41:17 -05:00
|
|
|
lint:
|
2021-11-01 11:36:02 -06:00
|
|
|
black --check --diff keyringctl libkeyringctl tests
|
2021-10-16 17:41:17 -05:00
|
|
|
isort --diff .
|
2021-11-01 11:36:02 -06:00
|
|
|
flake8 keyringctl libkeyringctl tests
|
|
|
|
mypy --install-types --non-interactive keyringctl libkeyringctl tests
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-10-24 15:10:14 -05:00
|
|
|
fmt:
|
|
|
|
black .
|
|
|
|
isort .
|
|
|
|
|
2021-11-07 16:31:19 -06:00
|
|
|
check:
|
|
|
|
./keyringctl -v check
|
|
|
|
|
2021-10-31 11:53:20 -06:00
|
|
|
test:
|
2021-10-31 14:26:27 -06:00
|
|
|
coverage run
|
2021-11-01 15:25:11 -06:00
|
|
|
coverage xml
|
2021-11-14 09:10:23 -06:00
|
|
|
coverage report --fail-under=100.0
|
2021-10-31 11:53:20 -06:00
|
|
|
|
2021-11-26 16:40:11 -06:00
|
|
|
build: $(SOURCES)
|
2021-10-21 14:04:16 -05:00
|
|
|
./keyringctl -v build
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-11-26 16:40:11 -06:00
|
|
|
clean:
|
|
|
|
rm -rf build
|
|
|
|
|
|
|
|
install: build
|
2022-07-27 15:23:36 -05:00
|
|
|
install -vDm 644 $(KEYRING_FILES) -t $(KEYRING_TARGET_DIR)
|
2022-07-22 18:47:38 -05:00
|
|
|
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)
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-10-16 17:41:17 -05:00
|
|
|
uninstall:
|
|
|
|
rm -f $(KEYRING_TARGET_DIR)/archlinux{.gpg,-trusted,-revoked}
|
|
|
|
rmdir -p --ignore-fail-on-non-empty $(KEYRING_TARGET_DIR)
|
2012-02-13 07:37:52 -06:00
|
|
|
|
2021-11-26 16:40:11 -06:00
|
|
|
.PHONY: all lint fmt check test clean install uninstall
|