APKBUILD 1.76 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
2
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
Natanael Copa's avatar
Natanael Copa committed
3 4
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-ldap
5 6 7
_pkgname=lualdap
pkgver=1.2.3
pkgrel=0
8
pkgdesc="Lua binding to LDAP"
9
url="https://github.com/bdellegrazie/lualdap"
10
arch="noarch"
Natanael Copa's avatar
Natanael Copa committed
11 12
license="MIT"
depends=""
13 14
makedepends="openldap-dev"
subpackages=""
15 16
source="$_pkgname-$pkgver.tar.gz::https://github.com/bdellegrazie/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
Natanael Copa's avatar
Natanael Copa committed
17

18 19 20 21 22 23
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-$_pkgname:_package"
done

Natanael Copa's avatar
Natanael Copa committed
24
prepare() {
25 26 27
	default_prepare || return 1

	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
28
	sed -i -e '/LUA_VERSION_NUM/d' config
29 30 31 32

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver" || return 1
	done
Natanael Copa's avatar
Natanael Copa committed
33 34 35
}

build() {
36 37 38 39 40 41 42
	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
Natanael Copa's avatar
Natanael Copa committed
43 44 45
}

package() {
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
	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
Natanael Copa's avatar
Natanael Copa committed
61 62
}

63 64 65
md5sums="a9eda2f55640a8c816b4d4c6c3d7ef1b  lualdap-1.2.3.tar.gz"
sha256sums="efde10853429fe1c1c208604a352bee395ac897d407f9d7bf9efca62cff02f67  lualdap-1.2.3.tar.gz"
sha512sums="51934d18d1ee97a0130545e657497e51542eef97c338df14e7171f94a2d6395fceb00313e1e64e46e6cdeedf85a17c63284595fdf6fbce8b7abce29d28f1b4a7  lualdap-1.2.3.tar.gz"