aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-04-27 13:06:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2020-04-27 13:06:50 +0000
commitf3c1355ca20b2f845b6cd78942f0d66ce88ac527 (patch)
treef2d71a23526f9e04b744300881ba601817d5c362
parentf2b867b573c3f54b1e8d0f7df718c8cd65cb3394 (diff)
downloadaports-f3c1355ca20b2f845b6cd78942f0d66ce88ac527.tar.gz
aports-f3c1355ca20b2f845b6cd78942f0d66ce88ac527.tar.bz2
aports-f3c1355ca20b2f845b6cd78942f0d66ce88ac527.tar.xz
main/lua-mqtt-publish: modernize, fix makedepends
set makedepends to fix the build order
-rw-r--r--main/lua-mqtt-publish/APKBUILD36
1 files changed, 8 insertions, 28 deletions
diff --git a/main/lua-mqtt-publish/APKBUILD b/main/lua-mqtt-publish/APKBUILD
index fc33b985d3..5300d31df1 100644
--- a/main/lua-mqtt-publish/APKBUILD
+++ b/main/lua-mqtt-publish/APKBUILD
@@ -2,62 +2,42 @@
_luaversions="5.1 5.2 5.3"
pkgname=lua-mqtt-publish
pkgver=0.3
-pkgrel=0
+pkgrel=1
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=""
+makedepends="lua-mosquitto" # so build order can be calculated
for _v in $_luaversions; do
- subpackages="$subpackages lua$_v-mqtt-publish:split_${_v/./_}"
+ 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"
-_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
+ install -Dm644 "$builddir"/mqtt/publish.lua \
+ "$pkgdir"/usr/share/lua/$i/mqtt/publish.lua
done
}
_split() {
- local d= _ver=$1
+ 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/ || return 1
+ mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/
fi
done
}
-
-for _v in $_luaversions; do
- eval "split_${_v/./_}() { _split $_v; }"
-done
-
sha512sums="ccbf87c53305e19a2dd04f07ac7b3d1fdae3ce0a6c726b89f357d3d5a68a73c0ce830d0ca47d57eaf1990224fcc97794720bdbc8e4e0caa408003cc33dce3b65 lua-mqtt-publish-0.3.tar.gz"