Drop arm-linux keyword from tree.
[gentoo.git] / sys-libs / gdbm / gdbm-1.13-r2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools flag-o-matic multilib multilib-minimal
7
8 EX_P="${PN}-1.8.3"
9 DESCRIPTION="Standard GNU database libraries"
10 HOMEPAGE="https://www.gnu.org/software/gdbm/"
11 SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
12         exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
13
14 LICENSE="GPL-3"
15 SLOT="0/1.13"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="+berkdb exporter nls +readline static-libs"
18
19 DEPEND="
20         readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
21 "
22 RDEPEND="${DEPEND}"
23
24 PATCHES=(
25         "${FILESDIR}"/gdbm-1.13-fix-a-typo-in-gdbm.h.patch
26         "${FILESDIR}"/gdbm-1.13-fix-build-with-enable-gdbm-export.patch
27 )
28
29 EX_S="${WORKDIR}/${EX_P}"
30
31 src_prepare() {
32         default
33
34         eautoreconf
35 }
36
37 multilib_src_configure() {
38         # gdbm doesn't appear to use either of these libraries
39         export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
40
41         if multilib_is_native_abi && use exporter ; then
42                 pushd "${EX_S}" >/dev/null
43                 append-lfs-flags
44                 econf --disable-shared
45                 popd >/dev/null
46         fi
47
48         local myeconfargs=(
49                 --includedir="${EPREFIX}"/usr/include/gdbm
50                 --with-gdbm183-libdir="${EX_S}/.libs"
51                 --with-gdbm183-includedir="${EX_S}"
52                 $(use_enable berkdb libgdbm-compat)
53                 $(multilib_native_use_enable exporter gdbm-export)
54                 $(use_enable nls)
55                 $(use_enable static-libs static)
56                 $(use_with readline)
57         )
58         ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
59 }
60
61 multilib_src_compile() {
62         use exporter && emake -C "${EX_S}" libgdbm.la
63         emake
64 }
65
66 multilib_src_install_all() {
67         einstalldocs
68
69         use static-libs || find "${ED}" -name '*.la' -delete
70         mv "${ED%/}"/usr/include/gdbm/gdbm.h "${ED%/}"/usr/include/ || die
71 }