dev-util/spec-cleaner: Support python3.6
[gentoo.git] / dev-util / spec-cleaner / spec-cleaner-9999.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{3_4,3_5,3_6} )
7 EGIT_REPO_URI="https://github.com/openSUSE/spec-cleaner.git"
8 inherit distutils-r1
9 [[ ${PV} == 9999 ]] && inherit git-r3
10
11 DESCRIPTION="SUSE spec file cleaner and formatter"
12 HOMEPAGE="https://github.com/openSUSE/spec-cleaner"
13 [[ ${PV} != 9999 ]] && SRC_URI="https://github.com/openSUSE/${PN}/archive/${P}.tar.gz"
14
15 LICENSE="BSD"
16 SLOT="0"
17 [[ ${PV} != 9999 ]] &&
18 KEYWORDS="~amd64 ~x86"
19 IUSE="test"
20
21 DEPEND="
22         test? (
23                 dev-python/pytest[${PYTHON_USEDEP}]
24         )
25 "
26 RDEPEND="
27         ${PYTHON_DEPS}
28         >=app-arch/rpm-4.11.0.1
29 "
30
31 PATCHES=(
32         # pytest-runner is only needed in test scenario
33         "${FILESDIR}/${PN}-1.0.6-pytest-runner.patch"
34 )
35
36 [[ ${PV} != 9999 ]] && S="${WORKDIR}/${PN}-${P}"
37
38 src_prepare() {
39         # we have libexec
40         sed -i \
41                 -e 's:lib/obs:libexec/obs:g' \
42                 setup.py || die
43         distutils-r1_src_prepare
44 }
45
46 python_test() {
47         esetup.py test
48 }