svn commit: r500991 - in head: . net net/v2ray net/v2ray/files
Fukang Chen
loader at FreeBSD.org
Wed May 8 03:23:32 UTC 2019
Author: loader
Date: Wed May 8 03:23:29 2019
New Revision: 500991
URL: https://svnweb.freebsd.org/changeset/ports/500991
Log:
[NEW PORT]: net/v2ray: Platform for building proxies to bypass network restrictions
Project V is a set of network tools that help you to build your
own computer network. It secures your network connections and
thus protects your privacy.
WWW: https://www.v2ray.com
PR: 235418
Submitted by: Yanhui Shen <shen.elf at gmail.com>
Reviewed by: koobs, mat
Approved by: koobs (mentor)
Differential Revision: https://reviews.freebsd.org/D19066
Added:
head/net/v2ray/
head/net/v2ray/Makefile (contents, props changed)
head/net/v2ray/distinfo (contents, props changed)
head/net/v2ray/files/
head/net/v2ray/files/v2ray.in (contents, props changed)
head/net/v2ray/pkg-descr (contents, props changed)
Modified:
head/GIDs
head/UIDs
head/net/Makefile
Modified: head/GIDs
==============================================================================
--- head/GIDs Wed May 8 02:52:22 2019 (r500990)
+++ head/GIDs Wed May 8 03:23:29 2019 (r500991)
@@ -300,7 +300,7 @@ nzbhydra2:*:355:
# free: 357
# free: 358
# free: 359
-# free: 360
+v2ray:*:360:
httptunnel:*:361:
# free: 362
# free: 363
Modified: head/UIDs
==============================================================================
--- head/UIDs Wed May 8 02:52:22 2019 (r500990)
+++ head/UIDs Wed May 8 03:23:29 2019 (r500991)
@@ -305,7 +305,7 @@ nzbhydra2:*:355:355::0:0:NZBHydra 2 Daemon:/nonexisten
# free: 357
# free: 358
# free: 359
-# free: 360
+v2ray:*:360:360::0:0:V2Ray Daemon:/nonexistent:/usr/sbin/nologin
httptunnel:*:361:361::0:0:httptunnel Daemon:/nonexistent:/usr/sbin/nologin
# free: 362
# free: 363
Modified: head/net/Makefile
==============================================================================
--- head/net/Makefile Wed May 8 02:52:22 2019 (r500990)
+++ head/net/Makefile Wed May 8 03:23:29 2019 (r500991)
@@ -1479,6 +1479,7 @@
SUBDIR += urlendec
SUBDIR += usbredir
SUBDIR += utftpd
+ SUBDIR += v2ray
SUBDIR += vblade
SUBDIR += vde
SUBDIR += vde2
Added: head/net/v2ray/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/v2ray/Makefile Wed May 8 03:23:29 2019 (r500991)
@@ -0,0 +1,53 @@
+# $FreeBSD$
+
+PORTNAME= v2ray
+PORTVERSION= 4.14.0
+CATEGORIES= net
+MASTER_SITES= https://github.com/v2ray/v2ray-core/releases/download/v${PORTVERSION}/
+DISTNAME= src_all
+DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= shen.elf at gmail.com
+COMMENT= Platform for building proxies to bypass network restrictions
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/v2ray.com/core/LICENSE
+
+USES= go zip
+
+NO_WRKSUBDIR= yes
+WRKSRC= ${WRKDIR}/src
+GO_BUILDFLAGS+= --ldflags '-s -w'
+
+USE_RC_SUBR= v2ray
+USERS= v2ray
+GROUPS= v2ray
+
+PLIST_FILES= bin/v2ray \
+ bin/v2ctl \
+ "@sample ${ETCDIR}/config.json.sample" \
+ ${ETCDIR}/vpoint_socks_vmess.json \
+ ${ETCDIR}/vpoint_vmess_freedom.json \
+ ${DATADIR}/geoip.dat \
+ ${DATADIR}/geosite.dat
+
+SUB_LIST= USER="${USERS}" \
+ GROUP="${GROUPS}"
+
+do-build:
+ @cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} build ${GO_BUILDFLAGS} -o ${GO_WRKDIR_BIN}/v2ray v2ray.com/core/main && \
+ ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} build ${GO_BUILDFLAGS} -o ${GO_WRKDIR_BIN}/v2ctl v2ray.com/ext/tools/control/main
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/v2ray ${STAGEDIR}${PREFIX}/bin/v2ray
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/v2ctl ${STAGEDIR}${PREFIX}/bin/v2ctl
+ ${INSTALL_DATA} ${WRKSRC}/v2ray.com/core/release/config/config.json ${STAGEDIR}${ETCDIR}/config.json.sample
+ ${INSTALL_DATA} ${WRKSRC}/v2ray.com/core/release/config/vpoint_socks_vmess.json ${STAGEDIR}${ETCDIR}/vpoint_socks_vmess.json
+ ${INSTALL_DATA} ${WRKSRC}/v2ray.com/core/release/config/vpoint_vmess_freedom.json ${STAGEDIR}${ETCDIR}/vpoint_vmess_freedom.json
+ ${INSTALL_DATA} ${WRKSRC}/v2ray.com/core/release/config/geoip.dat ${STAGEDIR}${DATADIR}/geoip.dat
+ ${INSTALL_DATA} ${WRKSRC}/v2ray.com/core/release/config/geosite.dat ${STAGEDIR}${DATADIR}/geosite.dat
+
+.include <bsd.port.mk>
Added: head/net/v2ray/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/v2ray/distinfo Wed May 8 03:23:29 2019 (r500991)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1549167902
+SHA256 (v2ray-4.14.0/src_all.zip) = 842a8bf2a2f5787ca854b61697a444e86928650def5bae512b99c52e95230648
+SIZE (v2ray-4.14.0/src_all.zip) = 31614054
Added: head/net/v2ray/files/v2ray.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/v2ray/files/v2ray.in Wed May 8 03:23:29 2019 (r500991)
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: v2ray
+# KEYWORD: shutdown
+
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf to enable `v2ray':
+#
+# v2ray_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable v2ray
+# v2ray_config (path): Set to "%%PREFIX%%/etc/v2ray/config.json" by default
+# Set it to the v2ray server config
+# v2ray_logdir (path): Set to "/var/log/v2ray" by default.
+# Set it to the directory of v2ray log files
+# v2ray_env (str): Set to "" by default.
+# Set it to the desired environment variables
+
+. /etc/rc.subr
+
+name="v2ray"
+rcvar="${name}_enable"
+
+: ${v2ray_enable="NO"}
+: ${v2ray_config="%%PREFIX%%/etc/$name/config.json"}
+: ${v2ray_logdir="/var/log/${name}"}
+: ${v2ray_env=""}
+: ${v2ray_user="%%USER%%"}
+: ${v2ray_group="%%GROUP%%"}
+
+asset_env="V2RAY_LOCATION_ASSET=%%PREFIX%%/share/$name"
+pidfile="/var/run/$name.pid"
+procname="%%PREFIX%%/bin/$name"
+command="/usr/sbin/daemon"
+command_args="-c -p ${pidfile} /usr/bin/env ${asset_env} ${v2ray_env} ${procname} -config ${v2ray_config}"
+required_files="${v2ray_config}"
+
+start_precmd="v2ray_startprecmd"
+
+v2ray_startprecmd() {
+ touch "${pidfile}"
+ chown ${v2ray_user}:${v2ray_group} "${pidfile}"
+ mkdir -p "${v2ray_logdir}"
+ chown -R ${v2ray_user}:${v2ray_group} "${v2ray_logdir}"
+}
+
+load_rc_config "$name"
+run_rc_command "$1"
Added: head/net/v2ray/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/v2ray/pkg-descr Wed May 8 03:23:29 2019 (r500991)
@@ -0,0 +1,5 @@
+Project V is a set of network tools that help you to build your
+own computer network. It secures your network connections and
+thus protects your privacy.
+
+WWW: https://www.v2ray.com
More information about the svn-ports-head
mailing list