blob: d49df62b9a48c80275690bd6fede3d709c3c74fb [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# 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.
11SECTION = "libs"
12SUMMARY = "Berkeley Database v6"
13HOMEPAGE = "http://www.oracle.com/technology/products/berkeley-db/db/index.html"
14LICENSE = "AGPL-3.0"
15VIRTUAL_NAME ?= "virtual/db"
16RCONFLICTS_${PN} = "db3"
17
18RECIPE_NO_UPDATE_REASON = "Updating to 6.1.x requires also updating rpm to 5.4.15"
19
20SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
21SRC_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
26SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b"
27SRC_URI[sha256sum] = "608e4b1cf390e9bf54c0ef00c5bd9ca76d36e2261b9f4d33d54516f3f6a20fd2"
28
29LIC_FILES_CHKSUM = "file://../LICENSE;md5=1ec8b0b17cc31513fe35ab10716f8490"
30
31inherit 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
40PROVIDES += "${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
46S = "${WORKDIR}/db-${PV}/dist"
47B = "${WORKDIR}/db-${PV}/build_unix"
48SPDX_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.
53inherit lib_package
54
55PACKAGES =+ "${PN}-cxx"
56FILES_${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
63SOLIBS = "-6*.so"
64FILES_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)
68DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
69
70EXTRA_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
76ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
77MUTEX = ""
78MUTEX_arm = "${ARM_MUTEX}"
79MUTEX_armeb = "${ARM_MUTEX}"
80EXTRA_OECONF += "${MUTEX}"
81
82# Cancel the site stuff - it's set for db3 and destroys the
83# configure.
84CONFIG_SITE = ""
85do_configure() {
86 gnu-configize --force ${S}
87 export STRIP="true"
88 oe_runconf
89}
90
91do_compile_prepend() {
92 sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \
93 ${B}/libtool
94}
95
96do_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
114INSANE_SKIP_${PN} = "dev-so"
115INSANE_SKIP_${PN}-cxx = "dev-so"
116
117BBCLASSEXTEND = "native nativesdk"
118