]> 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 "${FILESDIR}/${P}-extra_qualifier.patch"
35         epatch "${FILESDIR}/${P}-pkg_makefile_am.patch"
36
37         sed -i \
38                 -e 's/docs//' \
39                 -e 's/examples//' \
40                 Makefile.am || die "sed failed"
41
42         eautoreconf
43 }
44
45 src_compile() {
46         if ! use mysql && ! use postgres && ! use sqlite ; then
47                 local myconf="--with-sqlite3"
48         fi
49         econf \
50                 $(use_with mysql) \
51                 $(use_with postgres pgsql) \
52                 $(use_with sqlite sqlite3) \
53                 ${myconf}
54
55         emake || die "emake failed"
56
57         if use examples ; then
58                 cd "${S}/src/examples"
59                 emake || die "emake failed"
60         fi
61         if use doc ; then
62                 cd "${S}/docs/doxygen"
63                 doxygen doxygen.conf
64         fi
65 }
66
67 src_install() {
68         emake DESTDIR="${D}" install || die "emake install failed"
69         if use examples ; then
70                 rm src/examples/Makefile* src/examples/*.o
71                 insinto /usr/share/${PF}
72                 doins -r src/examples
73         fi
74
75         if use doc ; then
76                 dohtml docs/html/*
77         fi
78 }