aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/lua-redis/APKBUILD58
1 files changed, 17 insertions, 41 deletions
diff --git a/community/lua-redis/APKBUILD b/community/lua-redis/APKBUILD
index c8aa2dd076..304dbbfc78 100644
--- a/community/lua-redis/APKBUILD
+++ b/community/lua-redis/APKBUILD
@@ -4,63 +4,39 @@ pkgname=lua-redis
_pkgname=redis-lua
_luaversions="5.1 5.2"
pkgver=2.0.4
-pkgrel=1
+pkgrel=2
pkgdesc="A Lua client library for the redis key value storage system"
url="https://github.com/nrk/redis-lua"
arch="noarch"
-license="CUSTOM"
-depends=""
+license="MIT"
+depends="lua-socket"
depends_dev=""
makedepends="$depends_dev"
-install=""
-subpackages=""
-for _i in $_luaversions; do
- subpackages="$subpackages lua$_i-redis:split_${_i/./_}"
-done
-
+options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/nrk/redis-lua/archive/v$pkgver.tar.gz"
-
builddir="$srcdir"/$_pkgname-$pkgver
-
-prepare() {
- cd "$builddir"
- default_prepare || return 1
- for _i in $_luaversions; do
- cp -r "$builddir" "$srcdir"/build-$_i
- done
-}
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+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
+ mkdir -p "$pkgdir"
}
-_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
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="lua$lver lua$lver-socket"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ install -Dm644 $builddir/src/redis.lua \
+ "$subpkgdir"/usr/share/lua/"$lver"/redis.lua
}
-for _i in $_luaversions; do
- eval "split_${_i/./_}() { _split $_i; }"
-done
-
md5sums="9fcc177ebb2ce936c178231ba445fb62 lua-redis-2.0.4.tar.gz"
sha256sums="5eb6cb7cd0eda659cef7c231e43cd5f491cbd04804034d1c80134a1604e5cb5e lua-redis-2.0.4.tar.gz"
sha512sums="8e1266601881b0404aa1d771acc486b09a3752f901d4eec04c40912556d2ffe6eb24045d257193c7229fdfa48530a754ce267466f258a9618a30e3ab7ba9e1bc lua-redis-2.0.4.tar.gz"