summaryrefslogtreecommitdiff
blob: eea4aa7066cd7aef728c796b12afbf9a073f8996 (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-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

VCS="git"
LUA_COMPAT="lua52 lua53"
GITHUB_A="WeirdConstructor"

inherit lua

DESCRIPTION="Session library for OpenResty implementing Secure Cookie Protocol"
HOMEPAGE="https://github.com/bungle/lua-resty-session"

LICENSE="MIT"
SLOT="0"
KEYWORDS=""
IUSE="doc"

RDEPEND=""
DEPEND="
	${RDEPEND}
"

DOCS=(README.md doc/.)

all_lua_prepare() {
	local v;
	if has_version 'dev-lang/lua:5.3'; then
		v="5.3"
	elif has_version 'dev-lang/lua:5.2'; then
		v="5.2"
	else
		die "You need to install >=dev-lang/lua-5.2 first"
	fi
	sed -e "1i#!/usr/bin/env lua${v}" -i repl.lua
	lua_default
}

each_lua_install() {
	newbin repl.lua "${PN}"
	dolua "${PN}".lua
	_dolua_insdir="${PN}"
	dolua *.lua lang util
}