1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
9 DESCRIPTION="Utility to manage SSH public keys stored in LDAP"
10 HOMEPAGE="https://github.com/jirutka/ssh-ldap-pubkey"
12 if [[ ${PV} == "9999" ]]; then
13 EGIT_REPO_URI="https://github.com/jirutka/${PN}/${PN}.git"
17 SRC_URI="https://github.com/jirutka/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
24 RESTRICT="!test? ( test )"
27 dev-python/docopt[${PYTHON_USEDEP}]
28 >=dev-python/python-ldap-3.0[${PYTHON_USEDEP}]
33 dev-python/setuptools[${PYTHON_USEDEP}]
35 dev-python/pytest[${PYTHON_USEDEP}]
36 dev-python/pytest-describe[${PYTHON_USEDEP}]
37 dev-python/pytest-mock[${PYTHON_USEDEP}]
40 # We need to block previous net-misc/openssh packages
41 # to avoid file collision on "/etc/openldap/schema/openssh-lpk.schema"
42 RDEPEND="${MY_CDEPEND}
43 schema? ( !net-misc/openssh[ldap] )"
45 DOCS=( README.md CHANGELOG.adoc )
48 sed -i -e 's/pyldap/python-ldap >= 3.0/' setup.py || die
49 distutils-r1_src_prepare
53 pytest -vv || die "Tests failed under ${EPYTHON}"
56 python_install_all() {
57 distutils-r1_python_install_all
60 insinto /etc/openldap/schema
61 doins etc/openssh-lpk.schema
64 local MY_DOCDIR="/usr/share/doc/${PF}/examples"
65 insinto "${MY_DOCDIR}"
68 # We don't want to compress this small file to allow user
69 # to diff configuration against upstream's default
70 docompress -x "${MY_DOCDIR}"