| 1 |
PREFIX ?= /usr/local |
| 2 |
|
| 3 |
VERSION := 1.0.2 |
| 4 |
DIST := image-factory image-factory.1.md image-factory.conf image_factory.py \ |
| 5 |
image-factory-sudo-helper image-factory-sudo-helper.1.md LICENSE Makefile NEWS.md README.md \ |
| 6 |
tests/__init__.py tests/pylint.conf tests/test_black.py tests/test_cli.py tests/test_flake8.py \ |
| 7 |
tests/test_helper.py tests/test_isort.py tests/test_pylint.py tests/test_sudo_helper.py \ |
| 8 |
$(wildcard data/*.cfg) $(wildcard data/*.xml) |
| 9 |
|
| 10 |
all: doc |
| 11 |
|
| 12 |
check: |
| 13 |
python3 -m unittest discover -v |
| 14 |
|
| 15 |
clean: |
| 16 |
rm -f *.1 |
| 17 |
|
| 18 |
dist: image-factory-$(VERSION).tar.xz image-factory-$(VERSION).tar.xz.asc |
| 19 |
|
| 20 |
version: |
| 21 |
@echo $(VERSION) |
| 22 |
|
| 23 |
%.asc: % |
| 24 |
gpg --armor --batch --detach-sign --yes --output $@ $^ |
| 25 |
|
| 26 |
%.tar.xz: $(DIST) |
| 27 |
tar -c --exclude-vcs --transform="s@^@$*/@S" $^ | xz -cz9 > $@ |
| 28 |
|
| 29 |
doc: image-factory.1 image-factory-sudo-helper.1 |
| 30 |
|
| 31 |
%.1: %.1.md |
| 32 |
pandoc -s -t man $^ -o $@ |
| 33 |
|
| 34 |
install: |
| 35 |
install -D -m 755 image-factory $(DESTDIR)$(PREFIX)/bin/image-factory |
| 36 |
install -D -m 755 image-factory-sudo-helper $(DESTDIR)$(PREFIX)/bin/image-factory-sudo-helper |
| 37 |
install -D -m 644 image-factory.1 $(DESTDIR)$(PREFIX)/share/man/man1/image-factory.1 |
| 38 |
install -D -m 644 image-factory-sudo-helper.1 $(DESTDIR)$(PREFIX)/share/man/man1/image-factory-sudo-helper.1 |
| 39 |
install -d $(DESTDIR)$(PREFIX)/share/image-factory |
| 40 |
install -m 644 $(wildcard data/*) $(DESTDIR)$(PREFIX)/share/image-factory |
| 41 |
install -D -m 644 image-factory.conf $(DESTDIR)$(PREFIX)/share/doc/image-factory/image-factory.conf |
| 42 |
|
| 43 |
.PHONY: all check clean doc install version |