summaryrefslogtreecommitdiff
blob: ef91661ddcc3dc46ccd442ff7d42d17aa76e1906 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/shunit2/shunit2-2.1.4.ebuild,v 1.2 2008/10/25 13:15:40 pvdabeel Exp $

DESCRIPTION="shUnit2 is a unit-test framework for Bourne-based shell scripts."
HOMEPAGE="http://code.google.com/p/shunit2/wiki/ProjectInfo"
SRC_URI="http://shunit2.googlecode.com/files/${P}.tgz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="doc test"

RDEPEND=""
DEPEND="${RDEPEND}
	dev-lang/perl
	net-misc/curl"

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed -i -e '/^__SHUNIT_SHELL_FLAGS/s:u::' src/shell/shunit2
}

src_compile() {
	local myconf="build"
	use doc && myconf="${myconf} docs"
	use test && myconf="${myconf} test"

	emake ${myconf} || die
}

src_install() {
	if use doc; then
		for DOC in build/{docbook/*,shunit2.html,shunit2_shelldoc.xml}; do
			dodoc ${DOC} || die
			rm ${DOC}
		done
	fi

	dodoc doc/*.txt || die

	insinto /usr/share/${PN}
	doins build/* || die
}