dev-python/pyldap: New package, ebuild written by me
authorJustin Lecher <jlec@gentoo.org>
Thu, 1 Oct 2015 07:02:48 +0000 (09:02 +0200)
committerJustin Lecher <jlec@gentoo.org>
Thu, 1 Oct 2015 07:03:15 +0000 (09:03 +0200)
Package-Manager: portage-2.2.22
Signed-off-by: Justin Lecher <jlec@gentoo.org>
dev-python/pyldap/Manifest [new file with mode: 0644]
dev-python/pyldap/metadata.xml [new file with mode: 0644]
dev-python/pyldap/pyldap-2.4.20.ebuild [new file with mode: 0644]

diff --git a/dev-python/pyldap/Manifest b/dev-python/pyldap/Manifest
new file mode 100644 (file)
index 0000000..6e757dc
--- /dev/null
@@ -0,0 +1 @@
+DIST pyldap-2.4.20.tar.gz 122175 SHA256 9f3c5679e6a2c26a852d0468c538239e458a39ee86ddbbd2f1ec5c6fc73a3755 SHA512 f29df58fa1617b8b61631ad4532fde7569dd9742d141e31c1724568c0b46ed63cbc83135089196a07e4dca22d76f05f3c5a74e9b1e8034e5673196912baa8642 WHIRLPOOL 27dcf5919b83e3236b2b18b02943080fe5f5e48e5e931f27dfae45612c075e58bd798bee1f52dde8674571f377dd99479ef0f4a4e917f8c55962cce51fc150a3
diff --git a/dev-python/pyldap/metadata.xml b/dev-python/pyldap/metadata.xml
new file mode 100644 (file)
index 0000000..c60eaa2
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <herd>python</herd>
+       <maintainer>
+               <email>xmw@gentoo.org</email>
+               <name>Michael Weber</name>
+               <description>Upstream of the python3 port</description>
+       </maintainer>
+       <upstream>
+               <remote-id type="pypi">python-ldap</remote-id>
+       </upstream>
+</pkgmetadata>
diff --git a/dev-python/pyldap/pyldap-2.4.20.ebuild b/dev-python/pyldap/pyldap-2.4.20.ebuild
new file mode 100644 (file)
index 0000000..1f121f3
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} pypy )
+
+inherit distutils-r1 multilib
+
+DESCRIPTION="Various LDAP-related Python modules"
+HOMEPAGE="https://pypi.python.org/pypi/pyldap https://github.com/pyldap/pyldap/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="PSF-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris"
+IUSE="doc examples sasl ssl"
+
+# 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.
+# OpenSSL is an optional runtime dep.
+# setup.py sets setuptools and misses pyasn1 and pyasn1-modules in install_requires
+RDEPEND="
+       !dev-python/python-ldap[${PYTHON_USEDEP}]
+       >net-nds/openldap-2.4.11
+       dev-python/pyasn1[${PYTHON_USEDEP}]
+       dev-python/pyasn1-modules[${PYTHON_USEDEP}]
+       sasl? ( >=dev-libs/cyrus-sasl-2.1 )"
+DEPEND="${RDEPEND}
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
+
+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
+       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
+
+       distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+       use doc && emake -C Doc html
+}
+
+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}"
+}
+
+python_install_all() {
+       use examples && local EXAMPLES=( Demo/. )
+       use doc && local HTML_DOCS=( Doc/.build/html/. )
+
+       distutils-r1_python_install_all
+}