public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/redsocks/files/, net-proxy/redsocks/
Date: Tue, 13 Jul 2021 20:57:29 +0000 (UTC)	[thread overview]
Message-ID: <1626209706.b122ea72d22b0aea7fa0b0ede97f3adb2f9eb41f.conikost@gentoo> (raw)

commit:     b122ea72d22b0aea7fa0b0ede97f3adb2f9eb41f
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 13 19:19:15 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Tue Jul 13 20:55:06 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b122ea72

net-proxy/redsocks: migrate to GLEP 81

Bug: https://bugs.gentoo.org/781470
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 net-proxy/redsocks/files/redsocks.init-r2          | 45 ++++++++++++++++++++++
 ...redsocks-9999.ebuild => redsocks-0.5-r2.ebuild} | 24 ++++++------
 net-proxy/redsocks/redsocks-9999.ebuild            | 24 ++++++------
 3 files changed, 67 insertions(+), 26 deletions(-)

diff --git a/net-proxy/redsocks/files/redsocks.init-r2 b/net-proxy/redsocks/files/redsocks.init-r2
new file mode 100644
index 00000000000..8ea9998a5da
--- /dev/null
+++ b/net-proxy/redsocks/files/redsocks.init-r2
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=${REDSOCKS_BINARY:=/usr/sbin/redsocks}
+: ${REDSOCKS_CONFIG:=/etc/redsocks.conf}
+pidfile=${REDSOCKS_PIDFILE:=/run/redsocks/redsocks.pid}
+command_args="-p ${pidfile} -c ${REDSOCKS_CONFIG}"
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+depend() {
+	need localmount
+	use dns
+}
+
+checkconfig() {
+	if [ ! -f "${REDSOCKS_CONFIG}" ] ; then
+		eerror "No ${REDSOCKS_CONFIG} file exists!"
+		return 1
+	fi
+
+        "${command}" -t -c ${REDSOCKS_CONFIG} || return 1
+
+	checkpath -d -o "redsocks:redsocks" -q "/run/redsocks"
+}
+
+start_pre() {
+        checkconfig || return 1
+}
+
+stop_pre() {
+        if [ "${RC_CMD}" = "restart" ] ; then
+                checkconfig || return 1
+        fi
+}
+
+reload() {
+        checkconfig || return 1
+
+        ebegin "Reloading ${SVCNAME}"
+        start-stop-daemon --signal HUP --pidfile "${pidfile}"
+        eend $?
+}

diff --git a/net-proxy/redsocks/redsocks-9999.ebuild b/net-proxy/redsocks/redsocks-0.5-r2.ebuild
similarity index 70%
copy from net-proxy/redsocks/redsocks-9999.ebuild
copy to net-proxy/redsocks/redsocks-0.5-r2.ebuild
index 187dcecd68a..5a182c79906 100644
--- a/net-proxy/redsocks/redsocks-9999.ebuild
+++ b/net-proxy/redsocks/redsocks-0.5-r2.ebuild
@@ -1,17 +1,18 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 if [[ ${PV} != *9999* ]]; then
 	SRC_URI="https://github.com/darkk/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+	S="${WORKDIR}"/"${PN}"-release-"${PV}"
 	KEYWORDS="~amd64 ~x86"
 else
 	GIT_ECLASS="git-r3"
 	EGIT_REPO_URI="https://github.com/darkk/${PN}.git"
 fi
 
-inherit systemd toolchain-funcs user ${GIT_ECLASS}
+inherit systemd toolchain-funcs ${GIT_ECLASS}
 
 DESCRIPTION="Transparent redirector of any TCP connection to proxy"
 HOMEPAGE="http://darkk.net.ru/redsocks/"
@@ -21,15 +22,12 @@ IUSE="doc"
 RESTRICT="test"
 
 DEPEND="dev-libs/libevent:0="
-RDEPEND="${DEPEND}
-	net-firewall/iptables"
-
-[[ ${PV} != *9999 ]] && S="${WORKDIR}"/"${PN}"-release-"${PV}"
-
-pkg_setup() {
-	enewgroup redsocks
-	enewuser redsocks -1 -1 /run/redsocks redsocks
-}
+RDEPEND="
+	${DEPEND}
+	acct-group/redsocks
+	acct-user/redsocks
+	net-firewall/iptables
+"
 
 src_compile() {
 	CC="$(tc-getCC)" emake
@@ -42,7 +40,7 @@ src_install() {
 	insinto /etc
 	newins debian/redsocks.conf redsocks.conf
 
-	newinitd "${FILESDIR}"/redsocks.init redsocks
+	newinitd "${FILESDIR}"/redsocks.init-r2 redsocks
 	newconfd "${FILESDIR}"/redsocks.conf redsocks
 
 	systemd_dounit "${FILESDIR}"/redsocks.service

diff --git a/net-proxy/redsocks/redsocks-9999.ebuild b/net-proxy/redsocks/redsocks-9999.ebuild
index 187dcecd68a..5a182c79906 100644
--- a/net-proxy/redsocks/redsocks-9999.ebuild
+++ b/net-proxy/redsocks/redsocks-9999.ebuild
@@ -1,17 +1,18 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 if [[ ${PV} != *9999* ]]; then
 	SRC_URI="https://github.com/darkk/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+	S="${WORKDIR}"/"${PN}"-release-"${PV}"
 	KEYWORDS="~amd64 ~x86"
 else
 	GIT_ECLASS="git-r3"
 	EGIT_REPO_URI="https://github.com/darkk/${PN}.git"
 fi
 
-inherit systemd toolchain-funcs user ${GIT_ECLASS}
+inherit systemd toolchain-funcs ${GIT_ECLASS}
 
 DESCRIPTION="Transparent redirector of any TCP connection to proxy"
 HOMEPAGE="http://darkk.net.ru/redsocks/"
@@ -21,15 +22,12 @@ IUSE="doc"
 RESTRICT="test"
 
 DEPEND="dev-libs/libevent:0="
-RDEPEND="${DEPEND}
-	net-firewall/iptables"
-
-[[ ${PV} != *9999 ]] && S="${WORKDIR}"/"${PN}"-release-"${PV}"
-
-pkg_setup() {
-	enewgroup redsocks
-	enewuser redsocks -1 -1 /run/redsocks redsocks
-}
+RDEPEND="
+	${DEPEND}
+	acct-group/redsocks
+	acct-user/redsocks
+	net-firewall/iptables
+"
 
 src_compile() {
 	CC="$(tc-getCC)" emake
@@ -42,7 +40,7 @@ src_install() {
 	insinto /etc
 	newins debian/redsocks.conf redsocks.conf
 
-	newinitd "${FILESDIR}"/redsocks.init redsocks
+	newinitd "${FILESDIR}"/redsocks.init-r2 redsocks
 	newconfd "${FILESDIR}"/redsocks.conf redsocks
 
 	systemd_dounit "${FILESDIR}"/redsocks.service


             reply	other threads:[~2021-07-13 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 20:57 Conrad Kostecki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-13 20:57 [gentoo-commits] repo/gentoo:master commit in: net-proxy/redsocks/files/, net-proxy/redsocks/ Conrad Kostecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1626209706.b122ea72d22b0aea7fa0b0ede97f3adb2f9eb41f.conikost@gentoo \
    --to=conikost@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox