# Maintainer: Natanael Copa _luaversions="5.1 5.2 5.3 5.4" pkgname=lua-mqtt-publish pkgver=0.4 pkgrel=0 pkgdesc="Lua module for simple MQTT connect, publish and disconnect" url="https://github.com/ncopa/lua-mqtt-publish" arch="all" license="MIT" makedepends="lua-mosquitto" # so build order can be calculated for _v in $_luaversions; do subpackages="$subpackages lua$_v-mqtt-publish:_split" done source="lua-mqtt-publish-$pkgver.tar.gz::https://github.com/ncopa/lua-mqtt-publish/archive/v$pkgver.tar.gz" package() { for i in $_luaversions; do install -Dm644 "$builddir"/mqtt/publish.lua \ "$pkgdir"/usr/share/lua/$i/mqtt/publish.lua done } _split() { local d= _ver=${subpkgname#lua}; _ver=${_ver%%-*} msg "_ver=$_ver" 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/ fi done } sha512sums=" a4a803002a6dd1af508b5a33296ac2aecdcb26af0a4b6fe11bfe17145e0f4d36c4271591c68e1f1e221cdfe71c3ba00852ae87d7065e0a58e235e8ba48ea0cbb lua-mqtt-publish-0.4.tar.gz "