# Maintainer: Natanael Copa _luaversions="5.1 5.2 5.3" pkgname=lua-mqtt-publish pkgver=0.2 pkgrel=0 pkgdesc="Lua module for simple MQTT connect, publish and disconnect" url="https://github.com/ncopa/lua-mqtt-publish" arch="all" license="MIT" depends="" depends_dev="" makedepends="$depends_dev" install="" subpackages="" for _v in $_luaversions; do subpackages="$subpackages lua$_v-mqtt-publish:split_${_v/./_}" done source="lua-mqtt-publish-$pkgver.tar.gz::https://github.com/ncopa/lua-mqtt-publish/archive/v$pkgver.tar.gz" _builddir="$srcdir"/lua-mqtt-publish-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { return 0 } package() { cd "$_builddir" for i in $_luaversions; do install -Dm644 "$_builddir"/mqtt/publish.lua \ "$pkgdir"/usr/share/lua/$i/mqtt/publish.lua || return 1 done } _split() { local d= _ver=$1 pkgdesc="$pkgdesc for Lua $_ver" install_if="lua$_ver $pkgname=$pkgver-r$pkgrel" depends="lua$_ver-mosquitto" 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 _v in $_luaversions; do eval "split_${_v/./_}() { _split $_v; }" done sha512sums="3cd815062a0f667ea9d04e57fa85530b395bc5b30cc2adfab2ea3427ee8bae4eaa2243f2b8766bc2bdb3adf2f2a920cad0886961bd41a04fbcea27c2efc75853 lua-mqtt-publish-0.2.tar.gz"