From nobody Mon Feb 19 23:09:55 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdytC3CMcz59hJc; Mon, 19 Feb 2024 23:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdytC2TWGz4dPy; Mon, 19 Feb 2024 23:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708384195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FTscnNuLZVOpHI0XpO30WwrOflWnU28w1jACbK+Ys/g=; b=vpSwhhal6Wno4ZtbW5T/fDFpW9KnHCFDeqp9JH9NvZqi8gvy5eQIs13NGty8Sj2pRRb0IG m8++fQ61BmpwvHDwX4MSC9zFMGFoxgEGEE2addbTVDtPNQRFa01dgqLEXq92rnksCLdeUl Geih5oeQBLHnS00G7UV7VF5EWbRwkDJA9yldzP160v/Te/3ofm1ozUNbC11SzXJc1YTV2k C9t14VFxqBLqfHuoSioZUXUqB7R8CEBDW5DQmCeF7uQOWV3g6MTuaJtv7ANUF21e/1W0nJ VI6xUu8eAA+Qx3MapcoC56uLgYQWYPrcaQHb2hc+nIOSLkW1Ba05bkiMYgYElw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708384195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FTscnNuLZVOpHI0XpO30WwrOflWnU28w1jACbK+Ys/g=; b=AcOEquetCoujjJ7gix7vbPK1idkVOe14Jx9IPfLEaicttzrVCxW7xI5WduLhfeje0YcTJ0 shXHfYeBIc7HMTIKQQy9r0rPlPYlsmxHyZELJnVcBNs2aiDvtyz5tGMlh54QM8O0Br/N6i VYhNLF0XBjiCwpHm+uISwW9diz+feGDPSm3anPn/QQk3nIZJ0P67xyOPSiEaofJBcFHpLw t44Tx84juBuHBA/KZdSOT2BWQPBbZgQh/oGbz9F5zquYjapYXzyN+on9JJKxq9gBFTf+Bz PL4Jh3/06PA5WGjRXF8pdMbYpObP4OYePpaaPLpiPclRj0hSBUlAvXQhSqe63Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708384195; a=rsa-sha256; cv=none; b=vz0Q1K2UaLdZrxxTF1UxnWyTCkXpuVvJfUVzi3C8bTkDbRIdw0TFGtaMBGktsTU++odeLZ QpSbkRc4MaFS1yX7YZ+y6VtbPQYE2AVirfk7eJcTIF941FrKqtCuNAQNaXGXVG5EoZu8wq cmO4kxT6hh39DjQZmn2mT87wGotsqjYXMsHU808mrTr4ytnYgL2e4psGluqBnn2vIPOQjl otJhYttRVtlkZGMC2LfBx0jdNSEezXbo5aKkxMVP7K1XeziUiBM6alLJgRaC/HYtqeEfsX hYpJYQrtwsZc5zau83gxdGicf5/712VltBmO/UQzm7H1mBg2CDyXGRUYg3NnCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdytC1XStztxg; Mon, 19 Feb 2024 23:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JN9ttx038371; Mon, 19 Feb 2024 23:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JN9tRi038368; Mon, 19 Feb 2024 23:09:55 GMT (envelope-from git) Date: Mon, 19 Feb 2024 23:09:55 GMT Message-Id: <202402192309.41JN9tRi038368@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 1c86bd3eab08 - main - net/shadowsocks-rust: Add RC scripts and config file List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c86bd3eab08028106a5ca3e59cba5187ee596c9 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=1c86bd3eab08028106a5ca3e59cba5187ee596c9 commit 1c86bd3eab08028106a5ca3e59cba5187ee596c9 Author: Yuri Victorovich AuthorDate: 2024-02-19 23:08:20 +0000 Commit: Yuri Victorovich CommitDate: 2024-02-19 23:09:53 +0000 net/shadowsocks-rust: Add RC scripts and config file Suggested by: Matthias Fechner --- net/shadowsocks-rust/Makefile | 12 ++++++----- net/shadowsocks-rust/files/sslocal-rust.in | 33 +++++++++++++++++++++++++++++ net/shadowsocks-rust/files/ssserver-rust.in | 33 +++++++++++++++++++++++++++++ net/shadowsocks-rust/pkg-plist | 6 ++++++ 4 files changed, 79 insertions(+), 5 deletions(-) diff --git a/net/shadowsocks-rust/Makefile b/net/shadowsocks-rust/Makefile index 37bf97862d73..ca51eba183ca 100644 --- a/net/shadowsocks-rust/Makefile +++ b/net/shadowsocks-rust/Makefile @@ -1,7 +1,7 @@ PORTNAME= shadowsocks-rust DISTVERSIONPREFIX= v DISTVERSION= 1.18.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MAINTAINER= yuri@FreeBSD.org @@ -12,6 +12,8 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= cargo +USE_RC_SUBR= sslocal-rust \ + ssserver-rust USE_GITHUB= yes GH_ACCOUNT= shadowsocks @@ -411,13 +413,13 @@ OPENSSLLIB= /usr/lib EXECUTABLES= sslocal ssmanager ssserver ssservice ssurl -.for e in ${EXECUTABLES} -PLIST_FILES+= bin/${e} -.endfor - post-install: + # strip binaries .for e in ${EXECUTABLES} @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${e} .endfor + # install config file + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKSRC}/examples/config.json ${STAGEDIR}${ETCDIR}/config.json.sample .include diff --git a/net/shadowsocks-rust/files/sslocal-rust.in b/net/shadowsocks-rust/files/sslocal-rust.in new file mode 100644 index 000000000000..b27fa7e949cc --- /dev/null +++ b/net/shadowsocks-rust/files/sslocal-rust.in @@ -0,0 +1,33 @@ +#!/bin/sh + +# PROVIDE: sslocal_rust +# REQUIRE: NETWORKING SERVERS +# +# Add the following lines to /etc/rc.conf to run sslocal: +# sslocal_rust_enable (bool): Set it to "YES" to enable sslocal. +# Default is "NO". +# sslocal_rust_args (string): Set it to the desired arguments to run sslocal. +# Default is "-c %%ETCDIR%%/config.json". +# + +. /etc/rc.subr + +name="sslocal_rust" +rcvar=sslocal_rust_enable + +pidfile="/var/run/${name}.pid" +logfile="/var/log/${name}.log" + +: ${sslocal_rust_enable="NO"} +: ${sslocal_rust_args="-c %%ETCDIR%%/config.json"} + +procname=%%PREFIX%%/bin/sslocal +command="/usr/sbin/daemon" +command_args="-f -S \ + -p ${pidfile} \ + -o ${logfile} \ + -t ${name}_sslocal \ + %%PREFIX%%/bin/sslocal $sslocal_rust_args" + +load_rc_config $name +run_rc_command "$1" diff --git a/net/shadowsocks-rust/files/ssserver-rust.in b/net/shadowsocks-rust/files/ssserver-rust.in new file mode 100644 index 000000000000..24bee1855a2e --- /dev/null +++ b/net/shadowsocks-rust/files/ssserver-rust.in @@ -0,0 +1,33 @@ +#!/bin/sh + +# PROVIDE: ssserver_rust +# REQUIRE: NETWORKING SERVERS +# +# Add the following lines to /etc/rc.conf to run ssserver: +# ssserver_rust_enable (bool): Set it to "YES" to enable ssserver. +# Default is "NO". +# ssserver_rust_args (string): Set it to the desired arguments to run ssserver. +# Default is "-c %%ETCDIR%%/config.json". +# + +. /etc/rc.subr + +name="ssserver_rust" +rcvar=ssserver_rust_enable + +pidfile="/var/run/${name}.pid" +logfile="/var/log/${name}.log" + +: ${ssserver_rust_enable="NO"} +: ${ssserver_rust_args="-c %%ETCDIR%%/config.json"} + +procname=%%PREFIX%%/bin/ssserver +command="/usr/sbin/daemon" +command_args="-f -S \ + -p ${pidfile} \ + -o ${logfile} \ + -t ${name}_ssserver \ + %%PREFIX%%/bin/ssserver $ssserver_rust_args" + +load_rc_config $name +run_rc_command "$1" diff --git a/net/shadowsocks-rust/pkg-plist b/net/shadowsocks-rust/pkg-plist new file mode 100644 index 000000000000..86c406291454 --- /dev/null +++ b/net/shadowsocks-rust/pkg-plist @@ -0,0 +1,6 @@ +bin/sslocal +bin/ssmanager +bin/ssserver +bin/ssservice +bin/ssurl +@sample %%ETCDIR%%/config.json.sample