aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ldap
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 13:00:56 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 13:09:53 +0200
commitdeb7bf4c4a205629a7ad1bf0e573fe4ba43d020d (patch)
tree8d85ca735c676b97251e30f70b2a82ff7f8036c3 /main/lua-ldap
parentb763c5341de6bf3ac59f35351a375269f1e89da3 (diff)
downloadaports-deb7bf4c4a205629a7ad1bf0e573fe4ba43d020d.tar.bz2
aports-deb7bf4c4a205629a7ad1bf0e573fe4ba43d020d.tar.xz
main/lua-ldap: add lua5.1/lua5.2/lua5.3 subpackages
Diffstat (limited to 'main/lua-ldap')
-rw-r--r--main/lua-ldap/APKBUILD46
1 files changed, 37 insertions, 9 deletions
diff --git a/main/lua-ldap/APKBUILD b/main/lua-ldap/APKBUILD
index e26266b8f8..00611de5ea 100644
--- a/main/lua-ldap/APKBUILD
+++ b/main/lua-ldap/APKBUILD
@@ -1,35 +1,63 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-ldap
_pkgname=lualdap
pkgver=1.2.3
pkgrel=0
-pkgdesc="Lua binding to ldap"
+pkgdesc="Lua binding to LDAP"
url="https://github.com/bdellegrazie/lualdap"
-arch="all"
+arch="noarch"
license="MIT"
depends=""
-makedepends="lua-dev openldap-dev"
+makedepends="openldap-dev"
+subpackages=""
source="$_pkgname-$pkgver.tar.gz::https://github.com/bdellegrazie/$_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-$_pkgname:_package"
+done
+
prepare() {
default_prepare || return 1
cd "$builddir"
sed -i -e '/LUA_VERSION_NUM/d' config
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
+ done
}
build() {
- cd "$builddir"
- make OPENLDAP_LIB="-lldap -llber" \
- WARN="-DLDAP_DEPRECATED -fPIC -ansi $CFLAGS" || return 1
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ cd "$builddir-$lver"
+ make CFLAGS="-DLDAP_DEPRECATED -fPIC -ansi $(pkg-config --cflags lua$lver)" \
+ OPENLDAP_LIB="-lldap -llber" || return 1
+ done
}
package() {
- cd "$builddir"
- local install_cmod=$(pkg-config --variable=INSTALL_CMOD lua)
- make install LUA_LIBDIR="$pkgdir"/$install_cmod
+ mkdir -p "$pkgdir"
+}
+
+_package() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ arch="all"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ [ "$lver" = "5.1" ] && replaces="$pkgname"
+
+ cd "$builddir-$lver"
+ make DESTDIR="$subpkgdir" \
+ LUA_LIBDIR="$(pkg-config --variable=INSTALL_CMOD lua$lver)" \
+ install
}
md5sums="a9eda2f55640a8c816b4d4c6c3d7ef1b lualdap-1.2.3.tar.gz"