Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # Version 6 of the Berkeley DB from Oracle (formerly Sleepycat) |
| 2 | # |
| 3 | # At present this package only installs the DB code |
| 4 | # itself (shared libraries, .a in the dev package), |
| 5 | # documentation and headers. |
| 6 | # |
| 7 | # The headers have the same names as those as v3 |
| 8 | # of the DB, only one version can be used *for dev* |
| 9 | # at once - DB3 and DB6 can both be installed on the |
| 10 | # same system at the same time if really necessary. |
| 11 | SECTION = "libs" |
| 12 | SUMMARY = "Berkeley Database v6" |
| 13 | HOMEPAGE = "http://www.oracle.com/technology/products/berkeley-db/db/index.html" |
| 14 | LICENSE = "AGPL-3.0" |
| 15 | VIRTUAL_NAME ?= "virtual/db" |
| 16 | RCONFLICTS_${PN} = "db3" |
| 17 | |
| 18 | RECIPE_NO_UPDATE_REASON = "Updating to 6.1.x requires also updating rpm to 5.4.15" |
| 19 | |
| 20 | SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz" |
| 21 | SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \ |
| 22 | file://fix-parallel-build.patch \ |
| 23 | file://Makefile-let-libso_target-depend-on-bt_rec.patch \ |
| 24 | " |
| 25 | |
| 26 | SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b" |
| 27 | SRC_URI[sha256sum] = "608e4b1cf390e9bf54c0ef00c5bd9ca76d36e2261b9f4d33d54516f3f6a20fd2" |
| 28 | |
| 29 | LIC_FILES_CHKSUM = "file://../LICENSE;md5=1ec8b0b17cc31513fe35ab10716f8490" |
| 30 | |
| 31 | inherit autotools |
| 32 | |
| 33 | # Put virtual/db in any appropriate provider of a |
| 34 | # relational database, use it as a dependency in |
| 35 | # place of a specific db and use: |
| 36 | # |
| 37 | # PREFERRED_PROVIDER_virtual/db |
| 38 | # |
| 39 | # to select the correct db in the build (distro) .conf |
| 40 | PROVIDES += "${VIRTUAL_NAME}" |
| 41 | |
| 42 | # bitbake isn't quite clever enough to deal with sleepycat, |
| 43 | # the distribution sits in the expected directory, but all |
| 44 | # the builds must occur from a sub-directory. The following |
| 45 | # persuades bitbake to go to the right place |
| 46 | S = "${WORKDIR}/db-${PV}/dist" |
| 47 | B = "${WORKDIR}/db-${PV}/build_unix" |
| 48 | SPDX_S = "${WORKDIR}/db-${PV}" |
| 49 | |
| 50 | # The executables go in a separate package - typically there |
| 51 | # is no need to install these unless doing real database |
| 52 | # management on the system. |
| 53 | inherit lib_package |
| 54 | |
| 55 | PACKAGES =+ "${PN}-cxx" |
| 56 | FILES_${PN}-cxx = "${libdir}/*cxx*so" |
| 57 | |
| 58 | |
| 59 | # The dev package has the .so link (as in db3) and the .a's - |
| 60 | # it is therefore incompatible (cannot be installed at the |
| 61 | # same time) as the db3 package |
| 62 | # sort out the .so since they do version prior to the .so |
| 63 | SOLIBS = "-6*.so" |
| 64 | FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so" |
| 65 | |
| 66 | #configuration - set in local.conf to override |
| 67 | # All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix) |
| 68 | DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql" |
| 69 | |
| 70 | EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot" |
| 71 | |
| 72 | # Override the MUTEX setting here, the POSIX library is |
| 73 | # the default - "POSIX/pthreads/library". |
| 74 | # Don't ignore the nice SWP instruction on the ARM: |
| 75 | # These enable the ARM assembler mutex code |
| 76 | ARM_MUTEX = "--with-mutex=ARM/gcc-assembly" |
| 77 | MUTEX = "" |
| 78 | MUTEX_arm = "${ARM_MUTEX}" |
| 79 | MUTEX_armeb = "${ARM_MUTEX}" |
| 80 | EXTRA_OECONF += "${MUTEX}" |
| 81 | |
| 82 | # Cancel the site stuff - it's set for db3 and destroys the |
| 83 | # configure. |
| 84 | CONFIG_SITE = "" |
| 85 | do_configure() { |
| 86 | gnu-configize --force ${S} |
| 87 | export STRIP="true" |
| 88 | oe_runconf |
| 89 | } |
| 90 | |
| 91 | do_compile_prepend() { |
| 92 | sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \ |
| 93 | ${B}/libtool |
| 94 | } |
| 95 | |
| 96 | do_install_append() { |
| 97 | mkdir -p ${D}/${includedir}/db60 |
| 98 | mv ${D}/${includedir}/db.h ${D}/${includedir}/db60/. |
| 99 | mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db60/. |
| 100 | ln -s db60/db.h ${D}/${includedir}/db.h |
| 101 | ln -s db60/db_cxx.h ${D}/${includedir}/db_cxx.h |
| 102 | |
| 103 | # The docs end up in /usr/docs - not right. |
| 104 | if test -d "${D}/${prefix}/docs" |
| 105 | then |
| 106 | mkdir -p "${D}/${datadir}" |
| 107 | test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}" |
| 108 | mv "${D}/${prefix}/docs" "${D}/${docdir}" |
| 109 | fi |
| 110 | |
| 111 | chown -R root:root ${D} |
| 112 | } |
| 113 | |
| 114 | INSANE_SKIP_${PN} = "dev-so" |
| 115 | INSANE_SKIP_${PN}-cxx = "dev-so" |
| 116 | |
| 117 | BBCLASSEXTEND = "native nativesdk" |
| 118 | |