2019-12-21 19:32:02 +08:00
|
|
|
# Copyright (C) 2018-2020 Lienol <lawlienol@gmail.com>
|
2019-08-03 00:02:17 +08:00
|
|
|
#
|
2019-12-28 20:45:37 +08:00
|
|
|
# This is free software, licensed under the GNU General Public License v3.
|
2019-08-03 00:02:17 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
|
|
PKG_NAME:=luci-app-passwall
|
2020-07-05 20:19:28 +08:00
|
|
|
PKG_VERSION:=3.9
|
2020-07-19 17:27:49 +08:00
|
|
|
PKG_RELEASE:=19
|
2020-07-17 20:21:32 +08:00
|
|
|
PKG_DATE:=20200717
|
2019-08-03 00:02:17 +08:00
|
|
|
|
|
|
|
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
2019-08-05 00:20:10 +08:00
|
|
|
define Package/$(PKG_NAME)/config
|
2019-11-02 10:02:03 +08:00
|
|
|
menu "Configuration"
|
2019-11-16 08:31:55 +08:00
|
|
|
|
2019-12-14 18:01:26 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks
|
|
|
|
|
bool "Include ipt2socks"
|
2020-01-15 01:50:56 +08:00
|
|
|
default y
|
2019-08-05 00:20:10 +08:00
|
|
|
|
2019-08-03 00:02:17 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
|
2020-07-05 20:19:28 +08:00
|
|
|
bool "Include Shadowsocks"
|
2019-08-03 00:02:17 +08:00
|
|
|
default n
|
|
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR
|
2020-07-05 20:19:28 +08:00
|
|
|
bool "Include ShadowsocksR"
|
2019-08-03 00:02:17 +08:00
|
|
|
default y
|
|
|
|
|
|
2020-07-05 20:19:28 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
|
|
|
|
bool "Include ShadowsocksR Server"
|
|
|
|
|
default y
|
2019-08-03 00:02:17 +08:00
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
|
|
|
|
bool "Include V2ray"
|
2019-11-16 08:31:55 +08:00
|
|
|
default y
|
|
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
|
|
|
|
|
bool "Include Trojan"
|
2019-08-03 00:02:17 +08:00
|
|
|
default n
|
|
|
|
|
|
2020-07-17 20:21:32 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO
|
|
|
|
|
bool "Include Trojan_GO"
|
|
|
|
|
default n
|
|
|
|
|
|
2019-08-03 00:02:17 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Brook
|
|
|
|
|
bool "Include Brook"
|
|
|
|
|
default n
|
|
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_kcptun
|
|
|
|
|
bool "Include kcptun"
|
|
|
|
|
default n
|
|
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_haproxy
|
|
|
|
|
bool "Include haproxy"
|
2020-01-15 01:50:56 +08:00
|
|
|
default y
|
2019-08-03 00:02:17 +08:00
|
|
|
|
2019-12-28 20:45:37 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG
|
|
|
|
|
bool "Include ChinaDNS-NG"
|
2019-08-03 00:02:17 +08:00
|
|
|
default y
|
|
|
|
|
|
2019-12-28 20:45:37 +08:00
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_pdnsd
|
|
|
|
|
bool "Include pdnsd"
|
|
|
|
|
default y
|
2020-01-15 01:50:56 +08:00
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_dns2socks
|
|
|
|
|
bool "Include dns2socks"
|
2020-01-24 15:02:51 +08:00
|
|
|
default y
|
2020-02-11 23:40:23 +08:00
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin
|
|
|
|
|
bool "Include v2ray-plugin (Shadowsocks plugin)"
|
|
|
|
|
default n
|
|
|
|
|
|
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs
|
|
|
|
|
bool "Include simple-obfs (Shadowsocks plugin)"
|
|
|
|
|
default n
|
2019-08-05 00:20:10 +08:00
|
|
|
|
2019-11-02 10:02:03 +08:00
|
|
|
endmenu
|
2019-08-03 00:02:17 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define Package/$(PKG_NAME)
|
2019-12-14 20:20:15 +08:00
|
|
|
CATEGORY:=LuCI
|
2019-08-05 00:58:52 +08:00
|
|
|
SUBMENU:=3. Applications
|
2020-02-27 18:00:08 +08:00
|
|
|
TITLE:=LuCI support for PassWall
|
2019-08-03 00:02:17 +08:00
|
|
|
PKGARCH:=all
|
2020-03-08 15:21:55 +08:00
|
|
|
DEPENDS:=+libmbedtls +iptables-mod-tproxy +ip +ipset +coreutils +coreutils-base64 +coreutils-nohup +luci-lib-jsonc \
|
2020-07-05 20:19:28 +08:00
|
|
|
+curl +ca-certificates +resolveip +unzip +dnsmasq-full +tcping +libuci-lua \
|
2019-12-14 18:01:26 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ipt2socks:ipt2socks \
|
2019-08-03 00:02:17 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
2020-07-05 20:19:28 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-local \
|
2019-08-03 00:02:17 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-alt \
|
2020-07-05 20:19:28 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-ssr-local \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
|
2019-08-03 00:02:17 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
2020-07-17 20:21:32 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan-plus \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO:trojan-go \
|
2019-08-03 00:02:17 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Brook:brook \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_kcptun:kcptun-client \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_haproxy:haproxy \
|
2019-12-28 20:45:37 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \
|
2019-08-03 00:02:17 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_pdnsd:pdnsd-alt \
|
2020-02-11 23:40:23 +08:00
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_dns2socks:dns2socks \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin:v2ray-plugin \
|
|
|
|
|
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs:simple-obfs
|
2019-08-03 00:02:17 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
|
endef
|
|
|
|
|
|
2020-02-27 18:00:08 +08:00
|
|
|
define Package/$(PKG_NAME)/conffiles
|
|
|
|
|
/etc/config/passwall
|
2020-07-05 20:19:28 +08:00
|
|
|
/etc/config/passwall_server
|
2020-02-27 18:00:08 +08:00
|
|
|
/usr/share/passwall/rules/blacklist_host
|
|
|
|
|
/usr/share/passwall/rules/blacklist_ip
|
|
|
|
|
/usr/share/passwall/rules/whitelist_host
|
|
|
|
|
/usr/share/passwall/rules/whitelist_ip
|
|
|
|
|
endef
|
|
|
|
|
|
2019-08-03 00:02:17 +08:00
|
|
|
define Package/$(PKG_NAME)/install
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
|
$(INSTALL_CONF) ./root/etc/config/passwall $(1)/etc/config/passwall
|
2020-07-05 20:19:28 +08:00
|
|
|
$(INSTALL_CONF) ./root/etc/config/passwall_server $(1)/etc/config/passwall_server
|
2019-12-07 17:12:35 +08:00
|
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
2019-08-03 00:02:17 +08:00
|
|
|
$(INSTALL_BIN) ./root/etc/init.d/passwall $(1)/etc/init.d/passwall
|
2020-07-05 20:19:28 +08:00
|
|
|
$(INSTALL_BIN) ./root/etc/init.d/passwall_server $(1)/etc/init.d/passwall_server
|
|
|
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
|
|
|
|
$(INSTALL_CONF) ./root/etc/uci-defaults/* $(1)/etc/uci-defaults
|
2019-12-07 17:12:35 +08:00
|
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/passwall
|
|
|
|
|
cp -pR ./root/usr/share/passwall/* $(1)/usr/share/passwall
|
2020-07-05 20:19:28 +08:00
|
|
|
$(INSTALL_CONF) ./root/etc/config/passwall $(1)/usr/share/passwall/config.default
|
|
|
|
|
|
2019-08-03 00:02:17 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
|
|
|
|
|
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci/
|
2019-12-07 17:12:35 +08:00
|
|
|
|
2019-08-03 00:02:17 +08:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
2020-01-15 01:50:56 +08:00
|
|
|
po2lmo ./po/zh-cn/passwall.po $(1)/usr/lib/lua/luci/i18n/passwall.zh-cn.lmo
|
2019-08-03 00:02:17 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define Package/$(PKG_NAME)/postinst
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
chmod a+x $${IPKG_INSTROOT}/usr/share/passwall/* >/dev/null 2>&1
|
2020-07-05 20:19:28 +08:00
|
|
|
chmod a+x $${IPKG_INSTROOT}/usr/lib/lua/luci/model/cbi/passwall/server/api/app.lua >/dev/null 2>&1
|
|
|
|
|
touch $${IPKG_INSTROOT}/etc/config/passwall_show >/dev/null 2>&1
|
2019-08-03 00:02:17 +08:00
|
|
|
exit 0
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|