1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{6,7} )
6 PYTHON_REQ_USE="threads(+)"
8 inherit python-single-r1 waf-utils multilib-minimal eutils
10 DESCRIPTION="An LDAP-like embedded database"
11 HOMEPAGE="https://ldb.samba.org"
12 SRC_URI="https://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
17 IUSE="doc +ldap +lmdb python"
20 !elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
21 dev-libs/popt[${MULTILIB_USEDEP}]
22 >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}]
23 >=sys-libs/talloc-2.2.0[python?,${MULTILIB_USEDEP}]
24 >=sys-libs/tdb-1.4.2[python?,${MULTILIB_USEDEP}]
25 >=sys-libs/tevent-0.10.0[python(+)?,${MULTILIB_USEDEP}]
26 ldap? ( net-nds/openldap )
27 lmdb? ( >=dev-db/lmdb-0.9.16[${MULTILIB_USEDEP}] )
28 python? ( ${PYTHON_DEPS} )
31 DEPEND="dev-libs/libxslt
32 doc? ( app-doc/doxygen )
38 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
40 WAF_BINARY="${S}/buildtools/bin/waf"
42 MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
45 "${FILESDIR}"/${PN}-1.5.2-optional_packages.patch
46 "${FILESDIR}"/${PN}-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
50 python-single-r1_pkg_setup
58 multilib_src_configure() {
60 $(usex ldap '' --disable-ldap)
61 $(usex lmdb '' --without-ldb-lmdb)
63 --disable-rpath-install --bundled-libraries=NONE
64 --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba
65 --builtin-libraries=NONE
67 if ! multilib_is_native_abi; then
68 myconf+=( --disable-python )
70 use python || myconf+=( --disable-python )
72 waf-utils_src_configure "${myconf[@]}"
75 multilib_src_compile(){
77 multilib_is_native_abi && use doc && doxygen Doxyfile
81 if multilib_is_native_abi; then
83 PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
84 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
89 multilib_src_install() {
92 if multilib_is_native_abi && use doc; then
93 doman apidocs/man/man3/*.3
95 dodoc -r apidocs/html/*
100 if has_version sys-auth/sssd; then
101 ewarn "You have sssd installed. It is known to break after ldb upgrades,"
102 ewarn "so please try to rebuild it before reporting bugs."
103 ewarn "See https://bugs.gentoo.org/404281"