diff options
4 files changed, 328 insertions, 0 deletions
diff --git a/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch b/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch new file mode 100644 index 0000000..8ab094f --- /dev/null +++ b/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | --- a/wscript 2015-11-18 12:43:33.000000000 +0100 | ||
| 2 | +++ b/wscript 2015-11-18 12:46:25.000000000 +0100 | ||
| 3 | @@ -58,9 +58,7 @@ | ||
| 4 | if conf.env.standalone_ldb: | ||
| 5 | conf.CHECK_XSLTPROC_MANPAGES() | ||
| 6 | |||
| 7 | - # we need this for the ldap backend | ||
| 8 | - if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'): | ||
| 9 | - conf.env.ENABLE_LDAP_BACKEND = True | ||
| 10 | + conf.env.ENABLE_LDAP_BACKEND = False | ||
| 11 | |||
| 12 | # we don't want any libraries or modules to rely on runtime | ||
| 13 | # resolution of symbols | ||
diff --git a/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch b/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch new file mode 100755 index 0000000..fdd312c --- /dev/null +++ b/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | Some modules such as dynamic library maybe cann't be imported while cross compile, | ||
| 2 | we just check whether does the module exist. | ||
| 3 | |||
| 4 | Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> | ||
| 5 | |||
| 6 | Index: ldb-1.1.26/buildtools/wafsamba/samba_bundled.py | ||
| 7 | =================================================================== | ||
| 8 | --- ldb-1.1.26.orig/buildtools/wafsamba/samba_bundled.py | ||
| 9 | +++ ldb-1.1.26/buildtools/wafsamba/samba_bundled.py | ||
| 10 | @@ -2,6 +2,7 @@ | ||
| 11 | |||
| 12 | import sys | ||
| 13 | import Build, Options, Logs | ||
| 14 | +import imp, os | ||
| 15 | from Configure import conf | ||
| 16 | from samba_utils import TO_LIST | ||
| 17 | |||
| 18 | @@ -230,17 +231,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li | ||
| 19 | # versions | ||
| 20 | minversion = minimum_library_version(conf, libname, minversion) | ||
| 21 | |||
| 22 | - try: | ||
| 23 | - m = __import__(modulename) | ||
| 24 | - except ImportError: | ||
| 25 | - found = False | ||
| 26 | - else: | ||
| 27 | + # Find module in PYTHONPATH | ||
| 28 | + stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]]) | ||
| 29 | + if stuff: | ||
| 30 | try: | ||
| 31 | - version = m.__version__ | ||
| 32 | - except AttributeError: | ||
| 33 | + m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2]) | ||
| 34 | + except ImportError: | ||
| 35 | found = False | ||
| 36 | + | ||
| 37 | + if conf.env.CROSS_COMPILE: | ||
| 38 | + # Some modules such as dynamic library maybe cann't be imported | ||
| 39 | + # while cross compile, we just check whether the module exist | ||
| 40 | + Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1])) | ||
| 41 | + found = True | ||
| 42 | else: | ||
| 43 | - found = tuplize_version(version) >= tuplize_version(minversion) | ||
| 44 | + try: | ||
| 45 | + version = m.__version__ | ||
| 46 | + except AttributeError: | ||
| 47 | + found = False | ||
| 48 | + else: | ||
| 49 | + found = tuplize_version(version) >= tuplize_version(minversion) | ||
| 50 | + finally: | ||
| 51 | + if stuff[0]: | ||
| 52 | + stuff[0].close() | ||
| 53 | + else: | ||
| 54 | + found = False | ||
| 55 | + | ||
| 56 | if not found and not conf.LIB_MAY_BE_BUNDLED(libname): | ||
| 57 | Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion)) | ||
| 58 | sys.exit(1) | ||
diff --git a/recipes-support/libldb/libldb/options-1.3.1.patch b/recipes-support/libldb/libldb/options-1.3.1.patch new file mode 100644 index 0000000..ffe253b --- /dev/null +++ b/recipes-support/libldb/libldb/options-1.3.1.patch | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | From a4da3ab4d76013aaa731d43d52ccca1ebd37c395 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
| 3 | Date: Wed, 21 Sep 2016 10:06:39 +0800 | ||
| 4 | Subject: [PATCH 1/1] ldb: Add configure options for packages | ||
| 5 | |||
| 6 | Add configure options for the following packages: | ||
| 7 | - acl | ||
| 8 | - attr | ||
| 9 | - libaio | ||
| 10 | - libbsd | ||
| 11 | - libcap | ||
| 12 | - valgrind | ||
| 13 | |||
| 14 | Upstream-Status: Inappropriate [oe deterministic build specific] | ||
| 15 | |||
| 16 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
| 17 | --- | ||
| 18 | lib/replace/system/wscript_configure | 6 ++- | ||
| 19 | lib/replace/wscript | 94 +++++++++++++++++++++++++++--------- | ||
| 20 | wscript | 7 +++ | ||
| 21 | 3 files changed, 83 insertions(+), 24 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure | ||
| 24 | index 2035474..10f9ae7 100644 | ||
| 25 | --- a/lib/replace/system/wscript_configure | ||
| 26 | +++ b/lib/replace/system/wscript_configure | ||
| 27 | @@ -1,6 +1,10 @@ | ||
| 28 | #!/usr/bin/env python | ||
| 29 | |||
| 30 | -conf.CHECK_HEADERS('sys/capability.h') | ||
| 31 | +import Options | ||
| 32 | + | ||
| 33 | +if Options.options.enable_libcap: | ||
| 34 | + conf.CHECK_HEADERS('sys/capability.h') | ||
| 35 | + | ||
| 36 | conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r') | ||
| 37 | |||
| 38 | # solaris varients of getXXent_r | ||
| 39 | diff --git a/lib/replace/wscript b/lib/replace/wscript | ||
| 40 | index 2f94d49..68b2d3a 100644 | ||
| 41 | --- a/lib/replace/wscript | ||
| 42 | +++ b/lib/replace/wscript | ||
| 43 | @@ -23,6 +23,41 @@ def set_options(opt): | ||
| 44 | opt.PRIVATE_EXTENSION_DEFAULT('') | ||
| 45 | opt.RECURSE('buildtools/wafsamba') | ||
| 46 | |||
| 47 | + opt.add_option('--with-acl', | ||
| 48 | + help=("Enable use of acl"), | ||
| 49 | + action="store_true", dest='enable_acl') | ||
| 50 | + opt.add_option('--without-acl', | ||
| 51 | + help=("Disable use of acl"), | ||
| 52 | + action="store_false", dest='enable_acl', default=False) | ||
| 53 | + | ||
| 54 | + opt.add_option('--with-attr', | ||
| 55 | + help=("Enable use of attr"), | ||
| 56 | + action="store_true", dest='enable_attr') | ||
| 57 | + opt.add_option('--without-attr', | ||
| 58 | + help=("Disable use of attr"), | ||
| 59 | + action="store_false", dest='enable_attr', default=False) | ||
| 60 | + | ||
| 61 | + opt.add_option('--with-libaio', | ||
| 62 | + help=("Enable use of libaio"), | ||
| 63 | + action="store_true", dest='enable_libaio') | ||
| 64 | + opt.add_option('--without-libaio', | ||
| 65 | + help=("Disable use of libaio"), | ||
| 66 | + action="store_false", dest='enable_libaio', default=False) | ||
| 67 | + | ||
| 68 | + opt.add_option('--with-libbsd', | ||
| 69 | + help=("Enable use of libbsd"), | ||
| 70 | + action="store_true", dest='enable_libbsd') | ||
| 71 | + opt.add_option('--without-libbsd', | ||
| 72 | + help=("Disable use of libbsd"), | ||
| 73 | + action="store_false", dest='enable_libbsd', default=False) | ||
| 74 | + | ||
| 75 | + opt.add_option('--with-libcap', | ||
| 76 | + help=("Enable use of libcap"), | ||
| 77 | + action="store_true", dest='enable_libcap') | ||
| 78 | + opt.add_option('--without-libcap', | ||
| 79 | + help=("Disable use of libcap"), | ||
| 80 | + action="store_false", dest='enable_libcap', default=False) | ||
| 81 | + | ||
| 82 | @Utils.run_once | ||
| 83 | def configure(conf): | ||
| 84 | conf.RECURSE('buildtools/wafsamba') | ||
| 85 | @@ -32,12 +67,25 @@ def configure(conf): | ||
| 86 | conf.DEFINE('HAVE_LIBREPLACE', 1) | ||
| 87 | conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1) | ||
| 88 | |||
| 89 | - conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h') | ||
| 90 | - conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h') | ||
| 91 | + conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h') | ||
| 92 | + conf.CHECK_HEADERS('compat.h ctype.h dustat.h') | ||
| 93 | conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h') | ||
| 94 | - conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h') | ||
| 95 | - conf.CHECK_HEADERS('shadow.h sys/acl.h') | ||
| 96 | - conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h') | ||
| 97 | + conf.CHECK_HEADERS('locale.h ndir.h pwd.h') | ||
| 98 | + conf.CHECK_HEADERS('shadow.h') | ||
| 99 | + conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h') | ||
| 100 | + | ||
| 101 | + if Options.options.enable_acl: | ||
| 102 | + conf.CHECK_HEADERS('acl/libacl.h sys/acl.h') | ||
| 103 | + | ||
| 104 | + if Options.options.enable_attr: | ||
| 105 | + conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h') | ||
| 106 | + | ||
| 107 | + if Options.options.enable_libaio: | ||
| 108 | + conf.CHECK_HEADERS('libaio.h') | ||
| 109 | + | ||
| 110 | + if Options.options.enable_libcap: | ||
| 111 | + conf.CHECK_HEADERS('sys/capability.h') | ||
| 112 | + | ||
| 113 | conf.CHECK_HEADERS('port.h') | ||
| 114 | conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h') | ||
| 115 | conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h') | ||
| 116 | @@ -73,7 +121,9 @@ def configure(conf): | ||
| 117 | |||
| 118 | conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') | ||
| 119 | |||
| 120 | - conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') | ||
| 121 | + if Options.options.enable_valgrind: | ||
| 122 | + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') | ||
| 123 | + | ||
| 124 | conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') | ||
| 125 | conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') | ||
| 126 | conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h') | ||
| 127 | @@ -266,22 +316,20 @@ def configure(conf): | ||
| 128 | |||
| 129 | conf.CHECK_FUNCS('prctl dirname basename') | ||
| 130 | |||
| 131 | - strlcpy_in_bsd = False | ||
| 132 | - | ||
| 133 | - # libbsd on some platforms provides strlcpy and strlcat | ||
| 134 | - if not conf.CHECK_FUNCS('strlcpy strlcat'): | ||
| 135 | - if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', | ||
| 136 | - checklibc=True): | ||
| 137 | - strlcpy_in_bsd = True | ||
| 138 | - if not conf.CHECK_FUNCS('getpeereid'): | ||
| 139 | - conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 140 | - if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): | ||
| 141 | - conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 142 | - if not conf.CHECK_FUNCS('setproctitle_init'): | ||
| 143 | - conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 144 | - | ||
| 145 | - if not conf.CHECK_FUNCS('closefrom'): | ||
| 146 | - conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') | ||
| 147 | + if Options.options.enable_libbsd: | ||
| 148 | + # libbsd on some platforms provides strlcpy and strlcat | ||
| 149 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): | ||
| 150 | + conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', | ||
| 151 | + checklibc=True) | ||
| 152 | + if not conf.CHECK_FUNCS('getpeereid'): | ||
| 153 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 154 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): | ||
| 155 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 156 | + if not conf.CHECK_FUNCS('setproctitle_init'): | ||
| 157 | + conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
| 158 | + | ||
| 159 | + if not conf.CHECK_FUNCS('closefrom'): | ||
| 160 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') | ||
| 161 | |||
| 162 | conf.CHECK_CODE(''' | ||
| 163 | struct ucred cred; | ||
| 164 | @@ -632,7 +680,7 @@ removeea setea | ||
| 165 | # look for a method of finding the list of network interfaces | ||
| 166 | for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']: | ||
| 167 | bsd_for_strlcpy = '' | ||
| 168 | - if strlcpy_in_bsd: | ||
| 169 | + if Options.options.enable_libbsd: | ||
| 170 | bsd_for_strlcpy = ' bsd' | ||
| 171 | if conf.CHECK_CODE(''' | ||
| 172 | #define %s 1 | ||
| 173 | diff --git a/wscript b/wscript | ||
| 174 | index 8ae5be3..a178cc4 100644 | ||
| 175 | --- a/wscript | ||
| 176 | +++ b/wscript | ||
| 177 | @@ -31,6 +31,13 @@ def set_options(opt): | ||
| 178 | opt.RECURSE('lib/replace') | ||
| 179 | opt.tool_options('python') # options for disabling pyc or pyo compilation | ||
| 180 | |||
| 181 | + opt.add_option('--with-valgrind', | ||
| 182 | + help=("enable use of valgrind"), | ||
| 183 | + action="store_true", dest='enable_valgrind') | ||
| 184 | + opt.add_option('--without-valgrind', | ||
| 185 | + help=("disable use of valgrind"), | ||
| 186 | + action="store_false", dest='enable_valgrind', default=False) | ||
| 187 | + | ||
| 188 | def configure(conf): | ||
| 189 | conf.RECURSE('lib/tdb') | ||
| 190 | conf.RECURSE('lib/tevent') | ||
| 191 | -- | ||
| 192 | 2.16.2 | ||
| 193 | |||
diff --git a/recipes-support/libldb/libldb_1.3.1.bb b/recipes-support/libldb/libldb_1.3.1.bb new file mode 100644 index 0000000..c644b20 --- /dev/null +++ b/recipes-support/libldb/libldb_1.3.1.bb | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | SUMMARY = "Hierarchical, reference counted memory pool system with destructors" | ||
| 2 | HOMEPAGE = "http://ldb.samba.org" | ||
| 3 | SECTION = "libs" | ||
| 4 | LICENSE = "LGPL-3.0+ & LGPL-2.1+ & GPL-3.0+" | ||
| 5 | |||
| 6 | DEPENDS += "libtdb libtalloc libtevent popt" | ||
| 7 | RDEPENDS_pyldb += "python" | ||
| 8 | |||
| 9 | SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \ | ||
| 10 | file://do-not-import-target-module-while-cross-compile.patch \ | ||
| 11 | file://options-1.3.1.patch \ | ||
| 12 | " | ||
| 13 | |||
| 14 | PACKAGECONFIG ??= "\ | ||
| 15 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \ | ||
| 16 | ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \ | ||
| 17 | " | ||
| 18 | PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl" | ||
| 19 | PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr" | ||
| 20 | PACKAGECONFIG[ldap] = ",,openldap" | ||
| 21 | PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio" | ||
| 22 | PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd" | ||
| 23 | PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap" | ||
| 24 | PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind" | ||
| 25 | |||
| 26 | SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}" | ||
| 27 | |||
| 28 | LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \ | ||
| 29 | file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \ | ||
| 30 | file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42" | ||
| 31 | |||
| 32 | SRC_URI[md5sum] = "e5233f202bca27f6ce8474fb8ae65983" | ||
| 33 | SRC_URI[sha256sum] = "b19f2c9f55ae0f46aa5ebaea0bf1a47ec1ac135e1d78af0f6318cf50bf62cbd2" | ||
| 34 | |||
| 35 | CROSS_METHOD="exec" | ||
| 36 | inherit waf-samba | ||
| 37 | |||
| 38 | S = "${WORKDIR}/ldb-${PV}" | ||
| 39 | |||
| 40 | EXTRA_OECONF += "--disable-rpath \ | ||
| 41 | --disable-rpath-install \ | ||
| 42 | --bundled-libraries=cmocka \ | ||
| 43 | --builtin-libraries=replace \ | ||
| 44 | --with-modulesdir=${libdir}/ldb/modules \ | ||
| 45 | --with-privatelibdir=${libdir}/ldb \ | ||
| 46 | --with-libiconv=${STAGING_DIR_HOST}${prefix}\ | ||
| 47 | " | ||
| 48 | |||
| 49 | PACKAGES =+ "pyldb pyldb-dbg pyldb-dev" | ||
| 50 | |||
| 51 | NOAUTOPACKAGEDEBUG = "1" | ||
| 52 | |||
| 53 | FILES_${PN} += "${libdir}/ldb/*" | ||
| 54 | FILES_${PN}-dbg += "${bindir}/.debug/* \ | ||
| 55 | ${libdir}/.debug/* \ | ||
| 56 | ${libdir}/ldb/.debug/* \ | ||
| 57 | ${libdir}/ldb/modules/ldb/.debug/*" | ||
| 58 | |||
| 59 | FILES_pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \ | ||
| 60 | ${libdir}/libpyldb-util.so.* \ | ||
| 61 | " | ||
| 62 | FILES_pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \ | ||
| 63 | ${libdir}/.debug/libpyldb-util.so.*" | ||
| 64 | FILES_pyldb-dev = "${libdir}/libpyldb-util.so" | ||
