diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2016-11-03 13:45:45 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2016-11-03 13:47:19 +0000 |
commit | 5d1f3cfaebff360d742758716c52c42416785e46 (patch) | |
tree | 949fd84bf5ab1b9ec735c99610e5aacaf7c95aac /main/lua-dbi | |
parent | 37c17ad59918915e54a8d9f3a06c69f3beef3206 (diff) | |
download | aports-5d1f3cfaebff360d742758716c52c42416785e46.tar.bz2 aports-5d1f3cfaebff360d742758716c52c42416785e46.tar.xz |
main/lua-dbi: build for multiple lua versions
Diffstat (limited to 'main/lua-dbi')
-rw-r--r-- | main/lua-dbi/APKBUILD | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/main/lua-dbi/APKBUILD b/main/lua-dbi/APKBUILD index 70d6ef6710..73a228ed18 100644 --- a/main/lua-dbi/APKBUILD +++ b/main/lua-dbi/APKBUILD @@ -1,65 +1,64 @@ # Contributor: Ćukasz Jendrysik <scadu@yandex.com> -# Contributor: Leonardo Arena <rnarld@alpinelinux.org> -# Maintainer: +# Maintainer: Leonardo Arena <rnarld@alpinelinux.org> +_luaversions="5.1 5.2 5.3" pkgname=lua-dbi _realname=luadbi pkgver=0.5 -pkgrel=6 +pkgrel=7 pkgdesc="A database interface library for Lua" url="http://code.google.com/p/luadbi" -arch="all" +arch="noarch" license="GPL" depends="" makedepends="lua-dev mariadb-dev postgresql-dev sqlite-dev" install="" -subpackages="$pkgname-mysql $pkgname-postgresql $pkgname-sqlite" -source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luadbi/$_realname.$pkgver.tar.gz +_subpackages="$pkgname-mysql $pkgname-postgresql $pkgname-sqlite3" +source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luadbi/luadbi.$pkgver.tar.gz lua-dbi-0.5-sync-hg-47382fea7a9c.patch" -_builddir="$srcdir" +for _v in $_luaversions; do + makedepends="$makedepends lua$_v-dev" + for subpkg in $_subpackages; do + subpackages="$subpackages lua$_v-${subpkg#lua-}:_subpackage:all" + done +done + +builddir="$srcdir" prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac + default_prepare || return 1 + local lver; for lver in $_luaversions; do + cp -r "$builddir" "$builddir-$lver" || return 1 done } build() { - cd "$_builddir" - make || return 1 + 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 } package() { - cd "$_builddir" - # install -d "$pkgdir"/usr/lib/lua/5.1 - install -D -m755 "$srcdir"/DBI.lua "$pkgdir"/usr/share/lua/5.1/DBI.lua || return 1 -} - -_mv_backend() { - install -d "$subpkgdir"/usr/lib/lua/5.1 - mv "$srcdir"/dbd${1}.so "$subpkgdir"/usr/lib/lua/5.1 + mkdir -p "$pkgdir" } -sqlite() { - pkgdesc="lua-dbi SQLite backend" - depends="lua-dbi" - _mv_backend sqlite3 -} - -mysql() { - pkgdesc="lua-dbi MySQL backend" - depends="lua-dbi" - _mv_backend mysql -} - -postgresql() { - pkgdesc="lua-dbi PostgreSQL backend" - depends="lua-dbi" - _mv_backend postgresql +_subpackage() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc (for Lua $lver)" + depends="lua$lver" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" + cd "$builddir-$lver" + install -D -m755 "$builddir-$lver"/DBI.lua \ + "$subpkgdir"/usr/share/lua/$lver/DBI.lua || return 1 + for db in sqlite3 postgresql mysql; do + if [ "${subpkgname%$db}" != "$subpkgname" ]; then + install -D -m644 "$builddir-$lver"/dbd${db}.so \ + "$subpkgdir"/usr/lib/lua/$lver/dbd${db}.so + fi + done } md5sums="ede2b003aadddc151aac87050c3d926e luadbi.0.5.tar.gz |