-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
64 lines (52 loc) · 1.92 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
59
60
61
62
63
64
PREFIX ?= /usr/local
LOCALEPREFIX ?= $(PREFIX)/share/locale
MANPREFIX ?= $(PREFIX)/share/man
PANDOC ?= $(shell which pandoc)
setup:
command -v cram || aurget cram
command -v vbump || aurget vbump-git
command -v pandoc || stack install pandoc
locale/downgrade.pot: downgrade
xgettext \
--from-code=utf-8 -L shell \
--package-name=downgrade \
--copyright-holder=$(AUTHOR) \
-o $@ $<
find ./locale/*po -exec msgmerge --update {} $@ \;
doc/downgrade.8: doc/downgrade.8.md
$(PANDOC) --standalone --to man $< -o $@
man: doc/downgrade.8
test:
cram test
install:
install -Dm755 downgrade $(DESTDIR)$(PREFIX)/bin/downgrade
install -Dm644 doc/downgrade.8 $(DESTDIR)$(MANPREFIX)/man8/downgrade.8
install -Dm644 completion/bash $(DESTDIR)$(PREFIX)/share/bash-completion/completions/downgrade
install -Dm644 completion/zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_downgrade
for po_file in locale/*.po; do \
locale="$$(basename "$$po_file" .po)"; \
mkdir -p "$(DESTDIR)$(LOCALEPREFIX)/$$locale/LC_MESSAGES/"; \
msgfmt "$$po_file" -o "$(DESTDIR)$(LOCALEPREFIX)/$$locale/LC_MESSAGES/downgrade.mo"; \
done
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/downgrade \
$(DESTDIR)$(MANPREFIX)/man8/downgrade.8 \
$(DESTDIR)$(PREFIX)/share/bash-completion/completions/downgrade \
$(DESTDIR)$(PREFIX)/share/zsh/site-functions/_downgrade \
$(DESTDIR)$(LOCALEPREFIX)/*/LC_MESSAGES/downgrade.mo
.PHONY: setup test install uninstall
.PHONY: release.major
release.major: VERSION=$(shell git tag | vbump major | sed 's/^v//')
release.major: release
.PHONY: release.minor
release.minor: VERSION=$(shell git tag | vbump minor | sed 's/^v//')
release.minor: release
.PHONY: release.match
release.patch: VERSION=$(shell git tag | vbump patch | sed 's/^v//')
release.patch: release
.PHONY: release
release: test
[ -n "$(VERSION)" ]
git tag -s -m v$(VERSION) v$(VERSION)
git push --follow-tags
aur-release downgrade "$(VERSION)"