1 include $(TOPDIR
)/rules.mk
5 PKG_RELEASE
:=$(AUTORELEASE
)
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
:=0cce205187a38d7e13dc4e503e9a8667c9cf438844e091bd91989aaac8f2c411
11 PKG_MAINTAINER
:=Tianling Shen
<cnsztl@immortalwrt.org
>
13 PKG_LICENSE_FILES
:=LICENSE
15 PKG_BUILD_DIR
:=$(BUILD_DIR
)/Xray-core-
$(PKG_VERSION
)
16 PKG_BUILD_DEPENDS
:=golang
/host
20 GO_PKG
:=github.com
/xtls
/xray-core
21 GO_PKG_BUILD_PKG
:=github.com
/xtls
/xray-core
/main
23 $(GO_PKG
)/core.build
=OpenWrt \
24 $(GO_PKG
)/core.version
=$(PKG_VERSION
)
26 include $(INCLUDE_DIR
)/package.mk
27 include ..
/..
/lang
/golang
/golang-package.mk
29 define Package
/xray
/template
30 TITLE
:=A platform for building proxies to bypass network restrictions
33 URL
:=https
://xtls.github.io
36 define Package
/xray-core
37 $(call Package
/xray
/template
)
38 DEPENDS
:=$(GO_ARCH_DEPENDS
) +ca-bundle
41 define Package
/xray-example
42 $(call Package
/xray
/template
)
43 TITLE
+= (example configs
)
48 define Package
/xray-geodata
49 $(call Package
/xray
/template
)
50 TITLE
+= (geodata files
)
55 define Package
/xray
/description
56 Xray
, Penetrates Everything. It helps you to build your own computer network.
57 It secures your network connections and thus protects your privacy.
60 define Package
/xray-core
/description
61 $(call Package
/xray
/description
)
64 define Package
/xray-example
/description
65 $(call Package
/xray
/description
)
67 This includes example configuration files for xray-core.
70 define Package
/xray-geodata
/description
71 $(call Package
/xray
/description
)
73 This includes GEO datas used for xray-core.
76 define Package
/xray-core
/conffiles
81 GEOIP_VER
:=202208250104
82 GEOIP_FILE
:=geoip.dat.
$(GEOIP_VER
)
84 URL
:=https
://github.com
/v2fly
/geoip
/releases
/download
/$(GEOIP_VER
)/
87 HASH
:=8fadefdcbb973c5294f81a2142ffcfb0d138e6f8285e643f929d2fe035096075
90 GEOSITE_VER
:=20220829045350
91 GEOSITE_FILE
:=dlc.dat.
$(GEOSITE_VER
)
92 define Download
/geosite
93 URL
:=https
://github.com
/v2fly
/domain-list-community
/releases
/download
/$(GEOSITE_VER
)/
96 HASH
:=107a52601a94baf02fe0d877f0a0f469606c87b9a0df2b7569630004dcb8f86e
100 $(call Build
/Prepare
/Default
)
101 ifneq ($(CONFIG_PACKAGE_xray-geodata
),)
102 $(call Download
,geoip
)
103 $(call Download
,geosite
)
107 define Package
/xray-core
/install
108 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
109 $(INSTALL_DIR
) $(1)/usr
/bin
/
110 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/main
$(1)/usr
/bin
/xray
112 $(INSTALL_DIR
) $(1)/etc
/xray
/
113 $(INSTALL_DATA
) $(CURDIR
)/files
/config.json.example
$(1)/etc
/xray
/
115 $(INSTALL_DIR
) $(1)/etc
/config
/
116 $(INSTALL_CONF
) $(CURDIR
)/files
/xray.conf
$(1)/etc
/config
/xray
117 $(INSTALL_DIR
) $(1)/etc
/init.d
/
118 $(INSTALL_BIN
) $(CURDIR
)/files
/xray.init
$(1)/etc
/init.d
/xray
121 define Package
/xray-example
/install
122 $(INSTALL_DIR
) $(1)/etc
/xray
/
123 $(INSTALL_DATA
) $(CURDIR
)/files
/vpoint_socks_vmess.json
$(1)/etc
/xray
/
124 $(INSTALL_DATA
) $(CURDIR
)/files
/vpoint_vmess_freedom.json
$(1)/etc
/xray
/
127 define Package
/xray-geodata
/install
128 $(INSTALL_DIR
) $(1)/usr
/share
/xray
/
129 $(INSTALL_DATA
) $(DL_DIR
)/$(GEOIP_FILE
) $(1)/usr
/share
/xray
/geoip.dat
130 $(INSTALL_DATA
) $(DL_DIR
)/$(GEOSITE_FILE
) $(1)/usr
/share
/xray
/geosite.dat
133 $(eval
$(call BuildPackage
,xray-core
))
134 $(eval
$(call BuildPackage
,xray-example
))
135 $(eval
$(call BuildPackage
,xray-geodata
))