169 lines
4.9 KiB
Makefile
Raw Normal View History

2020-08-20 20:18:25 +08:00
# Copyright (C) 2018-2020 L-WRT Team
# Copyright (C) 2021 xiaorouji
2020-02-01 02:36:42 +08:00
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
2020-12-05 18:54:30 +08:00
PKG_VERSION:=4
PKG_RELEASE:=12
PKG_DATE:=20210127
2020-02-01 02:36:42 +08:00
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/config
menu "Configuration"
2020-12-13 00:53:57 +08:00
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
bool "Include Shadowsocks"
2020-09-05 06:18:34 +08:00
default y
2020-12-13 00:53:57 +08:00
2020-09-08 12:19:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server
bool "Include Shadowsocks Server"
default y
2020-12-13 00:53:57 +08:00
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR
bool "Include ShadowsocksR"
2020-02-01 02:36:42 +08:00
default y
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
bool "Include ShadowsocksR Server"
default y
2020-12-13 00:53:57 +08:00
2020-12-05 18:54:30 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
bool "Include Xray"
default y if i386||x86_64||arm||aarch64
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
bool "Include V2ray"
2020-12-05 18:54:30 +08:00
default n
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Plus
bool "Include Trojan_Plus"
default y
2020-12-13 00:53:57 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO
bool "Include Trojan_GO"
2020-09-05 06:18:34 +08:00
default y if i386||x86_64||arm||aarch64
2020-12-13 00:53:57 +08:00
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_Brook
bool "Include Brook"
default n
2020-12-05 18:54:30 +08:00
2020-09-19 00:40:51 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy
bool "Include NaiveProxy"
default n
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_kcptun
bool "Include kcptun"
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_haproxy
bool "Include haproxy"
default y
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG
bool "Include ChinaDNS-NG"
2020-09-05 06:18:34 +08:00
default n
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_dns2socks
bool "Include dns2socks"
2020-09-05 06:18:34 +08:00
default n
2020-12-05 18:54:30 +08:00
2020-02-11 23:44:29 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin
bool "Include v2ray-plugin (Shadowsocks plugin)"
2020-09-05 06:18:34 +08:00
default y if i386||x86_64||arm||aarch64
2020-02-11 23:44:29 +08:00
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs
bool "Include simple-obfs (Shadowsocks plugin)"
2020-09-05 06:18:34 +08:00
default y if i386||x86_64||arm||aarch64
2020-02-01 02:36:42 +08:00
endmenu
endef
define Package/$(PKG_NAME)
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI support for PassWall
2020-02-01 02:36:42 +08:00
PKGARCH:=all
DEPENDS:=+libmbedtls +iptables-mod-tproxy +ip +ipset +coreutils +coreutils-base64 +coreutils-nohup +luci-lib-jsonc \
+curl +ca-certificates +resolveip +unzip +dnsmasq-full +tcping +libuci-lua \
2020-09-05 06:18:34 +08:00
+ipt2socks \
2020-09-30 20:04:34 +08:00
+microsocks \
2020-09-05 06:18:34 +08:00
+pdnsd-alt \
2020-02-01 02:36:42 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-local \
2020-09-08 12:19:42 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server:shadowsocks-libev-ss-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-ssr-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-ssr-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-ssr-server \
2020-12-05 18:54:30 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Plus:trojan-plus \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO:trojan-go \
2020-09-19 00:40:51 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \
2020-02-01 02:36:42 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_Brook:brook \
+PACKAGE_$(PKG_NAME)_INCLUDE_kcptun:kcptun-client \
+PACKAGE_$(PKG_NAME)_INCLUDE_haproxy:haproxy \
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \
2020-02-11 23:44:29 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_dns2socks:dns2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs:simple-obfs
2020-02-01 02:36:42 +08:00
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/passwall
/etc/config/passwall_server
2020-12-13 00:53:57 +08:00
/usr/share/passwall/rules/direct_host
/usr/share/passwall/rules/direct_ip
/usr/share/passwall/rules/proxy_host
/usr/share/passwall/rules/proxy_ip
endef
2020-02-01 02:36:42 +08:00
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./root/etc/config/passwall $(1)/etc/config/passwall
$(INSTALL_CONF) ./root/etc/config/passwall_server $(1)/etc/config/passwall_server
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./root/etc/init.d/passwall $(1)/etc/init.d/passwall
$(INSTALL_BIN) ./root/etc/init.d/passwall_server $(1)/etc/init.d/passwall_server
2020-12-05 18:54:30 +08:00
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_CONF) ./root/etc/uci-defaults/* $(1)/etc/uci-defaults
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
$(INSTALL_DIR) $(1)/usr/share/passwall
cp -pR ./root/usr/share/passwall/* $(1)/usr/share/passwall
$(INSTALL_CONF) ./root/etc/config/passwall $(1)/usr/share/passwall/config.default
2020-12-05 18:54:30 +08:00
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
cp -pR ./root/usr/share/rpcd/acl.d/* $(1)/usr/share/rpcd/acl.d
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci/
2020-12-05 18:54:30 +08:00
2020-02-01 02:36:42 +08:00
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
2020-02-10 13:06:06 +08:00
po2lmo ./po/zh_Hans/passwall.po $(1)/usr/lib/lua/luci/i18n/passwall.zh-cn.lmo
2020-02-01 02:36:42 +08:00
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
chmod a+x $${IPKG_INSTROOT}/usr/share/passwall/* >/dev/null 2>&1
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
2020-02-01 02:36:42 +08:00
exit 0
endef
$(eval $(call BuildPackage,$(PKG_NAME)))