gdbm-1.12.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit flag-o-matic libtool multilib multilib-minimal
  5. EX_P="${PN}-1.8.3"
  6. DESCRIPTION="Standard GNU database libraries"
  7. HOMEPAGE="https://www.gnu.org/software/gdbm/"
  8. SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
  9. exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
  10. LICENSE="GPL-3"
  11. SLOT="0"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  13. IUSE="+berkdb exporter nls static-libs"
  14. RDEPEND="
  15. abi_x86_32? (
  16. !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
  17. !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
  18. )"
  19. EX_S="${WORKDIR}"/${EX_P}
  20. src_prepare() {
  21. elibtoolize
  22. }
  23. multilib_src_configure() {
  24. # gdbm doesn't appear to use either of these libraries
  25. export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
  26. if multilib_is_native_abi && use exporter ; then
  27. pushd "${EX_S}" >/dev/null
  28. append-lfs-flags
  29. econf --disable-shared
  30. popd >/dev/null
  31. fi
  32. ECONF_SOURCE=${S} \
  33. econf \
  34. --includedir="${EPREFIX}"/usr/include/gdbm \
  35. --with-gdbm183-libdir="${EX_S}/.libs" \
  36. --with-gdbm183-includedir="${EX_S}" \
  37. $(use_enable berkdb libgdbm-compat) \
  38. $(multilib_native_use_enable exporter gdbm-export) \
  39. $(use_enable nls) \
  40. $(use_enable static-libs static)
  41. }
  42. multilib_src_compile() {
  43. use exporter && emake -C "${EX_S}" libgdbm.la
  44. emake
  45. }
  46. multilib_src_install_all() {
  47. einstalldocs
  48. use static-libs || find "${ED}" -name '*.la' -delete
  49. mv "${ED}"/usr/include/gdbm/gdbm.h "${ED}"/usr/include/ || die
  50. }
  51. pkg_preinst() {
  52. preserve_old_lib libgdbm{,_compat}.so.{2,3} #32510
  53. }
  54. pkg_postinst() {
  55. preserve_old_lib_notify libgdbm{,_compat}.so.{2,3} #32510
  56. }