b9bb90dc092017abfad9f4475c5c6e781b9e8814
[gentoo.git] / dev-db / libdbi / libdbi-0.9.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit eutils autotools ltprune multilib
7
8 DESCRIPTION="A database-independent abstraction layer in C"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
10 HOMEPAGE="http://libdbi.sourceforge.net/"
11 LICENSE="LGPL-2.1"
12
13 IUSE="doc static-libs"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86"
15 SLOT=0
16
17 DOCS="AUTHORS ChangeLog README README.osx TODO"
18
19 RDEPEND=""
20 DEPEND="${RDEPEND}
21         >=sys-apps/sed-4
22         virtual/pkgconfig
23         doc? ( app-text/openjade )
24 "
25 PDEPEND=">=dev-db/libdbi-drivers-0.9.0" # On purpose, libdbi-drivers 0.8.4 does not exist
26
27 src_unpack() {
28         unpack ${A}
29         chown -R portage:portage "${S}"
30 }
31
32 src_prepare() {
33         #epatch "${FILESDIR}"/${PN}-0.9.0-fix-ac-macro.patch
34         #epatch "${FILESDIR}"/libdbi-0.8.1-pkg-config.patch
35         #cp -f "${FILESDIR}"/dbi.pc.in "${S}"/dbi.pc.in
36         epatch "${FILESDIR}"/libdbi-0.9.0-doc-build-fix.patch
37
38         # configure.in has been changed
39         eautoreconf
40         # should append CFLAGS, not replace them
41         sed -i.orig -e 's/^CFLAGS = /CFLAGS += /g' src/Makefile.in
42 }
43
44 src_configure() {
45         econf \
46                 $(use_enable doc docs) \
47                 $(use_enable static-libs static)
48 }
49
50 src_install() {
51         default
52
53         prune_libtool_files --all
54
55         # syslog-ng requires dbi.pc
56         insinto /usr/$(get_libdir)/pkgconfig/
57         doins dbi.pc
58 }