aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-curl/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-09-24 08:47:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-09-24 14:03:38 +0000
commitfb9ea65b4bb1da892034040939730153d28345c1 (patch)
tree7d815a6622eff20f522ee7b3ae4966e9c0ea85ef /main/lua-curl/APKBUILD
parentc2bd759ec687b7975232cfcb3d7916c540f9ed7f (diff)
downloadaports-fb9ea65b4bb1da892034040939730153d28345c1.tar.bz2
aports-fb9ea65b4bb1da892034040939730153d28345c1.tar.xz
main/lua-curl: upgrade to 0.3.0 and add lua 5.2 support
Diffstat (limited to 'main/lua-curl/APKBUILD')
-rw-r--r--main/lua-curl/APKBUILD65
1 files changed, 49 insertions, 16 deletions
diff --git a/main/lua-curl/APKBUILD b/main/lua-curl/APKBUILD
index e7f0f2377c..a9fdd36d83 100644
--- a/main/lua-curl/APKBUILD
+++ b/main/lua-curl/APKBUILD
@@ -1,33 +1,66 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-_luaver=5.1
+_luaversions="5.1 5.2"
pkgname=lua-curl
-pkgver=0.2.3
+pkgver=0.3.0
pkgrel=0
pkgdesc="Lua bindings to cURL library"
url="http://lua-curl.luaforge.net/"
arch="all"
license="MIT/X11"
depends=
-makedepends="lua-dev curl-dev cmake"
+makedepends="curl-dev"
install=
subpackages=""
-source="lua-curl-$pkgver.tar.gz::https://github.com/msva/lua-curl/archive/$pkgver.tar.gz"
-_builddir="$srcdir"/lua-curl-$pkgver
+for _i in $_luaversions; do
+ makedepends="$makedepends lua${_i}-dev"
+ subpackages="$subpackages lua${_i}-curl:_split${_i/./}"
+ depends="$depends lua${_i}-curl"
+done
+
+source="lua-curl-$pkgver.tar.gz::https://github.com/Lua-cURL/Lua-cURLv3/archive/v$pkgver.tar.gz"
+
+_builddir="$srcdir"/Lua-cURLv3-$pkgver
build() {
- cd "$_builddir"
- cmake . \
- -DCMAKE_BUILD_TYPE=Release \
- || return 1
- make
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ cp -r "$_builddir" build-$_i || return 1
+
+ cd build-$_i
+ echo LUA_IMPL=lua$_i >> .config
+# echo LUA_CMOD=/usr/lib/lua/$_i >> .config
+# echo LUA_LMOD=/usr/share/lua/$_i >> .config
+
+ make LUA_VERSION=$_i || return 1
+ cd ..
+ done
}
package() {
- cd "$_builddir"
- make install DESTDIR="$pkgdir"
- rm -f "$pkgdir"/usr/lib/lua/$_luaver/cURL.la
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ (cd "$srcdir"/build-$_i && make install LUA_VERSION=$_i \
+ DESTDIR="$pkgdir") \
+ || return 1
+ done
}
-md5sums="5ce07f1b795b6a2d4745db93a84902ff lua-curl-0.2.3.tar.gz"
-sha256sums="1bb569698ac82f7147a7c7e4bd0e635a249e09d5c3385e613c3bb5db3350e773 lua-curl-0.2.3.tar.gz"
-sha512sums="9f8c775359cb527c60c0491848b9251adca635e05d3c7a74d38e34cac64abcd534afb670d97c57c23ba11aada19aa6f9eb017fb55308ee8b59ed8ce861c490e9 lua-curl-0.2.3.tar.gz"
+_split() {
+ local d= _ver=$1
+ pkgdesc="$pkgdesc for Lua $_ver"
+ 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
+}
+
+for _i in $_luaversions; do
+ eval "_split${_i/./}() { _split $_i; }"
+done
+
+md5sums="ac6ae0534d3d5ee1cf9dacb237f76016 lua-curl-0.3.0.tar.gz"
+sha256sums="2d92301f31a700927a7099be089f4161b8f540a1c36fd40fc550f72da572e5e7 lua-curl-0.3.0.tar.gz"
+sha512sums="69c697f39129e57328b2fd65dc6e5ad82f8dbb5757dd40466970693f882f0f99d87e30de6b48eb8c0eeb30564d6e7de1f81359269567910c8d3c6fc0e714f97f lua-curl-0.3.0.tar.gz"