sys-libs/ldb: x86 stable (bug #664316)
[gentoo.git] / sys-libs / ldb / ldb-1.1.26.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6 PYTHON_REQ_USE="threads"
7
8 inherit python-single-r1 waf-utils multilib-minimal eutils
9
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"
13
14 LICENSE="LGPL-3"
15 SLOT="0/${PV}"
16 KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
17 IUSE="doc"
18
19 RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
20         dev-libs/popt[${MULTILIB_USEDEP}]
21         >=sys-libs/talloc-2.1.5[python,${MULTILIB_USEDEP}]
22         >=sys-libs/tevent-0.9.27[python(+),${MULTILIB_USEDEP}]
23         >=sys-libs/tdb-1.3.8[python,${MULTILIB_USEDEP}]
24         net-nds/openldap
25         !!<net-fs/samba-3.6.0[ldb]
26         !!>=net-fs/samba-4.0.0[ldb]
27         ${PYTHON_DEPS}
28         "
29
30 DEPEND="dev-libs/libxslt
31         doc? ( app-doc/doxygen )
32         virtual/pkgconfig
33         ${RDEPEND}"
34
35 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
36
37 WAF_BINARY="${S}/buildtools/bin/waf"
38
39 MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
40
41 PATCHES=(
42         "${FILESDIR}"/${PN}-1.1.24-optional-python.patch
43 )
44
45 pkg_setup() {
46         python-single-r1_pkg_setup
47 }
48
49 src_prepare() {
50         default
51         multilib_copy_sources
52 }
53
54 multilib_src_configure() {
55         local myconf=(
56                 --disable-rpath \
57                 --disable-rpath-install --bundled-libraries=NONE \
58                 --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba \
59                 --builtin-libraries=NONE
60         )
61         if ! multilib_is_native_abi; then
62                 myconf+=( --disable-python )
63         fi
64         waf-utils_src_configure "${myconf[@]}"
65 }
66
67 multilib_src_compile(){
68         waf-utils_src_compile
69         multilib_is_native_abi && use doc && doxygen Doxyfile
70 }
71
72 multilib_src_test() {
73         if multilib_is_native_abi; then
74                 WAF_MAKE=1 \
75                 PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
76                 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
77                 waf test || die
78         fi
79 }
80
81 multilib_src_install() {
82         waf-utils_src_install
83
84         if multilib_is_native_abi && use doc; then
85                 doman  apidocs/man/man3/*.3
86                 docinto html
87                 dodoc -r apidocs/html/*
88         fi
89 }
90
91 pkg_postinst() {
92         if has_version sys-auth/sssd; then
93                 ewarn "You have sssd installed. It is known to break after ldb upgrades,"
94                 ewarn "so please try to rebuild it before reporting bugs."
95                 ewarn "See https://bugs.gentoo.org/404281"
96         fi
97 }