summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lua/lrexlib/lrexlib-2.4.0.ebuild')
-rw-r--r--dev-lua/lrexlib/lrexlib-2.4.0.ebuild67
1 files changed, 67 insertions, 0 deletions
diff --git a/dev-lua/lrexlib/lrexlib-2.4.0.ebuild b/dev-lua/lrexlib/lrexlib-2.4.0.ebuild
new file mode 100644
index 0000000..2f886af
--- /dev/null
+++ b/dev-lua/lrexlib/lrexlib-2.4.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit multilib
+
+DESCRIPTION="Binding of three regular expression libraries (POSIX, PCRE and Oniguruma) to Lua"
+HOMEPAGE="http://luaforge.net/projects/lrexlib/"
+SRC_URI="http://luaforge.net/frs/download.php/3599/${P}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc oniguruma pcre"
+
+RDEPEND=">=dev-lang/lua-5.1
+ oniguruma? ( dev-libs/oniguruma )
+ pcre? ( dev-libs/pcre )"
+RDEPEND="${DEPEND}
+ app-arch/unzip"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i \
+ -e "s:\(MYCFLAGS =\):\1 -fPIC ${CFLAGS}:" \
+ src/defaults.mak || die "sed failed"
+
+ sed -i \
+ -e "s/\(all:.*\)test/\1/" \
+ Makefile || die "sed failed"
+
+ if ! use pcre; then
+ sed -i \
+ -e "s/build_pcre//g" \
+ -e "s/test_pcre//g" \
+ Makefile || die "sed failed"
+ fi
+
+ if ! use oniguruma; then
+ sed -i \
+ -e "s/build_onig//g" \
+ -e "s/test_onig//g" \
+ Makefile || die "sed failed"
+ fi
+}
+
+src_install() {
+ if use doc; then
+ dohtml -r doc/* || die "dodoc failed"
+ fi
+
+ local luaver=
+ luaver="$(lua -v 2>&1| cut -d' ' -f2)"
+ luaver="${luaver%.*}"
+
+ insinto /usr/$(get_libdir)/lua/${luaver}
+ doins src/posix/rex_posix.so* || die "doins failed"
+ if use pcre; then
+ doins src/pcre/rex_pcre.so* || die "doins failed"
+ fi
+ if use oniguruma; then
+ doins src/oniguruma/rex_onig.so* || die "doins failed"
+ fi
+}
+