dev-python/python-ldap: sync live ebuild with 3.1.0

Use the official upstream instead of the fork.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
This commit is contained in:
Louis Sautier
2018-06-20 23:40:16 +02:00
parent c80f79641a
commit 9d7a8fb9ab

View File

@@ -1,9 +1,9 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=7
PYTHON_COMPAT=( python2_7 pypy )
PYTHON_COMPAT=( pypy{,3} python{2_7,3_{4,5,6}} )
inherit distutils-r1
@@ -11,7 +11,7 @@ DESCRIPTION="Various LDAP-related Python modules"
HOMEPAGE="https://www.python-ldap.org/en/latest/
https://pypi.org/project/python-ldap/"
if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="https://github.com/xmw/python-ldap.git"
EGIT_REPO_URI="https://github.com/python-ldap/python-ldap.git"
inherit git-r3
else
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
@@ -20,61 +20,76 @@ fi
LICENSE="PSF-2"
SLOT="0"
IUSE="doc examples sasl ssl"
IUSE="doc examples sasl ssl test"
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
# python team: Please do not remove python-ldap-2.3.9 from the tree.
RDEPEND=">=net-nds/openldap-2.4
dev-python/pyasn1[${PYTHON_USEDEP}]
sasl? ( >=dev-libs/cyrus-sasl-2.1 )"
DEPEND="${RDEPEND}
# We do not need OpenSSL, it is never directly used:
# https://github.com/python-ldap/python-ldap/issues/224
RDEPEND="
!dev-python/pyldap
>=dev-python/pyasn1-0.3.7[${PYTHON_USEDEP}]
>=dev-python/pyasn1-modules-0.1.5[${PYTHON_USEDEP}]
>net-nds/openldap-2.4.11:=[sasl?,ssl?]
"
# We do not link against cyrus-sasl but we use some
# of its headers during the build.
DEPEND="
>net-nds/openldap-2.4.11:=[sasl?,ssl?]
dev-python/setuptools[${PYTHON_USEDEP}]
doc? (
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/pyasn1-modules[${PYTHON_USEDEP}]
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
sasl? ( >=dev-libs/cyrus-sasl-2.1 )
test? (
${RDEPEND}
dev-python/pytest[${PYTHON_USEDEP}]
)
"
RDEPEND+=" !dev-python/pyldap"
python_prepare_all() {
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
-i setup.cfg || die "error fixing setup.cfg"
local mylibs="ldap"
if use sasl; then
use ssl && mylibs="ldap_r"
mylibs="${mylibs} sasl2"
else
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
# The live ebuild won't compile if setuptools_scm < 1.16.2 is installed
# https://github.com/pypa/setuptools_scm/issues/228
if [[ ${PV} == *9999* ]]; then
rm -r .git || die
fi
use ssl && mylibs="${mylibs} ssl crypto"
use elibc_glibc && mylibs="${mylibs} resolv"
sed -e "s:^libs = .*:libs = lber ${mylibs}:" \
-i setup.cfg || die "error setting up libs in setup.cfg"
# set test expected to fail to expectedFailure
sed -e "s:^ def test_bad_urls: @unittest.expectedFailure\n def test_bad_urls:" \
-i Tests/t_ldapurl.py || die
if ! use sasl; then
sed -i 's/HAVE_SASL//g' setup.cfg || die
fi
if ! use ssl; then
sed -i 's/HAVE_TLS//g' setup.cfg || die
fi
distutils-r1_python_prepare_all
}
python_compile_all() {
use doc && emake -C Doc html
if use doc; then
sphinx-build Doc Doc/_build/html || die
HTML_DOCS=( Doc/_build/html/. )
fi
}
python_test() {
# XXX: the tests supposedly can start local slapd
# but it requires some manual config, it seems.
"${PYTHON}" Tests/t_ldapurl.py || die "Tests fail with ${EPYTHON}"
# Run all tests which don't require slapd
local ignored_tests=(
t_bind.py
t_cext.py
t_edit.py
t_ldapobject.py
t_ldap_options.py
t_ldap_sasl.py
t_ldap_schema_subentry.py
t_ldap_syncrepl.py
t_slapdobject.py
)
cd Tests || die
py.test ${ignored_tests[@]/#/--ignore } \
|| die "tests failed with ${EPYTHON}"
}
python_install_all() {
use examples && local EXAMPLES=( Demo/. )
use doc && local HTML_DOCS=( Doc/.build/html/. )
if use examples; then
docinto examples
dodoc -r Demo/.
docompress -x /usr/share/doc/${PF}/examples
fi
distutils-r1_python_install_all
}