app-misc/physlock: migrate to sys-libs/pam
[gentoo.git] / app-misc / ranger / ranger-1.9.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
6 PYTHON_REQ_USE="ncurses"
7
8 inherit distutils-r1
9
10 if [[ ${PV} == "9999" ]] ; then
11         EGIT_REPO_URI="https://github.com/ranger/ranger.git"
12         inherit git-r3
13 else
14         SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15         KEYWORDS="amd64 ~ppc x86"
16 fi
17
18 DESCRIPTION="A vim-inspired file manager for the console"
19 HOMEPAGE="https://ranger.github.io/"
20 LICENSE="GPL-3"
21 SLOT="0"
22 IUSE="test"
23 RESTRICT="!test? ( test )"
24
25 RDEPEND="virtual/pager"
26 DEPEND="test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
27
28 src_prepare() {
29         # use versioned doc path
30         sed -i "s|share/doc/ranger|share/doc/${PF}|" setup.py doc/ranger.1 || die
31
32         distutils-r1_src_prepare
33 }
34
35 python_test() {
36         py.test -v tests/ranger || die "Tests failed under ${EPYTHON}"
37 }
38
39 pkg_postinst() {
40         if [[ -z ${REPLACING_VERSIONS} ]]; then
41                 elog "Ranger has many optional dependencies to support enhanced file previews."
42                 elog "See the README or homepage for more details."
43         fi
44 }