summaryrefslogtreecommitdiff
path: root/net-proxy/sshuttle/sshuttle-1.1.2.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-02-21 11:40:26 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-02-21 11:40:26 +0000
commiteb3b53b5fd521edc0e4a7d611e76898732a63a81 (patch)
tree217af8e0b11da87c65601aa317f04b7a2de76d23 /net-proxy/sshuttle/sshuttle-1.1.2.ebuild
parentb08574f4102ea8282627f075758d981eb4ba6c56 (diff)
gentoo auto-resync : 21:02:2024 - 11:40:26
Diffstat (limited to 'net-proxy/sshuttle/sshuttle-1.1.2.ebuild')
-rw-r--r--net-proxy/sshuttle/sshuttle-1.1.2.ebuild78
1 files changed, 78 insertions, 0 deletions
diff --git a/net-proxy/sshuttle/sshuttle-1.1.2.ebuild b/net-proxy/sshuttle/sshuttle-1.1.2.ebuild
new file mode 100644
index 000000000000..8bde64af7644
--- /dev/null
+++ b/net-proxy/sshuttle/sshuttle-1.1.2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-sshuttle-docs
+# Set to 1 if prebuilt, 0 if not
+# (the construct below is to allow overriding from env for script)
+: ${SSHUTTLE_DOCS_PREBUILT:=1}
+
+SSHUTTLE_DOCS_PREBUILT_DEV=sam
+SSHUTTLE_DOCS_VERSION=${PV}
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+SSHUTTLE_DOCS_USEFLAG="+doc"
+
+DISTUTILS_USE_PEP517=poetry
+PYTHON_COMPAT=( python3_{10..12} )
+inherit distutils-r1 linux-info
+
+DESCRIPTION="Transparent proxy server that works as a poor man's VPN using ssh"
+HOMEPAGE="https://github.com/sshuttle/sshuttle https://pypi.org/project/sshuttle/"
+# No tests in sdist
+SRC_URI=" https://github.com/sshuttle/sshuttle/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+if [[ ${SSHUTTLE_DOCS_PREBUILT} == 1 ]] ; then
+ SRC_URI+=" !doc? ( https://dev.gentoo.org/~${SSHUTTLE_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${SSHUTTLE_DOCS_VERSION}-docs.tar.xz )"
+ SSHUTTLE_DOCS_USEFLAG="doc"
+fi
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="${SSHUTTLE_DOCS_USEFLAG}"
+
+BDEPEND="
+ doc? (
+ dev-python/sphinx
+ dev-python/furo
+ )
+ test? (
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="
+ dev-python/psutil[${PYTHON_USEDEP}]
+ || ( net-firewall/iptables net-firewall/nftables )
+"
+
+CONFIG_CHECK="~NETFILTER_XT_TARGET_HL ~IP_NF_TARGET_REDIRECT ~IP_NF_MATCH_TTL ~NF_NAT"
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ # Don't run tests via setup.py pytest
+ sed -i "/setup_requires=/s/'pytest-runner'//" setup.py || die
+
+ # Don't require pytest-cov when running tests
+ sed -i "s/^addopts =/#\0/" setup.cfg || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ if use doc ; then
+ emake -j1 -C docs html man
+ fi
+}
+
+python_install_all() {
+ # If USE=doc, there'll be newly generated docs which we install instead.
+ if ! use doc && [[ ${SSHUTTLE_DOCS_PREBUILT} == 1 ]] ; then
+ doman "${WORKDIR}"/${PN}-${SSHUTTLE_DOCS_VERSION}-docs/sshuttle.1
+ else
+ HTML_DOCS=( docs/_build/html/. )
+ doman docs/_build/man/*
+ fi
+
+ distutils-r1_python_install_all
+}