Commit deb7bf4c authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

main/lua-ldap: add lua5.1/lua5.2/lua5.3 subpackages

parent b763c534
# Contributor: Natanael Copa <> # Contributor: Natanael Copa <>
# Contributor: Jakub Jirutka <>
# Maintainer: Natanael Copa <> # Maintainer: Natanael Copa <>
pkgname=lua-ldap pkgname=lua-ldap
_pkgname=lualdap _pkgname=lualdap
pkgver=1.2.3 pkgver=1.2.3
pkgrel=0 pkgrel=0
pkgdesc="Lua binding to ldap" pkgdesc="Lua binding to LDAP"
url="" url=""
arch="all" arch="noarch"
license="MIT" license="MIT"
depends="" depends=""
makedepends="lua-dev openldap-dev" makedepends="openldap-dev"
source="$_pkgname-$pkgver.tar.gz::$_pkgname/archive/v$pkgver.tar.gz" source="$_pkgname-$pkgver.tar.gz::$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver" 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"
prepare() { prepare() {
default_prepare || return 1 default_prepare || return 1
cd "$builddir" cd "$builddir"
sed -i -e '/LUA_VERSION_NUM/d' config sed -i -e '/LUA_VERSION_NUM/d' config
local lver; for lver in $_luaversions; do
cp -r "$builddir" "$builddir-$lver" || return 1
} }
build() { build() {
cd "$builddir" local lver; for lver in $_luaversions; do
make OPENLDAP_LIB="-lldap -llber" \ msg "Building for Lua $lver..."
WARN="-DLDAP_DEPRECATED -fPIC -ansi $CFLAGS" || return 1
cd "$builddir-$lver"
make CFLAGS="-DLDAP_DEPRECATED -fPIC -ansi $(pkg-config --cflags lua$lver)" \
OPENLDAP_LIB="-lldap -llber" || return 1
} }
package() { package() {
cd "$builddir" mkdir -p "$pkgdir"
local install_cmod=$(pkg-config --variable=INSTALL_CMOD lua) }
make install LUA_LIBDIR="$pkgdir"/$install_cmod
_package() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc (for 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)" \
} }
md5sums="a9eda2f55640a8c816b4d4c6c3d7ef1b lualdap-1.2.3.tar.gz" md5sums="a9eda2f55640a8c816b4d4c6c3d7ef1b lualdap-1.2.3.tar.gz"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment