-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
37 lines (31 loc) · 1.09 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
BIN := rebuild-detector
PREFIX ?= /usr
LIB_DIR = $(DESTDIR)$(PREFIX)/lib
BIN_DIR = $(DESTDIR)$(PREFIX)/bin
SHARE_DIR = $(DESTDIR)$(PREFIX)/share
.PHONY: release
release: tag sign
.PHONY: tag
tag:
[ -n "$(VERSION)" ] || { echo >&2 "VERSION is not set"; exit 1; }
git tag -s $(VERSION) -m $(VERSION)
.PHONY: sign
sign:
[ -n "$(VERSION)" ] || { echo >&2 "VERSION is not set"; exit 1; }
rm -rf release
mkdir -p release
git -c tar.tar.gz.command="gzip -cn" archive -o "release/$(BIN)-$(VERSION).tar.gz" --format tar.gz --prefix "$(BIN)-$(VERSION)/" "$(VERSION)"
gpg --detach-sign --yes "release/$(BIN)-$(VERSION).tar.gz"
rm "release/$(BIN)-$(VERSION).tar.gz"
.PHONY: docs
docs:
marked-man -i README.md -o "$(BIN).7"
gzip "$(BIN).7" -n
.PHONY: install
install:
install -Dm755 -t "$(BIN_DIR)/" checkrebuild
install -Dm644 -t "$(SHARE_DIR)/licenses/$(BIN)" LICENSE
install -Dm644 -t "$(SHARE_DIR)/libalpm/hooks" "$(BIN).hook"
install -Dm644 -t "$(SHARE_DIR)/man/man7" "$(BIN).7.gz"
install -dm755 "$(SHARE_DIR)/man/man1"
ln -Tsf "/usr/share/man/man7/$(BIN).7.gz" "$(SHARE_DIR)/man/man1/checkrebuild.1.gz"