void-packages/srcpkgs/lua-lualdap/template
2019-02-25 23:08:47 -03:00

68 lines
1.6 KiB
Bash

# Template file for 'lua-lualdap'
pkgname=lua-lualdap
version=1.2.5
revision=1
wrksrc="lualdap-${version}"
build_style=gnu-makefile
hostmakedepends="pkg-config"
makedepends="lua51-devel lua52-devel lua-devel libldap-devel"
short_desc="LDAP bindings for Lua"
maintainer="John Regan <john@jrjrtech.com>"
license="MIT"
homepage="https://github.com/lualdap/lualdap"
distfiles="https://github.com/lualdap/lualdap/archive/v${version}.tar.gz"
checksum=3e028faa6a5798cf2f3d50b9853b9b3fb6eb562b62010747bd5b6f50b57bb1cc
post_extract() {
cd ${wrksrc}
mkdir -p lua51
mv * lua51 || :
cp -a lua51 lua52
cp -a lua51 lua53
}
do_build() {
for luaver in 5.1 5.2 5.3; do
cd ${wrksrc}/lua${luaver//.}
vsed -i "s|^LUA_VERSION.*|LUA_VERSION = ${luaver}|g" config
make \
CC=$CC \
LD=$CC \
CFLAGS="$(pkg-config --cflags lua${luaver})" \
LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \
LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \
${makejobs}
done
}
do_install() {
for luaver in 5.1 5.2 5.3; do
vmkdir usr/lib/lua/$luaver
cd ${wrksrc}/lua${luaver//.}
make \
CC=$CC \
LD=$CC \
CFLAGS="$(pkg-config --cflags lua${luaver})" \
LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \
LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \
DESTDIR="${DESTDIR}" \
install
done
vlicense ${wrksrc}/lua53/LICENSE.md
}
lua51-lualdap_package() {
short_desc+=" - Lua 5.1"
pkg_install() {
vmove usr/lib/lua/5.1
vlicense lua51/LICENSE.md
}
}
lua52-lualdap_package() {
short_desc+=" - Lua 5.2"
pkg_install() {
vmove usr/lib/lua/5.2
vlicense lua52/LICENSE.md
}
}