*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / net-p2p / bittornado / bittornado-0.4.1_p20160925-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{5,6} )
7
8 inherit distutils-r1
9
10 MY_PN=BitTornado
11 MY_P=${MY_PN}-${PV}
12 EGIT_COMMIT="ed327c4e1ebbe1fe949be81723527cfda87aeb8d"
13
14 DESCRIPTION="John Hoffman's fork of the original bittorrent"
15 HOMEPAGE="https://github.com/effigies/BitTornado"
16 SRC_URI="https://github.com/effigies/BitTornado/archive/${EGIT_COMMIT}.tar.gz -> ${MY_P}.tar.gz"
17 # GPL-2 is just for the init script from FILESDIR.
18 LICENSE="MIT GPL-2"
19 SLOT="0"
20
21 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
22 IUSE="test"
23 RESTRICT="!test? ( test )"
24
25 RDEPEND="
26         || (
27                 dev-python/pycryptodome[${PYTHON_USEDEP}]
28                 dev-python/pycrypto[${PYTHON_USEDEP}]
29         )"
30 DEPEND="test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
31
32 S=${WORKDIR}/${MY_PN}-${EGIT_COMMIT}
33
34 python_prepare_all() {
35         # https://github.com/effigies/BitTornado/pull/53
36         sed -e 's:"BitTornado.Tracker":\0, "BitTornado.Types":' -i setup.py || die
37         distutils-r1_python_prepare_all
38 }
39
40 python_test() {
41         py.test -v BitTornado/tests || die "tests failed with ${EPYTHON}"
42 }
43
44 python_install_all() {
45         distutils-r1_python_install_all
46
47         newconfd "${FILESDIR}"/bttrack.conf bttrack
48         newinitd "${FILESDIR}"/bttrack.rc bttrack
49 }