1*4882a593Smuzhiyun# Version 5 of the Berkeley DB from Sleepycat 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# At present this package only installs the DB code 4*4882a593Smuzhiyun# itself (shared libraries, .a in the dev package), 5*4882a593Smuzhiyun# documentation and headers. 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun# The headers have the same names as those as v3 8*4882a593Smuzhiyun# of the DB, only one version can be used *for dev* 9*4882a593Smuzhiyun# at once - DB3 and DB5 can both be installed on the 10*4882a593Smuzhiyun# same system at the same time if really necessary. 11*4882a593SmuzhiyunSECTION = "libs" 12*4882a593SmuzhiyunSUMMARY = "Berkeley Database v5" 13*4882a593SmuzhiyunDESCRIPTION = "Provides the foundational storage services for your application, no matter how demanding and unique your requirements may seem to be" 14*4882a593SmuzhiyunHOMEPAGE = "https://www.oracle.com/database/technologies/related/berkeleydb.html" 15*4882a593SmuzhiyunLICENSE = "Sleepycat" 16*4882a593SmuzhiyunRCONFLICTS:${PN} = "db3" 17*4882a593Smuzhiyun 18*4882a593SmuzhiyunCVE_PRODUCT = "oracle_berkeley_db berkeley_db" 19*4882a593SmuzhiyunCVE_VERSION = "11.2.${PV}" 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunPR = "r1" 22*4882a593SmuzhiyunPE = "1" 23*4882a593Smuzhiyun 24*4882a593SmuzhiyunSRC_URI = "https://download.oracle.com/berkeley-db/db-${PV}.tar.gz" 25*4882a593SmuzhiyunSRC_URI += "file://fix-parallel-build.patch \ 26*4882a593Smuzhiyun file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \ 27*4882a593Smuzhiyun file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ 28*4882a593Smuzhiyun file://sequence-type.patch \ 29*4882a593Smuzhiyun file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ 30*4882a593Smuzhiyun file://0001-clock-Do-not-define-own-timespec.patch \ 31*4882a593Smuzhiyun " 32*4882a593Smuzhiyun# We are not interested in official latest 6.x versions; 33*4882a593Smuzhiyun# let's track what debian is using. 34*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/db5.3/" 35*4882a593SmuzhiyunUPSTREAM_CHECK_REGEX = "db5\.3_(?P<pver>\d+(\.\d+)+).+\.orig" 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunSRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24" 38*4882a593SmuzhiyunSRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628" 39*4882a593Smuzhiyun 40*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955" 41*4882a593Smuzhiyun 42*4882a593Smuzhiyuninherit autotools 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun# The executables go in a separate package - typically there 45*4882a593Smuzhiyun# is no need to install these unless doing real database 46*4882a593Smuzhiyun# management on the system. 47*4882a593Smuzhiyuninherit lib_package 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunPACKAGES =+ "${PN}-cxx" 50*4882a593SmuzhiyunFILES:${PN}-cxx = "${libdir}/*cxx*so" 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun# The dev package has the .so link (as in db3) and the .a's - 53*4882a593Smuzhiyun# it is therefore incompatible (cannot be installed at the 54*4882a593Smuzhiyun# same time) as the db3 package 55*4882a593Smuzhiyun# sort out the .so since they do version prior to the .so 56*4882a593SmuzhiyunSOLIBS = "-5*.so" 57*4882a593SmuzhiyunFILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so" 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun#configuration - set in local.conf to override 60*4882a593Smuzhiyun# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix) 61*4882a593SmuzhiyunDB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-compat185 --disable-sql" 62*4882a593Smuzhiyun 63*4882a593SmuzhiyunEXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot STRIP=true" 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunPACKAGECONFIG ??= "" 66*4882a593SmuzhiyunPACKAGECONFIG[verify] = "--enable-verify, --disable-verify" 67*4882a593SmuzhiyunPACKAGECONFIG[dbm] = "--enable-dbm,--disable-dbm," 68*4882a593Smuzhiyun 69*4882a593SmuzhiyunEXTRA_AUTORECONF += "--exclude=autoheader -I ${S}/dist/aclocal -I${S}/dist/aclocal_java" 70*4882a593SmuzhiyunAUTOTOOLS_SCRIPT_PATH = "${S}/dist" 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun# Cancel the site stuff - it's set for db3 and destroys the 73*4882a593Smuzhiyun# configure. 74*4882a593SmuzhiyunCONFIG_SITE = "" 75*4882a593Smuzhiyun 76*4882a593Smuzhiyunoe_runconf:prepend() { 77*4882a593Smuzhiyun . ${S}/dist/RELEASE 78*4882a593Smuzhiyun # Edit version information we couldn't pre-compute. 79*4882a593Smuzhiyun sed -i -e "s/__EDIT_DB_VERSION_FAMILY__/$DB_VERSION_FAMILY/g" \ 80*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_RELEASE__/$DB_VERSION_RELEASE/g" \ 81*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \ 82*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \ 83*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \ 84*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \ 85*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_FULL_STRING__/$DB_VERSION_FULL_STRING/g" \ 86*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \ 87*4882a593Smuzhiyun -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" ${S}/dist/configure 88*4882a593Smuzhiyun} 89*4882a593Smuzhiyun 90*4882a593Smuzhiyundo_compile:prepend() { 91*4882a593Smuzhiyun # Stop libtool adding RPATHs 92*4882a593Smuzhiyun sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/libtool 93*4882a593Smuzhiyun} 94*4882a593Smuzhiyun 95*4882a593Smuzhiyundo_install:append() { 96*4882a593Smuzhiyun mkdir -p ${D}/${includedir}/db51 97*4882a593Smuzhiyun mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/. 98*4882a593Smuzhiyun mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/. 99*4882a593Smuzhiyun ln -s db51/db.h ${D}/${includedir}/db.h 100*4882a593Smuzhiyun ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h 101*4882a593Smuzhiyun 102*4882a593Smuzhiyun # The docs end up in /usr/docs - not right. 103*4882a593Smuzhiyun if test -d "${D}/${prefix}/docs" 104*4882a593Smuzhiyun then 105*4882a593Smuzhiyun mkdir -p "${D}/${datadir}" 106*4882a593Smuzhiyun test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}" 107*4882a593Smuzhiyun mv "${D}/${prefix}/docs" "${D}/${docdir}" 108*4882a593Smuzhiyun fi 109*4882a593Smuzhiyun 110*4882a593Smuzhiyun chown -R root:root ${D} 111*4882a593Smuzhiyun if ${@bb.utils.contains('PACKAGECONFIG', 'verify', 'false', 'true', d)}; then 112*4882a593Smuzhiyun rm -f ${D}${bindir}/db_verify 113*4882a593Smuzhiyun fi 114*4882a593Smuzhiyun} 115*4882a593Smuzhiyun 116*4882a593SmuzhiyunINSANE_SKIP:${PN} = "dev-so" 117*4882a593SmuzhiyunINSANE_SKIP:${PN}-cxx = "dev-so" 118*4882a593Smuzhiyun 119*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk" 120