aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-curl
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-05 23:08:11 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-05 23:08:39 +0200
commitb9278f66afc21874da6e03c8b4fb95812df4ab07 (patch)
treec9e09635daf021f5bfd798873728c8113c0c2827 /main/lua-curl
parent80ddc55d3a19f84e9210cb27b8f84ce099396078 (diff)
downloadaports-b9278f66afc21874da6e03c8b4fb95812df4ab07.tar.bz2
aports-b9278f66afc21874da6e03c8b4fb95812df4ab07.tar.xz
main/lua-curl: simplify abuild
Diffstat (limited to 'main/lua-curl')
-rw-r--r--main/lua-curl/APKBUILD68
1 files changed, 31 insertions, 37 deletions
diff --git a/main/lua-curl/APKBUILD b/main/lua-curl/APKBUILD
index 68d7630592..f56b10d903 100644
--- a/main/lua-curl/APKBUILD
+++ b/main/lua-curl/APKBUILD
@@ -1,62 +1,56 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-curl
+_pkgname=Lua-cURLv3
pkgver=0.3.5
pkgrel=0
pkgdesc="Lua bindings to cURL library"
url="https://github.com/Lua-cURL/Lua-cURLv3"
-arch="all"
+arch="noarch"
license="MIT/X11"
-depends=
+depends=""
makedepends="curl-dev"
-install=
subpackages=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/Lua-cURL/$_pkgname/archive/v$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$pkgver"
-for _i in $_luaversions; do
- makedepends="$makedepends lua${_i}-dev"
- subpackages="$subpackages lua${_i}-curl:_split${_i/./}"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done
-source="lua-curl-$pkgver.tar.gz::https://github.com/Lua-cURL/Lua-cURLv3/archive/v$pkgver.tar.gz"
+prepare() {
+ default_prepare || return 1
-_builddir="$srcdir"/Lua-cURLv3-$pkgver
-build() {
- cd "$srcdir"
- for _i in $_luaversions; do
- cp -r "$_builddir" build-$_i || return 1
-
- cd build-$_i
- echo LUA_IMPL=lua$_i >> .config
- make LUA_VERSION=$_i || return 1
- cd ..
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
done
}
-package() {
- cd "$srcdir"
- for _i in $_luaversions; do
- (cd "$srcdir"/build-$_i && make install LUA_VERSION=$_i \
- DESTDIR="$pkgdir") \
- || return 1
+build() {
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ cd "$builddir-$lver"
+ echo LUA_IMPL=lua$lver >> .config
+ make LUA_VERSION=$lver || return 1
done
}
-_split() {
- local d= _ver=$1
- pkgdesc="$pkgdesc for Lua $_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() {
+ mkdir -p "$pkgdir"
}
-for _i in $_luaversions; do
- eval "_split${_i/./}() { _split $_i; }"
-done
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ arch="all"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+
+ cd "$builddir-$lver"
+ make install DESTDIR="$subpkgdir" LUA_VERSION=$lver
+}
md5sums="7353a52c51162d81ba5ecdb4147161fb lua-curl-0.3.5.tar.gz"
sha256sums="9ad2c38d676fedfac6883da0e7c2dc3a19af6f8be1417440c3141ff56463ea2a lua-curl-0.3.5.tar.gz"