Commit deb7bf4c authored by Jakub Jirutka's avatar Jakub Jirutka

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

parent b763c534
# Contributor: Natanael Copa <ncopa@alpinelinux.org> # Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
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="https://github.com/bdellegrazie/lualdap" url="https://github.com/bdellegrazie/lualdap"
arch="all" arch="noarch"
license="MIT" license="MIT"
depends="" 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" source="$_pkgname-$pkgver.tar.gz::https://github.com/bdellegrazie/$_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"
done
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
done
} }
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
done
} }
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)"
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" 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