Fix support of multiple database backend definitions.

PR:		ports/127245
Submitted by:	Alexander Kriventsov <akriventsov xx masterhost.ru>
Approved by:	maintainer timeout
This commit is contained in:
Sergey Skvortsov 2008-09-30 15:38:53 +00:00
parent 29fcb971e1
commit e6a9937c49
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221057
2 changed files with 11 additions and 8 deletions

View File

@ -39,7 +39,7 @@ BROKEN= incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}
.endif
PORTREVISION_CLIENT= 0
PORTREVISION_SERVER= 1
PORTREVISION_SERVER= 2
.if !defined(CLIENT_ONLY)
OPTIONS= SASL "With (Cyrus) SASL2 support" off \

View File

@ -39,7 +39,7 @@ start_postcmd=start_postcmd
# extract user and group, adjust ownership of directories and database
DBDIR=`awk '$1 == "directory" {print $2}' "%%PREFIX%%/etc/openldap/slapd.conf"`
DATABASEDIR=`awk '$1 == "directory" {print $2}' "%%PREFIX%%/etc/openldap/slapd.conf"`
start_precmd()
{
@ -49,13 +49,16 @@ start_precmd()
""|[Nn][Oo][Nn][Ee]|[Dd][Ee][Ff][Aa][Uu][Ll][Tt])
;;
*)
if [ ! -d "${DBDIR}" ]; then
mkdir -p "${DBDIR}"
cp "%%PREFIX%%/etc/openldap/DB_CONFIG.example" "${DBDIR}/DB_CONFIG"
fi
local DBDIR
for DBDIR in ${DATABASEDIR}; do
if [ ! -d "${DBDIR}" ]; then
mkdir -p "${DBDIR}"
cp "%%PREFIX%%/etc/openldap/DB_CONFIG.example" "${DBDIR}/DB_CONFIG"
fi
chown -RL "$slapd_owner" "${DBDIR}"
chmod 700 "${DBDIR}"
done
chown "$slapd_owner" "%%LDAP_RUN_DIR%%"
chown -RL "$slapd_owner" "${DBDIR}"
chmod 700 "${DBDIR}"
chown "$slapd_owner" "%%PREFIX%%/etc/openldap/slapd.conf"
slapd_ownername="${slapd_owner%:*}"