-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
58 lines (49 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
PROGNM ?= archlinux-repro
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SHRDIR ?= $(PREFIX)/share
DOCDIR ?= $(PREFIX)/share/doc
MANDIR ?= $(PREFIX)/share/man
CONFDIR ?= /etc
MANS = $(basename $(wildcard docs/*.txt))
TAG = $(shell git describe --abbrev=0 --tags)
all: man repro
man: $(MANS)
$(MANS):
docs/repro.%: docs/repro.%.txt docs/asciidoc.conf
a2x --no-xmllint --asciidoc-opts="-f docs/asciidoc.conf" -d manpage -f manpage -D docs $<
repro: repro.in
m4 -DREPRO_VERSION=$(TAG) -DREPRO_CONFIG_DIR=$(CONFDIR)/$(PROGNM) $< >$@
chmod 755 $@
.PHONY: install
install: repro man
install -Dm755 repro $(DESTDIR)$(BINDIR)/$(PROGNM)
ln -s $(PROGNM) $(DESTDIR)$(BINDIR)/repro
install -Dm755 buildinfo -t $(DESTDIR)$(BINDIR)
install -Dm644 examples/* -t $(DESTDIR)$(DOCDIR)/$(PROGNM)
for manfile in $(MANS); do \
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
done;
install -Dm644 LICENSE -t $(DESTDIR)$(SHRDIR)/licenses/$(PROGNM)
.PHONY: uninstall
uninstall:
rm $(DESTDIR)$(BINDIR)/repro
rm $(DESTDIR)$(BINDIR)/buildinfo
rm -rf $(DESTDIR)$(DOCDIR)/$(PROGNM)
for manfile in $(MANS); do \
rm $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile##*/}; \
done;
rm -rf $(DESTDIR)$(SHRDIR)/licenses/$(PROGNM)
.PHONY: clean
clean:
rm -f repro $(MANS)
.PHONY: tag
tag:
git describe --exact-match >/dev/null 2>&1 || git tag -s $(shell date +%Y%m%d)
git push --tags
.PHONY: release
release:
mkdir -p releases
git -c tar.tar.gz.command='gzip -cn' archive --prefix=${PROGNM}-${TAG}/ -o releases/${PROGNM}-${TAG}.tar.gz ${TAG}
gpg --detach-sign -o releases/${PROGNM}-${TAG}.tar.gz.sig releases/${PROGNM}-${TAG}.tar.gz
gh release create -t "Release: ${TAG}" ${TAG} releases/${PROGNM}-${TAG}.tar.gz.sig releases/${PROGNM}-${TAG}.tar.gz