blob: ee131806df11cb020354b56f2925503f1539f8df (
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
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-json4
_name=json4lua
pkgver=1.0.0
pkgrel=0
pkgdesc="JSON encoding / decoding module for Lua (JSON4lua)"
url="https://github.com/craigmj/json4lua"
arch="noarch"
license="GPL-2"
depends=""
subpackages=""
for _i in $_luaversions; do
depends="$depends lua$_i-json4"
subpackages="$subpackages lua$_i-json4:split_${_i/./_}"
done
source="json4lua-$pkgver.tar.gz::https://github.com/craigmj/json4lua/archive/start.tar.gz"
_builddir="$srcdir"/json4lua-start/json4lua
build() {
# do nothing, but keep it to make abuild happy
:
}
package() {
for _i in $_luaversions; do
install -D "$_builddir"/json/json.lua \
"$pkgdir"/usr/share/lua/$_i/json.lua
done
}
_split() {
local d= _ver=$1
pkgdesc="JSON encoding / decoding module for Lua $_ver (JSON4lua)"
install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
for d in usr/lib/lua usr/share/lua; do
if [ -d "$pkgdir"/$d/$_ver ]; then
mkdir -p "$subpkgdir"/$d
mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
fi
done
}
for _i in $_luaversions; do
eval "split_${_i/./_}() { _split $_i; }"
done
md5sums="c77db6534485f56e7f13f5f19dd697fb json4lua-1.0.0.tar.gz"
sha256sums="a04995bf60bf35d09c24acf48950cd2d929a5f3a4c6f083a1795253d4a26b170 json4lua-1.0.0.tar.gz"
sha512sums="eba74bd8b49ee64152f014c7f2aea819aab46588a6490ca55a8f32e492393f5abe4cb007c307d4f3688052091f723898626996929a163772d73211a6b2c38c17 json4lua-1.0.0.tar.gz"
|