aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-redis/APKBUILD
blob: 8e651c3e384311b2e705cbd0fa5419b9d7e3d2df (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
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lua-redis
_pkgname=redis-lua
_luaversions="5.1 5.2"
pkgver=2.0.4
pkgrel=0
pkgdesc="A Lua client library for the redis key value storage system"
url="https://github.com/nrk/redis-lua"
arch="noarch"
license="CUSTOM"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages=""
for _i in $_luaversions; do
        subpackages="$subpackages lua$_i-redis:split_${_i/./_}"
done

source="https://github.com/nrk/$_pkgname/archive/version-2.0.zip"
_builddir="$srcdir"/$_pkgname-version-2.0

prepare() {
        cd "$_builddir"
        for _i in $_luaversions; do
                cp -r "$_builddir" "$srcdir"/build-$_i
	done
}

build() {
	return 0
}

package() {
        cd "$_builddir"
        for _i in $_luaversions; do
                cd "$srcdir"/build-$_i
		local _luadir="$pkgdir"/usr/share/lua/$_i
		install -Dm644 src/redis.lua "$_luadir"/redis.lua
        done
	install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

_split() {
        local d= _ver=$1
        pkgdesc="A Lua $_ver client library for the redis key value storage system"
	depends="$depends lua$_i-socket"
        replaces="$pkgname"
        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="ab472a35cf5caa1957134b097ea01c2b  version-2.0.zip"
sha256sums="221d4583307fd0d5635c63f2c8d5d4e90a96ce473d8ae6b27783dceb1066cbd4  version-2.0.zip"
sha512sums="8ba12b03201e9871da2cdf013c6e3d7f65201963f805ac64e8ba4319cc0b188a0d542ef037952a90c1d7950e927c0d7b2904c2eb8f4aa9e7f5d995b94953c979  version-2.0.zip"