1 # SPDX-License-Identifier: GPL-3.0-only
3 # Copyright (C) 2021-2022 ImmortalWrt.org
5 include $(TOPDIR
)/rules.mk
11 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
12 PKG_SOURCE_URL
:=https
://codeload.github.com
/v2fly
/v2ray-core
/tar.gz
/v
$(PKG_VERSION
)?
13 PKG_HASH
:=461a65a1675f17ad95a2a5ddf0b016247a34aa376ed1738c143e7c6603ab4abd
16 PKG_LICENSE_FILES
:=LICENSE
17 PKG_MAINTAINER
:=Tianling Shen
<cnsztl@immortalwrt.org
>
19 PKG_BUILD_DEPENDS
:=golang
/host
21 PKG_BUILD_FLAGS
:=no-mips16
23 GO_PKG
:=github.com
/v2fly
/v2ray-core
/v5
24 GO_PKG_BUILD_PKG
:=$(GO_PKG
)/main
26 $(GO_PKG
).build
=OpenWrt \
27 $(GO_PKG
).version
=$(PKG_VERSION
)
29 include $(INCLUDE_DIR
)/package.mk
30 include ..
/..
/lang
/golang
/golang-package.mk
32 define Package
/v2ray
/template
33 TITLE
:=A platform for building proxies to bypass network restrictions
36 URL
:=https
://www.v2fly.org
39 define Package
/v2ray-core
40 $(call Package
/v2ray
/template
)
41 DEPENDS
:=$(GO_ARCH_DEPENDS
) +ca-bundle
44 define Package
/v2ray-example
45 $(call Package
/v2ray
/template
)
46 TITLE
+= (example configs
)
51 define Package
/v2ray-extra
52 $(call Package
/v2ray
/template
)
53 TITLE
+= (extra resources
)
58 define Package
/v2ray
/description
59 Project V is a set of network tools that help you to build your own computer network.
60 It secures your network connections and thus protects your privacy.
63 define Package
/v2ray-core
/description
64 $(call Package
/v2ray
/description
)
67 define Package
/v2ray-example
/description
68 $(call Package
/v2ray
/description
)
70 This includes example configuration files for v2ray-core.
73 define Package
/v2ray-extra
/description
74 $(call Package
/v2ray
/description
)
76 This includes extra resources for v2ray-core.
79 define Package
/v2ray-core
/conffiles
84 define Package
/v2ray-core
/install
85 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
86 $(INSTALL_DIR
) $(1)/usr
/bin
/
87 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/main
$(1)/usr
/bin
/v2ray
89 $(INSTALL_DIR
) $(1)/etc
/v2ray
/
90 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/release
/config
/config.json
$(1)/etc
/v2ray
/
92 $(INSTALL_DIR
) $(1)/etc
/config
/
93 $(INSTALL_CONF
) $(CURDIR
)/files
/v2ray.conf
$(1)/etc
/config
/v2ray
94 $(INSTALL_DIR
) $(1)/etc
/init.d
/
95 $(INSTALL_BIN
) $(CURDIR
)/files
/v2ray.init
$(1)/etc
/init.d
/v2ray
98 define Package
/v2ray-example
/install
99 $(INSTALL_DIR
) $(1)/etc
/v2ray
/
100 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/release
/config
/vpoint_socks_vmess.json
$(1)/etc
/v2ray
/
101 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/release
/config
/vpoint_vmess_freedom.json
$(1)/etc
/v2ray
/
104 define Package
/v2ray-extra
/install
105 $(INSTALL_DIR
) $(1)/usr
/share
/v2ray
/
106 $(CP
) $(PKG_BUILD_DIR
)/release
/extra
/* $(1)/usr
/share
/v2ray
/
109 $(eval
$(call BuildPackage
,v2ray-core
))
110 $(eval
$(call BuildPackage
,v2ray-example
))
111 $(eval
$(call BuildPackage
,v2ray-extra
))