summaryrefslogtreecommitdiff
path: root/net-proxy/redsocks
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/redsocks')
-rw-r--r--net-proxy/redsocks/Manifest2
-rw-r--r--net-proxy/redsocks/files/redsocks.init-r143
-rw-r--r--net-proxy/redsocks/redsocks-0.5-r1.ebuild49
3 files changed, 94 insertions, 0 deletions
diff --git a/net-proxy/redsocks/Manifest b/net-proxy/redsocks/Manifest
index 02f0c6442aac..c3b182c37d09 100644
--- a/net-proxy/redsocks/Manifest
+++ b/net-proxy/redsocks/Manifest
@@ -1,7 +1,9 @@
AUX redsocks.conf 350 BLAKE2B 52bf1cb52f94d7eb2ab151905fb8b66644868c9cfb72b1d73951b0442bb300062f5c7b7776f80d1c74733a3980f73aecbc75b1b7364c5dc0bccc9d324b5504d5 SHA512 c6ce0622a54fafef31f40ed01b210c5ffb9af0504303fc5d2a4fb335ac3617fc7832c16b0885471e6f1eea168a0e4aa490089a00fd28e26ce0f9b59db0ac238b
AUX redsocks.init 1282 BLAKE2B 1efeb84d25630df8501b53d36f056a62733ab2f1c40a591d1c2b321224e3ed526fae1a0cbb4502c233c66b2c7c0541c0893311b749fb486176b978d79b10097b SHA512 81af76d7917273028cda3fa62e2c04ae27f763d93c6abac12c9b47877ae64918b4b07ed680fefb0e11ac3476c3f490f5e6d315ba8b0cf9a40b756cd32fc5234c
+AUX redsocks.init-r1 926 BLAKE2B b167e64335e45806c2791e72667f984f7b9ffb23d2be6c38bc4575d8487320eeb8ae270c0940fc4c198d7064323f3ba561c6954657fb4015a62f30d00ae06274 SHA512 c8c52571fd167d9ca6bb75e5b44741e87f5c57b6752b16026691a71a932cfa55ed43d186cd9d662997020faf370ce3e797ccc555e641149d5f5f8e43bb94901c
AUX redsocks.service 437 BLAKE2B 919055f6cd25a605b3cff1ad63e69579975868952ef362ddf6f025404a0109e159af51854ef3d24663322f1515508b2dfe89b00bc53070a63d515b3bcd0858a8 SHA512 73d2b6df7d1688b2605ec56f1843de1b58a5e3d8e88267cd99aa774303f8184ff5c7756b4fdd7215e3ccba8637eb8e41dac121fbe0339730fa1e51943957ce27
DIST redsocks-0.5.tar.gz 496403 BLAKE2B 7416340a7142669c72a8aeebc2c0775a393781de7fcbb63e4fbc71ce828658bc2b0615b394a990683c9fd13f41f050c92609dd956b4468bb06ec1ff261324c23 SHA512 678faca95b3570f793754abfe752b3d3580ea125aac8615ca2a1fce92cd50e7919832afe7cf5d1cc40b700045fca08f86ea1697d062ac8e7be706d166e69ff70
+EBUILD redsocks-0.5-r1.ebuild 1130 BLAKE2B 4f67d7a965df21a88953fb1150b702fffe6ec31c3512bd967a7cdac4abe063fc8242ba6df9a14eda38c7e8dcae11589c0a5ac2b9411b60f261782a5007a8501a SHA512 49a61fb4abf69bcf23fb34d95143052430d19a4a65dc469aafcd3354a5de7428fc07b9878b22acc89ce67d4d582cf19828ce6475995c077cfb2af71f1902a179
EBUILD redsocks-0.5.ebuild 1130 BLAKE2B 3fb70113213f328699d3a3649d4453c74e252ef7c20bc377587b0b21ae099df730aa8e922d265ca71368bf4ad6b89ebd0080128d58da9167895da32b886c0619 SHA512 c832d72a0858e49c70807c825518c5d4bd68a689234f2087ad37aca39f26130498d2753b059651f39f7897be4cb41a589e8ee4e0a66c1c1df318a975e2ec7bc7
EBUILD redsocks-9999.ebuild 1130 BLAKE2B 3fb70113213f328699d3a3649d4453c74e252ef7c20bc377587b0b21ae099df730aa8e922d265ca71368bf4ad6b89ebd0080128d58da9167895da32b886c0619 SHA512 c832d72a0858e49c70807c825518c5d4bd68a689234f2087ad37aca39f26130498d2753b059651f39f7897be4cb41a589e8ee4e0a66c1c1df318a975e2ec7bc7
MISC metadata.xml 1060 BLAKE2B b7db194e1155a93ff22b6ca713a442ae08f21ae27f9835e0f3ec09ccf86d4f33fa2d4da20251c58acdbeeeaa6bef3fe95de7e22f67eae2acf28406f53e494569 SHA512 5b48446a0edf223af4775df8ebf02b71112cbda5494853e97c0dfaa7aaeecc2529af8c340ab36507c96eaaade07e6ac73bcf51d23acc4a5ddaaf69bbe093a321
diff --git a/net-proxy/redsocks/files/redsocks.init-r1 b/net-proxy/redsocks/files/redsocks.init-r1
new file mode 100644
index 000000000000..861054fc914a
--- /dev/null
+++ b/net-proxy/redsocks/files/redsocks.init-r1
@@ -0,0 +1,43 @@
+#!/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
+}
+
+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-0.5-r1.ebuild b/net-proxy/redsocks/redsocks-0.5-r1.ebuild
new file mode 100644
index 000000000000..665f5a700021
--- /dev/null
+++ b/net-proxy/redsocks/redsocks-0.5-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/darkk/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
+ 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}
+
+DESCRIPTION="Transparent redirector of any TCP connection to proxy"
+HOMEPAGE="http://darkk.net.ru/redsocks/"
+LICENSE="Apache-2.0 LGPL-2.1+ ZLIB"
+SLOT="0"
+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
+}
+
+src_compile() {
+ CC="$(tc-getCC)" emake
+}
+
+src_install() {
+ dosbin redsocks
+ doman debian/redsocks.8
+ use doc && dodoc README doc/*
+ insinto /etc
+ newins debian/redsocks.conf redsocks.conf
+
+ newinitd "${FILESDIR}"/redsocks.init-r1 redsocks
+ newconfd "${FILESDIR}"/redsocks.conf redsocks
+
+ systemd_dounit "${FILESDIR}"/redsocks.service
+}