forked from virus2500/blocklist-with-ipset
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
53 lines (36 loc) · 815 Bytes
/
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
NAME=blocklist
VERSION=1.1.1
SBIN_FILES=blocklist.pl
ETC_FILES=blacklist whitelist
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
PKG=$(PKG_DIR)/$(PKG_NAME).tar.gz
SIG=$(PKG_DIR)/$(PKG_NAME).asc
PREFIX?=/
SBIN_DIR=$(PREFIX)/sbin/
ETC_DIR=$(PREFIX)/etc/$(NAME)
pkg:
mkdir -p $(PKG_DIR)
$(PKG): pkg
git archive --output=$(PKG) --prefix=$(PKG_NAME)/ HEAD
build: $(PKG)
$(SIG): $(PKG)
gpg --sign --detach-sign --armor $(PKG)
sign: $(SIG)
clean:
rm -f $(PKG) $(SIG)
all: $(PKG) $(SIG)
test:
tag:
git tag v$(VERSION)
git push --tags
release: $(PKG) $(SIG) tag
install:
mkdir -p $(SBIN_DIR)
cp -r $(SBIN_FILES) $(SBIN_DIR)/
mkdir -p $(ETC_DIR)
cp -r $(ETC_FILES) $(ETC_DIR)/
uninstall:
rm -f $(SBIN_DIR)/$(SBIN_FILES)
rm -rf $(ETC_DIR)
.PHONY: build sign clean test tag release install uninstall all