aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-mqtt-publish
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-10-02 10:30:20 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-10-02 10:32:05 +0200
commit41f632abc029e741edd2c08218cd4aeb87b235e9 (patch)
tree9f024f9345a1db9e38a03f1bdc81f4a74d900730 /main/lua-mqtt-publish
parentd9d60bc43de06d214320535d9621d505908582f3 (diff)
downloadaports-41f632abc029e741edd2c08218cd4aeb87b235e9.tar.bz2
aports-41f632abc029e741edd2c08218cd4aeb87b235e9.tar.xz
main/lua-mqtt-publish: move from testing
Diffstat (limited to 'main/lua-mqtt-publish')
-rw-r--r--main/lua-mqtt-publish/APKBUILD65
1 files changed, 65 insertions, 0 deletions
diff --git a/main/lua-mqtt-publish/APKBUILD b/main/lua-mqtt-publish/APKBUILD
new file mode 100644
index 0000000000..36f8bd0409
--- /dev/null
+++ b/main/lua-mqtt-publish/APKBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
+pkgname=lua-mqtt-publish
+pkgver=0.1
+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
+
+md5sums="7bbb50f6c30ac61162960837aefd5f60 lua-mqtt-publish-0.1.tar.gz"
+sha256sums="4def7f57a9007a382d838f292ca9d6ac5c12bd7416117ab3da6de7c397079b35 lua-mqtt-publish-0.1.tar.gz"
+sha512sums="1e8abf1d8ca8b81d49b9f4097e1695e4cae8094859956487bc889df92c22d7c2a11b5257b51e1ee10302523d3e796d027477136ab92f9601447f1ac2cb6c8bf4 lua-mqtt-publish-0.1.tar.gz"