luci-app-vssr/Makefile
jerrykuku 4862606132 v1.13
- UPD: 将Shadowsocks更新为原始版本,放弃通过v2ray来运行,支持simple-obfs和v2ray-plugin(老版本升级需要自行安装新依赖 shadowsocks-libev-ss-local shadowsocks-libev-ss-redir 软件包内有,还有simple-obfs 和 v2ray-plugin 需要自行编译)。
- UPD: 扩展分流功能,现在分流可以随意组合。
2020-08-23 21:56:29 +08:00

100 lines
2.8 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.13
PKG_RELEASE:=20200823
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/config
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin
bool "Include Shadowsocks V2ray Plugin"
default y if i386||x86_64||arm||aarch64
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
bool "Include V2ray"
default y if i386||x86_64||arm||aarch64
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
bool "Include Trojan"
default y if i386||x86_64||arm||aarch64
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
bool "Include Kcptun"
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
bool "Include ShadowsocksR Server"
default y if i386||x86_64||arm||aarch64
endef
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
define Package/luci-app-vssr
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=A New SS/SSR/V2Ray/Trojan LuCI interface
PKGARCH:=all
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +luasocket +coreutils-nohup +lua-maxminddb \
+shadowsocks-libev-ss-local +shadowsocksr-libev-ssr-local +shadowsocks-libev-ss-redir +simple-obfs \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server
endef
define Build/Prepare
endef
define Build/Compile
endef
define Package/luci-app-vssr/conffiles
/etc/ssr_ip
/etc/dnsmasq.ssr/gfw_list.conf
/etc/china_ssr.txt
/etc/dnsmasq.ssr/gfw_list.conf
/etc/dnsmasq.ssr/gfw_base.conf
/etc/dnsmasq.oversea/oversea_list.conf
endef
define Package/luci-app-vssr/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
$(INSTALL_DIR) $(1)/
cp -pR ./root/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
po2lmo ./po/zh-cn/vssr.po $(1)/usr/lib/lua/luci/i18n/vssr.zh-cn.lmo
endef
define Package/luci-app-vssr/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/uci-defaults/luci-vssr ) && rm -f /etc/uci-defaults/luci-vssr
rm -rf /tmp/luci-indexcache
rm -rf /tmp/luci-modulecache/*
chmod 755 /etc/init.d/vssr >/dev/null 2>&1
/etc/init.d/vssr enable >/dev/null 2>&1
fi
exit 0
endef
define Package/luci-app-vssr/prerm
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/vssr disable
/etc/init.d/vssr stop
fi
exit 0
endef
$(eval $(call BuildPackage,luci-app-vssr))