# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
_php=php82
pkgname=phpldapadmin
pkgver=1.2.6.7
pkgrel=1
pkgdesc="Web front-end for managing OpenLDAP"
url="https://www.phpldapadmin.org/"
arch="noarch"
license="GPL-2.0-or-later"
options="!check" # no test suite
depends="$_php $_php-ldap
	$_php-gettext
	$_php-mbstring
	$_php-opcache
	$_php-openssl
	$_php-session
	$_php-xml
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/leenooks/phpLDAPadmin/archive/$pkgver.tar.gz
	$pkgname.additional-template
	fix-php82.patch::https://github.com/leenooks/phpLDAPadmin/pull/202.diff
	"
builddir="$srcdir"/phpLDAPadmin-$pkgver

# secfixes:
#   1.2.6.6-r0:
#     - CVE-2020-35132
#   1.2.3-r4:
#     - CVE-2017-11107

package() {
	mkdir -p "$pkgdir"/usr/share/webapps/phpldapadmin
	mkdir -p "$pkgdir"/etc
	mv ./* "$pkgdir"/usr/share/webapps/phpldapadmin
	mv "$pkgdir"/usr/share/webapps/phpldapadmin/config "$pkgdir"/etc/phpldapadmin
	ln -s /etc/phpldapadmin "$pkgdir"/usr/share/webapps/phpldapadmin/config
	install -Dm644 ../$pkgname.additional-template \
		"$pkgdir"/usr/share/webapps/phpldapadmin/templates/creation/groupOfNames.xml
}

sha512sums="
4a0ea1cb5bfeeb6a6a242b29137cdd26c014788d771ce9cf5dcef771756b38575a2fd3e04d00cd3ff5181bf8891037bc347d4f933c67958376d2246fa72752c7  phpldapadmin-1.2.6.7.tar.gz
913cc89bfba3a24064865f091a3bcc6ec88db0824d750e8b3b1f6497b5ac1a1e158ced895f1f85f93607402e9353798b3dd4ccdbb1454713f96937c884456eb7  phpldapadmin.additional-template
9a81f8526278bb280ae3ab4a99af1f99e27ee5a932b8fe20e60b28032065c82ab98d7a45a653541de74eacacc3f71bb9f64b2dbb418f20055db6ebaf624a0150  fix-php82.patch
"
