summaryrefslogtreecommitdiff
blob: 0a4072638342029cbc53ab4ae3bdb95bd099fb64 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils autotools

DESCRIPTION="mockpp is a platform independent generic unit testing framework for C++."
HOMEPAGE="http://mockpp.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="boost cppunit doc"

RDEPEND="cppunit? ( dev-util/cppunit )
	 boost? ( dev-libs/boost )"
DEPEND="${RDEPEND}
	doc? ( 	app-doc/doxygen
		app-text/docbook-xml-dtd )"

pkg_setup() {
	if (use boost) && (use cppunit); then
		ewarn
		ewarn "Both boost and cppunit use-flags specified, will use boost"
		ewarn
	fi
}

src_unpack() {
	unpack ${A}
	epatch "${FILESDIR}/${PV}-destdir.patch"
	epatch "${FILESDIR}/${PV}-boost_incdir_m4.patch"
	cd "${S}"
	eautoreconf || die "eautoreconf failed"
}

src_compile() {
	econf   $(use_enable cppunit) \
		$(use_enable boost boosttest) \
		$(use_enable doc doxygen) \
		$(use_enable doc docbook) || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	# docs get build & installed only if doc use-flag is specified
	emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install || die "emake install failed"
	dodoc ChangeLog AUTHORS README TODO
}