-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathMakefile
92 lines (74 loc) · 2.83 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
include $(TOPDIR)/rules.mk
PKG_NAME:=xunlei
PKG_VERSION:=3.5.2-8
PKG_LICENSE:=MIT
PKG_MAINTAINER:=gngpp <[email protected]>
PKG_SOURCE:=xunlei-openwrt-$(PKG_VERSION)-$(ARCH).tar.gz
PKG_SOURCE_URL:=https://github.com/gngpp/nas-xunlei/releases/download/v$(PKG_VERSION)/
PKG_HASH:=skip
STRIP:=false
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=nas-xunlei
DEPENDS:=@(aarch64||x86_64)
URL:=https://nas.xunlei.com/
endef
define Package/$(PKG_NAME)/description
Synology Nas Thunder runs on OpenWrt
endef
define Download/sha256sum
FILE:=$(PKG_SOURCE).sha256
URL_FILE:=$(FILE)
URL:=$(PKG_SOURCE_URL)
HASH:=skip
endef
$(eval $(call Download,sha256sum))
define Build/Prepare
mv $(DL_DIR)/$(PKG_SOURCE).sha256 .
cp $(DL_DIR)/$(PKG_SOURCE) .
shasum -a 256 -c $(PKG_SOURCE).sha256
rm $(PKG_SOURCE).sha256 $(PKG_SOURCE)
tar -xvf $(DL_DIR)/$(PKG_SOURCE)
mv xunlei-openwrt-$(PKG_VERSION)-$(ARCH)/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
echo "nas-xunlei using precompiled binary."
endef
define Package/$(PKG_NAME)/postrm
#!/bin/sh
rm -rf /usr/share/xunlei
rm -rf /usr/syno/synoman/webman/modules
exit 0
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
/etc/init.d/xunlei disable && /etc/init.d/xunlei enable
exit 0
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/xunlei $(1)/usr/bin/xunlei
$(INSTALL_DIR) $(1)/usr/share/xunlei
$(INSTALL_DIR) $(1)/usr/share/xunlei/target
$(INSTALL_DIR) $(1)/usr/share/xunlei/target/host
$(CP) $(PKG_BUILD_DIR)/bin/* $(1)/usr/share/xunlei/target/
$(INSTALL_DIR) $(1)/usr/syno/synoman/webman/modules
$(INSTALL_DIR) $(1)/usr/share/xunlei/target/host/etc
$(INSTALL_DIR) $(1)/usr/share/xunlei/target/host/usr/syno/synoman/webman/modules
$(INSTALL_BIN) $(CURDIR)/files/synoinfo.conf $(1)/usr/share/xunlei/target/host/etc/synoinfo.conf
$(INSTALL_BIN) $(CURDIR)/files/authenticate.cgi $(1)/usr/share/xunlei/target/host/usr/syno/synoman/webman/modules/authenticate.cgi
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(CURDIR)/files/xunlei.init $(1)/etc/init.d/xunlei
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(CURDIR)/files/xunlei.config $(1)/etc/config/xunlei
$(INSTALL_DIR) $(1)/usr/share/xunlei/target/host/exploit
$(INSTALL_BIN) $(CURDIR)/exploit/libc.so.6 $(1)/usr/share/xunlei/target/host/exploit/libc.so.6
$(INSTALL_BIN) $(CURDIR)/exploit/libdl.so.2 $(1)/usr/share/xunlei/target/host/exploit/libdl.so.2
$(INSTALL_BIN) $(CURDIR)/exploit/libm.so.6 $(1)/usr/share/xunlei/target/host/exploit/libm.so.6
$(INSTALL_BIN) $(CURDIR)/exploit/libstdc++.so.6 $(1)/usr/share/xunlei/target/host/exploit/libstdc++.so.6
$(INSTALL_BIN) $(CURDIR)/exploit/libpthread.so.0 $(1)/usr/share/xunlei/target/host/exploit/libpthread.so.0
endef
$(eval $(call BuildPackage,$(PKG_NAME)))