summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2016-09-06 11:23:17 +0200
committerLars Wendler <polynomial-c@gentoo.org>2016-09-06 11:25:29 +0200
commit896306c12642c3343ef6f3f1375c15858246f2e9 (patch)
treedecd7e1fd72f4f07ecc32834bab23420ef056623 /sys-libs/ldb
parentnet-misc/memcached-1.4.31-r0: add alpha keyword (diff)
downloadgentoo-896306c12642c3343ef6f3f1375c15858246f2e9.tar.gz
gentoo-896306c12642c3343ef6f3f1375c15858246f2e9.tar.bz2
gentoo-896306c12642c3343ef6f3f1375c15858246f2e9.zip
sys-libs/ldb: Revbump to make ldap support optional (bug #506448).
Package-Manager: portage-2.3.0 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'sys-libs/ldb')
-rw-r--r--sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch92
-rw-r--r--sys-libs/ldb/ldb-1.1.27-r1.ebuild99
2 files changed, 191 insertions, 0 deletions
diff --git a/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch b/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch
new file mode 100644
index 000000000000..92e14c651c86
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch
@@ -0,0 +1,92 @@
+--- ldb-1.1.27/lib/talloc/wscript
++++ ldb-1.1.27/lib/talloc/wscript
+@@ -48,7 +48,7 @@
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+- if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
++ if not conf.env.disable_python and conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
+--- ldb-1.1.27/wscript
++++ ldb-1.1.27/wscript
+@@ -5,6 +5,7 @@
+
+ blddir = 'bin'
+
++import Logs
+ import sys, os
+
+ # find the buildtools directory
+@@ -13,7 +14,7 @@
+ srcdir = srcdir + '/..'
+ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
+
+-import wafsamba, samba_dist, Utils
++import wafsamba, samba_dist, Utils, Options
+
+ samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
+ lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
+@@ -28,8 +29,21 @@
+ opt.RECURSE('lib/tevent')
+ opt.RECURSE('lib/replace')
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-python',
++ help=("disable the pyldb modules"),
++ action="store_true", dest='disable_python', default=False)
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-ldap',
++ help=("disable ldap support"),
++ action="store_true", dest='disable_ldap', default=False)
+
+ def configure(conf):
++ conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
++
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++ conf.env.disable_ldap = getattr(Options.options, 'disable_ldap', False)
++
+ conf.RECURSE('lib/tdb')
+ conf.RECURSE('lib/tevent')
+
+@@ -44,16 +58,18 @@
+ conf.RECURSE('lib/replace')
+ conf.find_program('python', var='PYTHON')
+ conf.find_program('xsltproc', var='XSLTPROC')
+- conf.check_tool('python')
+- conf.check_python_version((2,4,2))
+- conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
++
++ if not conf.env.disable_python:
++ conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
++ conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
++ if not conf.env.HAVE_PYTHON_H:
++ Logs.warn('Disabling pyldb-util as python devel libs not found')
++ conf.env.disable_python = True
+
+ # where does the default LIBDIR end up? in conf.env somewhere?
+ #
+ conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
+
+- conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
+-
+ if not conf.env.standalone_ldb:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
+ onlyif='talloc tdb tevent',
+@@ -67,9 +83,12 @@
+ if conf.env.standalone_ldb:
+ conf.CHECK_XSLTPROC_MANPAGES()
+
+- # we need this for the ldap backend
+- if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+- conf.env.ENABLE_LDAP_BACKEND = True
++ if not conf.env.disable_ldap:
++ # we need this for the ldap backend
++ if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
++ conf.env.ENABLE_LDAP_BACKEND = True
++ else:
++ conf.env.ENABLE_LDAP_BACKEND = False
+
+ # we don't want any libraries or modules to rely on runtime
+ # resolution of symbols
diff --git a/sys-libs/ldb/ldb-1.1.27-r1.ebuild b/sys-libs/ldb/ldb-1.1.27-r1.ebuild
new file mode 100644
index 000000000000..e3f70e519176
--- /dev/null
+++ b/sys-libs/ldb/ldb-1.1.27-r1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 waf-utils multilib-minimal eutils
+
+DESCRIPTION="An LDAP-like embedded database"
+HOMEPAGE="http://ldb.samba.org"
+SRC_URI="http://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="doc +ldap"
+
+RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.8[python,${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.29[python(+),${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.10[python,${MULTILIB_USEDEP}]
+ !!<net-fs/samba-3.6.0[ldb]
+ !!>=net-fs/samba-4.0.0[ldb]
+ ${PYTHON_DEPS}
+ ldap? ( net-nds/openldap )
+ "
+
+DEPEND="dev-libs/libxslt
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ ${RDEPEND}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.27-optional_packages.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(use_enable ldap) \
+ --disable-rpath \
+ --disable-rpath-install --bundled-libraries=NONE \
+ --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba \
+ --builtin-libraries=NONE
+ )
+ if ! multilib_is_native_abi; then
+ myconf+=( --disable-python )
+ fi
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+multilib_src_compile(){
+ waf-utils_src_compile
+ multilib_is_native_abi && use doc && doxygen Doxyfile
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi; then
+ WAF_MAKE=1 \
+ PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
+ waf test || die
+ fi
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ if multilib_is_native_abi && use doc; then
+ doman apidocs/man/man3/*.3
+ docinto html
+ dodoc -r apidocs/html/*
+ fi
+}
+
+pkg_postinst() {
+ if has_version sys-auth/sssd; then
+ ewarn "You have sssd installed. It is known to break after ldb upgrades,"
+ ewarn "so please try to rebuild it before reporting bugs."
+ ewarn "See https://bugs.gentoo.org/404281"
+ fi
+}