aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-mosquitto
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-03 23:27:42 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-03 23:28:01 +0200
commit1cb9a3c256d076b67ad03c2815cd8f79a33a50f4 (patch)
tree1267b3f516c92a524f7c4f6143a85497a3675037 /main/lua-mosquitto
parentcfb77533484fc4e3a78768961bc8255682c5ebe8 (diff)
downloadaports-1cb9a3c256d076b67ad03c2815cd8f79a33a50f4.tar.bz2
aports-1cb9a3c256d076b67ad03c2815cd8f79a33a50f4.tar.xz
main/lua-mosquitto: improve abuild
Diffstat (limited to 'main/lua-mosquitto')
-rw-r--r--main/lua-mosquitto/APKBUILD72
1 files changed, 25 insertions, 47 deletions
diff --git a/main/lua-mosquitto/APKBUILD b/main/lua-mosquitto/APKBUILD
index d8c31dd375..c7b9ccc98b 100644
--- a/main/lua-mosquitto/APKBUILD
+++ b/main/lua-mosquitto/APKBUILD
@@ -1,77 +1,55 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-
-_luaversions="5.1 5.2 5.3"
-
pkgname=lua-mosquitto
pkgver=0.2
pkgrel=0
pkgdesc="Bindingd to libmosquitto for Lua"
url="https://github.com/flukso/lua-mosquitto"
-arch="all"
+arch="noarch"
license="MIT"
depends=""
-depends_dev=""
-makedepends="$depends_dev mosquitto-dev"
+makedepends="mosquitto-dev"
subpackages=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/flukso/$pkgname/archive/v$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
- subpackages="$subpackages lua$_v-mosquitto:split_${_v/./_}"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
-install=""
-source="lua-mosquitto-$pkgver.tar.gz::https://github.com/flukso/lua-mosquitto/archive/v$pkgver.tar.gz
- "
-
-_builddir="$srcdir"/lua-mosquitto-$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
- cd "$srcdir"
- for i in $_luaversions; do
- cp -r lua-mosquitto-$pkgver build-$i || return 1
+ default_prepare || return 1
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
done
}
build() {
- for i in $_luaversions; do
- cd "$srcdir"/build-$i
- make LUAPKGC=lua$i || return 1
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+ make -C "$builddir-$lver" LUAPKGC=lua$lver || return 1
done
}
package() {
- for i in $_luaversions; do
- cd "$srcdir"/build-$i
- make install DESTDIR="$pkgdir" LUAPKGC=lua$i \
- LUA_LIBDIR=/usr/lib || return 1
- done
+ mkdir -p "$pkgdir"
}
-_split() {
- local d= _ver=$1
- pkgdesc="$pkgdesc $_ver"
- install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
- depends=
- 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
+_package() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc $lver"
+ arch="all"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+
+ cd "$builddir-$lver"
+ make install DESTDIR="$subpkgdir" \
+ LUA_LIBDIR=/usr/lib \
+ LUAPKGC=lua$lver
}
-
-for _v in $_luaversions; do
- eval "split_${_v/./_}() { _split $_v; }"
-done
-
-
md5sums="4954191018ad2cfed6273e2547750e6c lua-mosquitto-0.2.tar.gz"
sha256sums="1468e82e3ddb52fe68d042b2b5ae704f3a794184165f59743acc8ff6ed805703 lua-mosquitto-0.2.tar.gz"
sha512sums="02a96ede4ac594ef9bcb838816f55e6f4c5fe8daaad21e2fd8d123a307f326ec599f42fe6e56527e0da195883c73fec945fde77bc07f69f85840871a5f1c9490 lua-mosquitto-0.2.tar.gz"