aboutsummaryrefslogblamecommitdiffstats
path: root/community/lua-redis/APKBUILD
blob: c8aa2dd0764f2bc76d44721d0ce1a0bc45d460a2 (plain) (tree)
1
2
3
4
5
6
7
                                                           
                                                          



                      
        












                                                                     


                                                                                          

           



                                                     







                
                      




                                                                 
                                                                              


















                                                                                   


                                                                                                                                                                     
# 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=1
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="$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
}

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="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"