1SUMMARY = "The tdb library"
2HOMEPAGE = "https://tdb.samba.org/"
3SECTION = "libs"
4LICENSE = "LGPL-3.0-or-later & GPL-3.0-or-later"
5
6LIC_FILES_CHKSUM = "file://tools/tdbdump.c;endline=18;md5=b59cd45aa8624578126a8c98f48018c4 \
7                    file://include/tdb.h;endline=27;md5=f5bb544641d3081821bcc1dd58310be6"
8
9export PYTHONHASHSEED="1"
10export PYTHONARCHDIR = "${PYTHON_SITEPACKAGES_DIR}"
11
12SRC_URI = "https://samba.org/ftp/tdb/tdb-${PV}.tar.gz \
13           file://0001-tdb-Add-configure-options-for-packages.patch \
14           file://0002-Fix-pyext_PATTERN-for-cross-compilation.patch \
15           file://run-ptest \
16"
17
18SRC_URI[sha256sum] = "6ce4b27498812d09237ece65a0d6dfac0941610e709848ecb822aa241084cd7a"
19
20PACKAGECONFIG ??= "\
21    ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
22    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
23"
24
25PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
26PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
27PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
28PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
29PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
30
31S = "${WORKDIR}/tdb-${PV}"
32
33inherit waf-samba pkgconfig ptest
34
35# Cross_compile cannot use preforked process, since fork process earlier than point subproces.popen
36# to cross Popen
37export WAF_NO_PREFORK="yes"
38
39EXTRA_OECONF += "--disable-rpath \
40                 --disable-rpath-install \
41                 --bundled-libraries=NONE \
42                 --builtin-libraries=replace \
43                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
44                "
45
46do_install_ptest() {
47    install -d ${D}${PTEST_PATH}/tests
48    install -m 0755 ${B}/bin/tdb1-* ${D}${PTEST_PATH}/tests/
49    install -m 0755 ${B}/bin/replace_testsuite ${D}${PTEST_PATH}/tests/
50    install -d ${D}${PTEST_PATH}/tests/test
51    install -m 0644 ${B}/test/*.tdb ${D}${PTEST_PATH}/tests/test/
52    install -m 0644 ${B}/test/*.corrupt ${D}${PTEST_PATH}/tests/test/
53}
54
55PACKAGES += "tdb-tools python3-tdb"
56
57RPROVIDES:${PN}-dbg += "python3-tdb-dbg"
58
59FILES:${PN} = "${libdir}/*.so.*"
60FILES:tdb-tools = "${bindir}/*"
61FILES:python3-tdb = "${PYTHON_SITEPACKAGES_DIR}/*"
62RDEPENDS:python3-tdb = "python3"
63INSANE_SKIP:${MLPREFIX}python3-tdb = "dev-so"
64