-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
76 lines (63 loc) · 2.13 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
65
66
67
68
69
70
71
72
73
74
75
76
include $(TOPDIR)/rules.mk
PKG_NAME:=chinadns-ng
PKG_VERSION:=2023.10.28
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git
PKG_SOURCE_VERSION:=66426e2da2c9e34d70f25a5adf5cb3f588556f41
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=pexcn <pexcn97@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/chinadns-ng
SECTION:=net
CATEGORY:=Network
TITLE:=ChinaDNS Next Generation, refactoring with epoll and ipset
URL:=https://github.com/zfl9/chinadns-ng
DEPENDS:=+ipset
endef
define Package/chinadns-ng/description
ChinaDNS Next Generation, refactoring with epoll and ipset.
endef
define Package/chinadns-ng/conffiles
/etc/config/chinadns-ng
/etc/chinadns-ng/chnroute.txt
/etc/chinadns-ng/chnroute6.txt
/etc/chinadns-ng/gfwlist.txt
/etc/chinadns-ng/chinalist.txt
endef
MAKE_FLAGS += STATIC=1
define Package/chinadns-ng/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chinadns-ng $(1)/usr/bin
$(INSTALL_BIN) files/chinadns-ng-daily.sh $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/chinadns-ng.init $(1)/etc/init.d/chinadns-ng
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) files/chinadns-ng.config $(1)/etc/config/chinadns-ng
$(INSTALL_DIR) $(1)/etc/chinadns-ng
$(INSTALL_DATA) files/chnroute.txt $(1)/etc/chinadns-ng
$(INSTALL_DATA) files/chnroute6.txt $(1)/etc/chinadns-ng
$(INSTALL_DATA) files/gfwlist.txt $(1)/etc/chinadns-ng
$(INSTALL_DATA) files/chinalist.txt $(1)/etc/chinadns-ng
endef
define Package/chinadns-ng/postinst
#!/bin/sh
if ! crontab -l | grep -q "chinadns-ng"; then
(crontab -l; echo -e "# chinadns-ng\n10 3 * * * /usr/bin/chinadns-ng-daily.sh") | crontab -
fi
exit 0
endef
define Package/chinadns-ng/postrm
#!/bin/sh
exec 2>/dev/null
rmdir --ignore-fail-on-non-empty /etc/chinadns-ng
(crontab -l | grep -v "chinadns-ng") | crontab -
exit 0
endef
$(eval $(call BuildPackage,chinadns-ng))