summaryrefslogtreecommitdiff
blob: 819fb184246c1e173fa06a02405d4780c8e99e34 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/ocaml-expect/ocaml-expect-0.0.2.ebuild,v 1.1 2011/02/22 16:13:07 aballier Exp $

EAPI=3

inherit findlib eutils multilib

DESCRIPTION="Ocaml implementation of expect to help building unitary testing"
HOMEPAGE="http://forge.ocamlcore.org/projects/ocaml-expect/"
SRC_URI="http://forge.ocamlcore.org/frs/download.php/475/${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64"
IUSE="debug doc +ocamlopt"

RDEPEND="
	>=dev-lang/ocaml-3.10.2[ocamlopt?]
	dev-ml/extlib
	dev-ml/pcre-ocaml"
DEPEND="${RDEPEND}
	dev-ml/findlib
	dev-ml/ounit"

oasis_use_enable() {
	echo "--override $2 `use $1 && echo \"true\" || echo \"false\"`"
}

src_configure() {
	chmod +x configure
	./configure --prefix usr \
		--libdir /usr/$(get_libdir) \
		--destdir "${D}" \
		--htmldir "/usr/share/doc/${PF}/html" \
		$(oasis_use_enable debug debug) \
		$(oasis_use_enable ocamlopt is_native) \
		|| die
}

src_compile() {
	emake || die
	if use doc; then
		emake doc || die
	fi
}

src_install() {
	findlib_src_install

	dodoc README.txt CHANGES.txt AUTHORS.txt || die "doc install failed"
}