www-servers/servefile: 0.4.4_p20200211 + EAPI 7 + Python 3 + tests
authorSebastian Pipping <sping@gentoo.org>
Sun, 24 May 2020 13:56:35 +0000 (15:56 +0200)
committerSebastian Pipping <sping@gentoo.org>
Sun, 24 May 2020 13:57:21 +0000 (15:57 +0200)
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Package-Manager: Portage-2.3.99, Repoman-2.3.22

www-servers/servefile/Manifest
www-servers/servefile/files/servefile-0.4.4_p20200211-ipv6-absent-tests.patch [new file with mode: 0644]
www-servers/servefile/servefile-0.4.4_p20200211.ebuild [new file with mode: 0644]

index f7b81d0d0465a31e408f73400bd0d0f832908a09..947d98b2df97a3fb622b2615050c4551aa0a5663 100644 (file)
@@ -1 +1,2 @@
 DIST servefile-0.4.4.tar.gz 14219 BLAKE2B 35bb49cc005a269bd73cb937f3a86faddedbc5e64925be13f6d193382a4bd817729b193f7f78b0b161b30438ff1fc978eefc5c3094c5f51845a157a65d674deb SHA512 31ce200db7c8deee9f135c2151565a41fa791dcaa969d9096e6aae2c6975673fd409320be09b7ca20b544326293ed73369f3bd77f379a2ec5f94642d4ef3e1f4
+DIST servefile-0.4.4_p20200211.tar.gz 18304 BLAKE2B 2bbd6534d7fb787a0b85d594bd0a2bc235c859f80618be24dea144ef2adaa6188a29efdffc2e9109229301b9d3ee09df6a9d746a15ae6b01fed44a21307df78e SHA512 ef4edb4c92d9f804970087fc1c3d59775740642516a06704258de6d972cb807123f309991a5e22469b7619aff2304e265d5749485a4f74e75f2c80c279a23c33
diff --git a/www-servers/servefile/files/servefile-0.4.4_p20200211-ipv6-absent-tests.patch b/www-servers/servefile/files/servefile-0.4.4_p20200211-ipv6-absent-tests.patch
new file mode 100644 (file)
index 0000000..685269d
--- /dev/null
@@ -0,0 +1,25 @@
+From 3d34ff40f1a24873793c33b8f16a9940050fa93f Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sun, 24 May 2020 15:51:15 +0200
+Subject: [PATCH] Fix test test_ipv4_only for global USE=-ipv6
+
+---
+ tests/test_servefile.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_servefile.py b/tests/test_servefile.py
+index 8132f6b..3f127f4 100644
+--- a/tests/test_servefile.py
++++ b/tests/test_servefile.py
+@@ -137,7 +137,7 @@ def test_ipv4_only(run_servefile, datadir):
+     check_download(data, fname='testfile', host='127.0.0.1')
+     sock = socket.socket(socket.AF_INET6)
+-    with pytest.raises(connrefused_exc):
++    with pytest.raises((connrefused_exc, OSError)):
+         sock.connect(("::1", 8080))
+-- 
+2.26.2
+
diff --git a/www-servers/servefile/servefile-0.4.4_p20200211.ebuild b/www-servers/servefile/servefile-0.4.4_p20200211.ebuild
new file mode 100644 (file)
index 0000000..6f5570d
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+MY_COMMIT=864b2161b16e432c8ba19db1914809e080d793af
+DESCRIPTION="Serve a single file via HTTP"
+HOMEPAGE="https://github.com/sebageek/servefile"
+SRC_URI="https://github.com/sebageek/servefile/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ssl test"
+
+RDEPEND="
+       ssl? ( dev-python/pyopenssl[${PYTHON_USEDEP}] )
+       sys-apps/grep
+       sys-apps/iproute2
+       sys-apps/net-tools
+       sys-apps/sed"
+DEPEND="test? (
+               ${RDEPEND}
+               dev-python/requests[${PYTHON_USEDEP}]
+       )"
+
+S="${WORKDIR}"/${PN}-${MY_COMMIT}
+
+PATCHES=(
+       "${FILESDIR}"/${P}-ipv6-absent-tests.patch
+)
+
+distutils_enable_tests pytest
+
+src_install() {
+       distutils-r1_src_install
+       doman ${PN}.1
+}