-
Notifications
You must be signed in to change notification settings - Fork 419
/
Makefile
103 lines (83 loc) · 3.36 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# Copyright (C) 2016-2022 Jian Chang <[email protected]>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-shadowsocks
PKG_VERSION:=2.1.1
PKG_RELEASE:=1
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <[email protected]>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS:=po2lmo/host
include $(INCLUDE_DIR)/package.mk
define Package/luci-app-shadowsocks/Default
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI Support for shadowsocks-libev
PKGARCH:=all
endef
define Package/luci-app-shadowsocks
$(call Package/luci-app-shadowsocks/Default)
EXTRA_DEPENDS:=iptables, wget, resolveip, ipset
endef
define Package/luci-app-shadowsocks-without-ipset
$(call Package/luci-app-shadowsocks/Default)
EXTRA_DEPENDS:=iptables, wget, resolveip
endef
define Package/luci-app-shadowsocks/description
LuCI Support for shadowsocks-libev.
endef
Package/luci-app-shadowsocks-without-ipset/description = $(Package/luci-app-shadowsocks/description)
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-app-shadowsocks/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
if [ -f /etc/uci-defaults/luci-shadowsocks ]; then
( . /etc/uci-defaults/luci-shadowsocks ) && \
rm -f /etc/uci-defaults/luci-shadowsocks
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
fi
exit 0
endef
Package/luci-app-shadowsocks-without-ipset/postinst = $(Package/luci-app-shadowsocks/postinst)
define Package/luci-app-shadowsocks/conffiles
/etc/config/shadowsocks
endef
Package/luci-app-shadowsocks-without-ipset/conffiles = $(Package/luci-app-shadowsocks/conffiles)
define Package/luci-app-shadowsocks/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DATA) $(PKG_BUILD_DIR)/shadowsocks.*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/shadowsocks
$(INSTALL_DATA) ./files/luci/model/cbi/shadowsocks/*.lua $(1)/usr/lib/lua/luci/model/cbi/shadowsocks/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/shadowsocks
$(INSTALL_DATA) ./files/luci/view/shadowsocks/*.htm $(1)/usr/lib/lua/luci/view/shadowsocks/
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) ./files/root/usr/share/rpcd/acl.d/luci-app-shadowsocks.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/root/etc/config/shadowsocks $(1)/etc/config/shadowsocks
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/root/etc/init.d/shadowsocks $(1)/etc/init.d/shadowsocks
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-shadowsocks $(1)/etc/uci-defaults/luci-shadowsocks
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/root/usr/bin/ss-rules$(2) $(1)/usr/bin/ss-rules
$(INSTALL_BIN) ./files/root/usr/bin/ss-subscribe $(1)/usr/bin/ss-subscribe
endef
Package/luci-app-shadowsocks-without-ipset/install = $(call Package/luci-app-shadowsocks/install,$(1),-without-ipset)
$(eval $(call BuildPackage,luci-app-shadowsocks))
$(eval $(call BuildPackage,luci-app-shadowsocks-without-ipset))