db_4.2.52.bb 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Version 4 of the Berkeley DB from 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 DB4 can both be installed on the
  10. # same system at the same time if really necessary.
  11. SECTION = "libs"
  12. DESCRIPTION = "Berkeley DB v4."
  13. HOMEPAGE = "http://www.sleepycat.com"
  14. LICENSE = "BSD Sleepycat"
  15. VIRTUAL_NAME ?= "virtual/db"
  16. CONFLICTS = "db3"
  17. PR = "r6"
  18. SRC_URI = "http://download.oracle.com/berkeley-db/${P}.tar.gz"
  19. #SRC_URI_MD5 = "http://downloads.sleepycat.com/db-${PV}.tar.gz.md5"
  20. #TODO SRC_URI += "file://arm-thumb-mutex.patch;patch=1"
  21. inherit autotools
  22. # Put virtual/db in any appropriate provider of a
  23. # relational database, use it as a dependency in
  24. # place of a specific db and use:
  25. #
  26. # PREFERRED_PROVIDER_virtual/db
  27. #
  28. # to select the correct db in the build (distro) .conf
  29. PROVIDES += "${VIRTUAL_NAME}"
  30. # bitbake isn't quite clever enough to deal with sleepycat,
  31. # the distribution sits in the expected directory, but all
  32. # the builds must occur from a sub-directory. The following
  33. # persuades bitbake to go to the right place
  34. S = "${WORKDIR}/db-${PV}/dist"
  35. B = "${WORKDIR}/db-${PV}/build_unix"
  36. # The executables go in a separate package - typically there
  37. # is no need to install these unless doing real database
  38. # management on the system.
  39. PACKAGES += " ${PN}-bin"
  40. # Package contents
  41. FILES_${PN} = "${libdir}/libdb-4*so*"
  42. FILES_${PN}-bin = "${bindir}/*"
  43. # The dev package has the .so link (as in db3) and the .a's -
  44. # it is therefore incompatible (cannot be installed at the
  45. # same time) as the db3 package
  46. FILES_${PN}-dev = "${includedir} ${libdir}/*"
  47. #configuration - set in local.conf to override
  48. DB4_CONFIG ?= " --disable-cryptography --disable-queue --disable-replication --disable-verify --enable-hash"
  49. EXTRA_OECONF = "${DB4_CONFIG}"
  50. # Override the MUTEX setting here, the POSIX library is
  51. # the default - "POSIX/pthreads/library".
  52. # Don't ignore the nice SWP instruction on the ARM:
  53. # These enable the ARM assembler mutex code, this won't
  54. # work with thumb compilation...
  55. ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
  56. MUTEX = ""
  57. MUTEX_arm = "${ARM_MUTEX}"
  58. MUTEX_armeb = "${ARM_MUTEX}"
  59. EXTRA_OECONF += "${MUTEX}"
  60. # Cancel the site stuff - it's set for db3 and destroys the
  61. # configure.
  62. CONFIG_SITE = ""
  63. do_configure() {
  64. rm -f ${S}/config.sub
  65. cp ${STAGING_DIR}/${BUILD_SYS}/share/gnu-config/config.sub ${S}/config.sub
  66. oe_runconf
  67. }
  68. do_stage() {
  69. # The .h files get installed read-only, the autostage
  70. # function just uses cp -pPR, so do this by hand
  71. rm -rf ${STAGE_TEMP}
  72. mkdir -p ${STAGE_TEMP}
  73. oe_runmake DESTDIR="${STAGE_TEMP}" install_include
  74. cp -pPRf ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}/.
  75. rm -rf ${STAGE_TEMP}
  76. oe_libinstall -so -C .libs libdb-4.2 ${STAGING_LIBDIR}
  77. ln -sf libdb-4.2.so ${STAGING_LIBDIR}/libdb.so
  78. ln -sf libdb-4.2.a ${STAGING_LIBDIR}/libdb.a
  79. }
  80. do_install_append() {
  81. # The docs end up in /usr/docs - not right.
  82. if test -d "${D}/${prefix}/docs"
  83. then
  84. mkdir -p "${D}/${datadir}"
  85. test ! -d "${D}/${docdir}" || rmdir "${D}/${docdir}"
  86. mv "${D}/${prefix}/docs" "${D}/${docdir}"
  87. fi
  88. }
  89. # The db package contains symlinks that trip up insane
  90. INSANE_SKIP_db = "1"