Files
Himanshu Jadon ee1c39e595 samba, libldb: add package conflicts
samba package also installs LDB command line tools and python LDB
module. libldb package installs the same tools and pyldb module from
standalone LDB source.

pkgdata shows the conflict clearly:

  samba: /usr/bin/ldbadd
  libldb: /usr/bin/ldbadd
  samba-python3: site-packages/ldb.so
  pyldb: site-packages/ldb.so

So when both samba and libldb are added in same image, rootfs can fail
because package manager sees same files from two different packages.
Both package sets are not expected to be installed together.

Add RCONFLICTS for samba/libldb and samba-python3/pyldb. This makes the
conflict explicit during dependency resolution instead of failing later
as file install conflict.

Older meta-networking had similar conflict handling for samba/libldb in
commit: https://git.openembedded.org/meta-openembedded/commit/?id=8e641e28f630dac61a03373ad70c72a2370ad11e

This change adds the same handling again with current python3 package names.

Signed-off-by: Himanshu Jadon <hjadon@cisco.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-08-20 11:10:54 -07:00

91 lines
3.3 KiB
BlitzBasic

SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
HOMEPAGE = "https://ldb.samba.org"
SECTION = "libs"
LICENSE = "GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later"
DEPENDS += "libtdb libtalloc libtevent popt cmocka"
RDEPENDS:pyldb += "python3"
RCONFLICTS:${PN} = "samba"
RCONFLICTS:pyldb = "samba-python3"
export PYTHONHASHSEED = "1"
export PYTHONARCHDIR = "${PYTHON_SITEPACKAGES_DIR}"
SRC_URI = "https://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
file://0001-do-not-import-target-module-while-cross-compile.patch \
file://0002-ldb-Add-configure-options-for-packages.patch \
file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \
file://c23_memset_explicit.patch \
file://run-ptest \
"
PACKAGECONFIG ??= "\
${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
"
PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
PACKAGECONFIG[ldap] = ",,openldap"
PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb,"
SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}"
LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
SRC_URI[sha256sum] = "d155884002c79dbb1c3d8642f8b1013f2e520b3aeefd6e96412adec5b8d6cbc0"
inherit pkgconfig waf-samba ptest
S = "${UNPACKDIR}/ldb-${PV}"
# Cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
# to cross Popen
export WAF_NO_PREFORK = "yes"
EXTRA_OECONF += "--disable-rpath \
--disable-rpath-install \
--bundled-libraries=NONE \
--builtin-libraries=replace \
--with-modulesdir=${libdir}/ldb/modules \
--with-privatelibdir=${libdir}/ldb \
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
"
PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
NOAUTOPACKAGEDEBUG = "1"
FILES:${PN} += "${libdir}/ldb/*"
FILES:${PN}-dbg += "${bindir}/.debug/* \
${libdir}/.debug/* \
${libdir}/ldb/.debug/* \
${libdir}/ldb/modules/ldb/.debug/*"
FILES:pyldb = "${PYTHON_SITEPACKAGES_DIR}/* \
${libdir}/libpyldb-util.*.so.* \
"
FILES:pyldb-dbg = "${PYTHON_SITEPACKAGES_DIR}/.debug \
${libdir}/.debug/libpyldb-util.*.so.*"
FILES:pyldb-dev = "${libdir}/libpyldb-util.*.so"
# Prevent third_party/waf/waflib/Configure.py checking host's path which is
# incorrect for cross building.
export PREFIX = "/"
export LIBDIR = "${libdir}"
export BINDIR = "${bindir}"
do_configure:prepend() {
# For a clean rebuild
rm -fr bin/
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
install -m 0755 ${B}/bin/test_ldb_* ${D}${PTEST_PATH}/tests/
}