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

inherit multilib

DESCRIPTION="A SAX XML parser based on the Expat library."
HOMEPAGE="http://www.keplerproject.org/luaexpat/i"
SRC_URI="http://luaforge.net/frs/download.php/2469/${P}.tar.gz"

LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND="dev-lang/lua
	>=dev-libs/expat-2.0.0"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${P%.*}"

src_unpack() {
	unpack ${A}
	cd "${S}"

	local luaver=
	luaver="$(lua -v 2>&1| cut -d' ' -f2)"
	luaver="${luaver%.*}"

	sed -i \
		-e "s:/usr/local/lib:\"${D}\"/usr/$(get_libdir):" \
		-e "s:/usr/local/share:\"${D}\"/usr/share:" \
		-e "s:usr/local:usr:" \
		-e "s:\(LUA_VERSION_NUM=\).*:\1 ${luaver}0:" \
		-e "s:5.0:${luaver}:" \
		-e "s:-O2:-fPIC ${CFLAGS}:" \
		config || die "sed in config failed"
}

src_compile() {
	emake || die "emake failed"
}

src_install() {
	emake install || die "emake install failed"
}