summaryrefslogtreecommitdiff
blob: c4ed1448098b4c90d0c17f91f749d70f7d57bb81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/confuse/confuse-2.5.ebuild,v 1.26 2007/09/14 17:37:03 mr_bones_ Exp $

WANT_AUTOMAKE="1.8"

inherit eutils libtool autotools

DESCRIPTION="a configuration file parser library"
HOMEPAGE="http://www.nongnu.org/confuse/"
SRC_URI="http://savannah.nongnu.org/download/confuse/${P}.tar.gz"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc ~sparc-fbsd x86 ~x86-fbsd"
IUSE="doc debug nls test"

DEPEND="sys-devel/libtool
	dev-util/pkgconfig
	test? ( dev-libs/check )
	doc? ( app-text/openjade
		>=app-text/docbook-sgml-dtd-3.1-r1 )"
RDEPEND=""

src_unpack(){
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}-maketest.patch

	# We should link to libintl correctly
	epatch "${FILESDIR}"/${P}-libintl.patch

	eautomake
	elibtoolize
}

src_compile() {
	local myconf

	use debug \
		&& myconf="${myconf} --enable-debug=all" \
		|| myconf="${myconf} --disable-debug"

	econf \
		--enable-shared \
		$(use_enable doc build-docs) \
		$(use_enable nls) \
		${myconf} || die
	emake || die
}

src_test() {
	cd "${S}"/tests
	./check_confuse || die "self test failed"
}

src_install() {
	make DESTDIR="${D}" install || die
	dodoc AUTHORS NEWS README
	dobin confuse-config
	if use doc ; then
		dohtml doc/html/*.html || die
	fi
	rmdir "${D}"/usr/bin
}