-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
76 lines (58 loc) · 1.98 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
# Copyright 2024 ZeroChaos (https://github.com/zerolabnet/ssclash)
# This is free software, licensed under the GNU General Public License v2.
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssclash
PKG_VERSION:=1.8.1
PKG_RELEASE:=1
PKG_MAINTAINER:=ZeroChaos <[email protected]>
LUCI_TITLE:=LuCI Support for SSClash
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=$(LUCI_TITLE)
DEPENDS:=$(LUCI_DEPENDS)
PKGARCH:=$(LUCI_PKGARCH)
endef
define Package/$(PKG_NAME)/description
LuCI interface for SSClash, a tool for managing and configuring Clash.
endef
define Build/Prepare
# No preparation steps required
endef
define Build/Compile
# No compilation steps required
endef
define Package/$(PKG_NAME)/conffiles
/opt/clash/config.yaml
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./rootfs/etc/init.d/clash $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/opt/clash/bin
$(INSTALL_BIN) ./rootfs/opt/clash/bin/clash-rules $(1)/opt/clash/bin/
$(INSTALL_DIR) $(1)/opt/clash
$(INSTALL_DATA) ./rootfs/opt/clash/config.yaml $(1)/opt/clash/
$(INSTALL_BIN) ./rootfs/opt/clash/nft.conf $(1)/opt/clash/
$(INSTALL_DIR) $(1)/opt/clash/ui
$(CP) ./rootfs/opt/clash/ui/* $(1)/opt/clash/ui/
$(INSTALL_DIR) $(1)/usr/share/luci/menu.d
$(INSTALL_DATA) ./rootfs/usr/share/luci/menu.d/luci-app-ssclash.json $(1)/usr/share/luci/menu.d/
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) ./rootfs/usr/share/rpcd/acl.d/luci-app-ssclash.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_DIR) $(1)/www/luci-static/resources/view/ssclash
$(CP) ./rootfs/www/luci-static/resources/view/ssclash/* $(1)/www/luci-static/resources/view/ssclash/
endef
define Package/$(PKG_NAME)/postrm
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || {
rm -rf /opt/clash/ui
rm -f /opt/clash/ruleset
rm -rf /tmp/clash
rm -rf /www/luci-static/resources/view/ssclash
}
endef
$(eval $(call BuildPackage,$(PKG_NAME)))