summaryrefslogtreecommitdiff
blob: f8aa5a7b2e47df74d15234055495c8c466ee6380 (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
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tdom/tdom-0.8.3.ebuild,v 1.1 2011/01/21 08:00:52 jlec Exp $

EAPI="3"

inherit autotools eutils

MY_P="tDOM-${PV}"

DESCRIPTION="A XML/DOM/XPath/XSLT Implementation for Tcl"
HOMEPAGE="http://tdom.github.com"
SRC_URI="http://cloud.github.com/downloads/tDOM/${PN}/${MY_P}.tgz"

LICENSE="MPL-1.1"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
IUSE="threads"

DEPEND="
	dev-lang/tcl
	dev-libs/expat"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	epatch \
		"${FILESDIR}/"${PN}-0.8.2.patch \
		"${FILESDIR}/"${PN}-0.8.2-soname.patch \
		"${FILESDIR}/"${P}-expat.patch \
		"${FILESDIR}/"${PN}-0.8.2-tnc.patch
	eautoreconf
}

src_configure() {
	local myconf=""

	myconf="${myconf}
		$(use_enable threads)
		--enable-shared
		--disable-tdomalloc
		--with-expat"

	cd "${S}"/unix
	ECONF_SOURCE=".." econf ${myconf}

	# compile tdomhtml
	cd "${S}"/extensions/tdomhtml
	econf

	# compile tnc
	cd "${S}"/extensions/tnc
	econf ${myconf}
}

src_compile() {
	local dir

	for dir in "${S}"/unix "${S}"/extensions/tdomhtml "${S}"/extensions/tnc; do
		pushd ${dir} > /dev/null
			emake || die
		popd > /dev/null
	done
}

src_install() {
	local dir

	dodoc CHANGES ChangeLog README* || die

	for dir in "${S}"/unix "${S}"/extensions/tdomhtml "${S}"/extensions/tnc; do
		pushd ${dir} > /dev/null
			emake DESTDIR="${D}" install || die
		popd > /dev/null
	done
}