unbound: update to version 1.17.1
[feed/packages.git] / net / xray-core / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=xray-core
4 PKG_VERSION:=1.7.2
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
8 PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
9 PKG_HASH:=e35824e19e8acc06296ce6bfa78a14a6f3ee8f42a965f7762b7056b506457a29
10
11 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
12 PKG_LICENSE:=MPL-2.0
13 PKG_LICENSE_FILES:=LICENSE
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION)
16 PKG_BUILD_DEPENDS:=golang/host
17 PKG_BUILD_PARALLEL:=1
18 PKG_USE_MIPS16:=0
19
20 GO_PKG:=github.com/xtls/xray-core
21 GO_PKG_BUILD_PKG:=github.com/xtls/xray-core/main
22 GO_PKG_LDFLAGS_X:= \
23 $(GO_PKG)/core.build=OpenWrt \
24 $(GO_PKG)/core.version=$(PKG_VERSION)
25
26 include $(INCLUDE_DIR)/package.mk
27 include ../../lang/golang/golang-package.mk
28
29 define Package/xray/template
30 TITLE:=A platform for building proxies to bypass network restrictions
31 SECTION:=net
32 CATEGORY:=Network
33 URL:=https://xtls.github.io
34 endef
35
36 define Package/xray-core
37 $(call Package/xray/template)
38 DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
39 endef
40
41 define Package/xray-example
42 $(call Package/xray/template)
43 TITLE+= (example configs)
44 DEPENDS:=xray-core
45 PKGARCH:=all
46 endef
47
48 define Package/xray/description
49 Xray, Penetrates Everything. It helps you to build your own computer network.
50 It secures your network connections and thus protects your privacy.
51 endef
52
53 define Package/xray-core/description
54 $(call Package/xray/description)
55 endef
56
57 define Package/xray-example/description
58 $(call Package/xray/description)
59
60 This includes example configuration files for xray-core.
61 endef
62
63 define Package/xray-core/conffiles
64 /etc/xray/
65 /etc/config/xray
66 endef
67
68 define Package/xray-core/install
69 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
70 $(INSTALL_DIR) $(1)/usr/bin/
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/xray
72
73 $(INSTALL_DIR) $(1)/etc/xray/
74 $(INSTALL_DATA) $(CURDIR)/files/config.json.example $(1)/etc/xray/
75
76 $(INSTALL_DIR) $(1)/etc/config/
77 $(INSTALL_CONF) $(CURDIR)/files/xray.conf $(1)/etc/config/xray
78 $(INSTALL_DIR) $(1)/etc/init.d/
79 $(INSTALL_BIN) $(CURDIR)/files/xray.init $(1)/etc/init.d/xray
80 endef
81
82 define Package/xray-example/install
83 $(INSTALL_DIR) $(1)/etc/xray/
84 $(INSTALL_DATA) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/
85 $(INSTALL_DATA) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/
86 endef
87
88 $(eval $(call BuildPackage,xray-core))
89 $(eval $(call BuildPackage,xray-example))