immortalwrt/package/lienol/luci-app-passwall/Makefile

159 lines
4.5 KiB
Makefile
Raw Normal View History

2019-12-21 19:32:02 +08:00
# Copyright (C) 2018-2020 Lienol <lawlienol@gmail.com>
2019-08-03 00:02:17 +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
PKG_VERSION:=3.9
PKG_RELEASE:=19
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
bool "Include Shadowsocks"
2019-08-03 00:02:17 +08:00
default n
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR
bool "Include ShadowsocksR"
2019-08-03 00:02:17 +08:00
default y
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
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
config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG
bool "Include ChinaDNS-NG"
2019-08-03 00:02:17 +08:00
default y
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"
default y
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
TITLE:=LuCI support for PassWall
2019-08-03 00:02:17 +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 \
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 \
+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 \
+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 \
+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 \
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \
2019-08-03 00:02:17 +08:00
+PACKAGE_$(PKG_NAME)_INCLUDE_pdnsd:pdnsd-alt \
+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
define Package/$(PKG_NAME)/conffiles
/etc/config/passwall
/etc/config/passwall_server
/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
$(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
$(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
$(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
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)))