aboutsummaryrefslogtreecommitdiffstats
path: root/main/openldap
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-10-26 22:19:57 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-10-26 22:49:57 +0200
commitfdf9881735f867b6a5ea9e8b69346dd4fc872338 (patch)
tree4ee86649548558f449b7dc562164482e1e2e3304 /main/openldap
parent046d831a77e8299deb2069d320f2e7d5287b296e (diff)
downloadaports-fdf9881735f867b6a5ea9e8b69346dd4fc872338.tar.bz2
aports-fdf9881735f867b6a5ea9e8b69346dd4fc872338.tar.xz
main/openldap: move overlays to subpackages
Diffstat (limited to 'main/openldap')
-rw-r--r--main/openldap/APKBUILD31
-rw-r--r--main/openldap/openldap.post-install5
-rw-r--r--main/openldap/openldap.post-upgrade9
3 files changed, 43 insertions, 2 deletions
diff --git a/main/openldap/APKBUILD b/main/openldap/APKBUILD
index 2e5c7a2c35..688a265f72 100644
--- a/main/openldap/APKBUILD
+++ b/main/openldap/APKBUILD
@@ -19,7 +19,8 @@ depends_dev="libressl-dev cyrus-sasl-dev util-linux-dev"
makedepends="$depends_dev db-dev groff unixodbc-dev libtool mosquitto-dev
autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc libldap
- $pkgname-clients $pkgname-mqtt $pkgname-passwd-pbkdf2:passwd_pbkdf2"
+ $pkgname-clients $pkgname-mqtt $pkgname-passwd-pbkdf2:passwd_pbkdf2
+ $pkgname-overlay-all:_overlay_all:noarch"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
source="ftp://ftp.$pkgname.org/pub/OpenLDAP/$pkgname-release/$pkgname-$pkgver.tgz
openldap-2.4-ppolicy.patch
@@ -34,10 +35,21 @@ source="ftp://ftp.$pkgname.org/pub/OpenLDAP/$pkgname-release/$pkgname-$pkgver.tg
"
builddir="$srcdir/$pkgname-$pkgver"
+# SLAPD backends
for _name in bdb hdb ldap mdb meta monitor sql; do
subpackages="$subpackages $pkgname-back-$_name:_backend"
done
+# SLAPD overlays
+_overlays=""
+for _name in accesslog auditlog collect constraint dds deref dyngroup \
+ dynlist memberof ppolicy proxycache refint retcode rwm seqmod \
+ sssvlv syncprov translucent unique valsort
+do
+ subpackages="$subpackages $pkgname-overlay-$_name:_overlay"
+ _overlays="$_overlays $pkgname-overlay-$_name"
+done
+
prepare() {
cd "$builddir"
update_config_sub
@@ -157,6 +169,13 @@ passwd_pbkdf2() {
_submv "usr/lib/openldap/pw-pbkdf2.*"
}
+_overlay_all() {
+ pkgdesc="Virtual package that installs all OpenLDAP overlays"
+ depends="$_overlays"
+
+ mkdir -p "$subpkgdir"
+}
+
_backend() {
backend_name="${subpkgname#openldap-back-}"
pkgdesc="OpenLDAP $backend_name backend"
@@ -164,6 +183,16 @@ _backend() {
_submv "usr/lib/openldap/back_$backend_name*"
}
+_overlay() {
+ overlay_name="${subpkgname#openldap-overlay-}"
+ pkgdesc="OpenLDAP $backend_name overlay"
+
+ case "$overlay_name" in
+ proxycache) overlay_name=pcache;;
+ esac
+ _submv "usr/lib/openldap/$overlay_name*"
+}
+
_submv() {
local path; for path in "$@"; do
mkdir -p "$subpkgdir"/${path%/*}
diff --git a/main/openldap/openldap.post-install b/main/openldap/openldap.post-install
index 1e45b9abd2..e90d257609 100644
--- a/main/openldap/openldap.post-install
+++ b/main/openldap/openldap.post-install
@@ -3,6 +3,9 @@
cat >&2 <<-EOF
*
* To use LDAP server, you have to install some backend. Most users would need MDB
-* backend which you can install using: apk add openldap-back-mdb.
+* backend which you can install with: apk add openldap-back-mdb.
+*
+* If you use overlays, you have to install them separately too:
+* apk add openldap-overlay-<name>, or openldap-overlay-all to install them all.
*
EOF
diff --git a/main/openldap/openldap.post-upgrade b/main/openldap/openldap.post-upgrade
index c10ad5ad2b..28919c7d36 100644
--- a/main/openldap/openldap.post-upgrade
+++ b/main/openldap/openldap.post-upgrade
@@ -4,6 +4,13 @@ new_ver="$1"
old_ver="$2"
if [ "$(apk version -t "$old_ver" "2.4.45-r2")" = "<" ]; then
+ cat >&2 <<-EOF
+ *
+ * If you use some overlays, you have to install them separately:
+ * apk add openldap-overlay-<name>
+ * or install them all:
+ * apk add openldap-overlay-all
+ EOF
if [ -e /var/lib/openldap/openldap-data/data.mdb ]; then
cat >&2 <<-EOF
*
@@ -14,5 +21,7 @@ if [ "$(apk version -t "$old_ver" "2.4.45-r2")" = "<" ]; then
* or "olcModuleload back_mdb.so" to slapd.ldif.
*
EOF
+ else
+ echo "*" >&2
fi
fi