diff options
-rw-r--r-- | net-proxy/sshuttle/Manifest | 2 | ||||
-rw-r--r-- | net-proxy/sshuttle/sshuttle-1.1.1.ebuild | 75 |
2 files changed, 77 insertions, 0 deletions
diff --git a/net-proxy/sshuttle/Manifest b/net-proxy/sshuttle/Manifest index 08faa7825113..a575286ddd9f 100644 --- a/net-proxy/sshuttle/Manifest +++ b/net-proxy/sshuttle/Manifest @@ -1 +1,3 @@ DIST sshuttle-1.1.0.tar.gz 93987 BLAKE2B c81ab591d5f84764a6ed114623ccb1aaf2ff9706bc5f494513b19c4c2eeb218f3777b2bc7042329eb862aa311a5eab56669d88e10d92b019c0ff9ac9381e3903 SHA512 86361dec179c2ae61c338abaec3d0d36a280c1cc719c1df245a98379037315ac71781e8e5599bb50e34f5068dab3e1010cd7d15c614e01f3dc12011b620d43ee +DIST sshuttle-1.1.1-docs.tar.xz 8048 BLAKE2B f6318110f67a4882a733d9b389c52eefd2e769b70f3282e7699425b6e6d3a9c5a60219978e248aaf1e7f184491db9aea4aab2efad09eb0af3ee095e0cf527d54 SHA512 c2ef822f872f6afd1d9c64e7a412ad65cca0486115dcfa0673a7a1b0554bfd1413f673248e30fa01759daaf1a1a0061f48a42170d7b234448093d3562f757cd9 +DIST sshuttle-1.1.1.tar.gz 93639 BLAKE2B 63725146dd5fcd07f4b291f981ca947a514735014f4f8173023d3982796ce4ef96b9defb39beef026d32b2162d11951742c57dee1f04cd453cf85ca08c8d2468 SHA512 07a3371c4998f37410692f9c5eaa456ff28b2dbffff731a0be3877d96c820b42c83cb386ec3ab54b524d4b333edd1a2289cd949c7d59b98a11b1ee2d6867da4f diff --git a/net-proxy/sshuttle/sshuttle-1.1.1.ebuild b/net-proxy/sshuttle/sshuttle-1.1.1.ebuild new file mode 100644 index 000000000000..c9cdc03543a1 --- /dev/null +++ b/net-proxy/sshuttle/sshuttle-1.1.1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2022 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=setuptools +PYTHON_COMPAT=( python3_{8..11} ) +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/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.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 ) + 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 +} |