]> Pileus Git - ~andy/sunrise/blob - dev-cpp/litesql/litesql-0.3.2.ebuild
Fix gcc-4.3/glibc-2.8 compilation problems
[~andy/sunrise] / dev-cpp / litesql / litesql-0.3.2.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit autotools eutils
6
7 DESCRIPTION="Integrates C++ objects tightly to relational database and thus provides an object persistence layer."
8 HOMEPAGE="http://litesql.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="doc examples mysql postgres sqlite"
15
16 RDEPEND="mysql? ( virtual/mysql )
17         postgres? ( virtual/postgresql-base )
18         sqlite? ( =dev-db/sqlite-3* )
19         !mysql? ( !postgres? ( !sqlite? ( =dev-db/sqlite-3* ) ) )"
20 DEPEND="${RDEPEND}
21         doc? ( app-doc/doxygen )"
22
23 pkg_setup() {
24         if ! use mysql && ! use postgres && ! use sqlite ; then
25                 ewarn "You have to specify at least one of the mysql postgresq sqlite USE flags."
26                 ewarn "None specified: support for sqlite automatically activated."
27         fi
28 }
29
30 src_unpack() {
31         unpack ${A}
32         cd "${S}"
33
34         epatch \
35                 "${FILESDIR}/${P}-extra_qualifier.patch" \
36                 "${FILESDIR}/${P}-pkg_makefile_am.patch" \
37                 "${FILESDIR}/${P}-gcc43_glibc28.patch"
38
39         sed -i \
40                 -e 's/docs//' \
41                 -e 's/examples//' \
42                 Makefile.am || die "sed failed"
43
44         eautoreconf
45 }
46
47 src_compile() {
48         if ! use mysql && ! use postgres && ! use sqlite ; then
49                 local myconf="--with-sqlite3"
50         fi
51         econf \
52                 $(use_with mysql) \
53                 $(use_with postgres pgsql) \
54                 $(use_with sqlite sqlite3) \
55                 ${myconf}
56
57         emake || die "emake failed"
58
59         if use examples ; then
60                 cd "${S}/src/examples"
61                 emake || die "emake failed"
62         fi
63         if use doc ; then
64                 cd "${S}/docs/doxygen"
65                 doxygen doxygen.conf
66         fi
67 }
68
69 src_install() {
70         emake DESTDIR="${D}" install || die "emake install failed"
71         if use examples ; then
72                 rm src/examples/Makefile* src/examples/*.o
73                 insinto /usr/share/${PF}
74                 doins -r src/examples
75         fi
76
77         if use doc ; then
78                 dohtml docs/html/*
79         fi
80 }