keyring/Makefile

46 lines
1.2 KiB
Makefile
Raw Normal View History

2023-03-25 22:26:34 +01:00
SHELL = /bin/bash
PREFIX ?= /usr/local
BUILD_DIR ?= build
KEYRING_TARGET_DIR ?= $(PREFIX)/share/pacman/keyrings/
SCRIPT_TARGET_DIR ?= $(PREFIX)/bin
2023-03-25 22:40:44 +01:00
KEYRING_FILE=rad4day.gpg
KEYRING_REVOKED_FILE=rad4day-revoked
KEYRING_TRUSTED_FILE=rad4day-trusted
2023-03-25 22:26:34 +01:00
SOURCES := $(shell find keyring) $(shell find libkeyringctl -name '*.py' -or -type d) keyringctl
all: build
lint:
black --check --diff keyringctl libkeyringctl tests
isort --diff .
flake8 keyringctl libkeyringctl tests
mypy --install-types --non-interactive keyringctl libkeyringctl tests
fmt:
black .
isort .
check:
./keyringctl -v check
test:
coverage run
coverage xml
coverage report --fail-under=100.0
build: $(SOURCES)
./keyringctl -v $(BUILD_DIR)
clean:
2023-03-25 22:40:44 +01:00
rm -rf $(BUILD_DIR)
2023-03-25 22:26:34 +01:00
2023-03-25 22:40:44 +01:00
install: build
2023-03-25 22:26:34 +01:00
install -vDm 644 build/{$(KEYRING_FILE),$(KEYRING_REVOKED_FILE),$(KEYRING_TRUSTED_FILE)} -t $(DESTDIR)$(KEYRING_TARGET_DIR)
uninstall:
rm -fv $(DESTDIR)$(KEYRING_TARGET_DIR)/{$(KEYRING_FILE),$(KEYRING_REVOKED_FILE),$(KEYRING_TRUSTED_FILE)}
rmdir -pv --ignore-fail-on-non-empty $(DESTDIR)$(KEYRING_TARGET_DIR)
rmdir -pv --ignore-fail-on-non-empty $(DESTDIR)$(SCRIPT_TARGET_DIR)
2023-03-25 22:40:44 +01:00
.PHONY: all lint fmt check test clean install uninstall