aboutsummaryrefslogtreecommitdiff
path: root/net/openldap22-server/pkg-install
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2003-08-28 12:51:08 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2003-08-28 12:51:08 +0000
commitd90d7b94c09bda503e13bca12bb41b8de10580bc (patch)
treee9778dfd76653c2bf7218cb642a93c523eea21d6 /net/openldap22-server/pkg-install
parentc55a2fd4cb2ed0f1be53553955a161db4002332a (diff)
downloadports-d90d7b94c09bda503e13bca12bb41b8de10580bc.tar.gz
ports-d90d7b94c09bda503e13bca12bb41b8de10580bc.zip
[MAINTAINER] ports net/openldap2[012]-server: use RC_SUBR, miscellaneous improvements
- use RC_SUBR (PR 54352, submitted by Scot W. Hetzel <hetzels@westbend.net>) - run slapd under a non-privileged account by default (PR 56075) - remove ${PORTSDIR}/net/openldap20-server/bsd.openldap.mk (PR 55680) - use USE_OPENLDAP - improve conflict checking (PR 54845, submitted by Jens Rehsack <rehsack@liwing.de>) - make ODBC library selectable (PR 46288, submitted by Emile Heitor <eheitor@fr.cw.net>) - don't use USE_OPENSSL to avoid gazillions of -rpath warnings PR: ports/56077 Submitted by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
Notes
Notes: svn path=/head/; revision=87902
Diffstat (limited to 'net/openldap22-server/pkg-install')
-rw-r--r--net/openldap22-server/pkg-install44
1 files changed, 38 insertions, 6 deletions
diff --git a/net/openldap22-server/pkg-install b/net/openldap22-server/pkg-install
index 6f6b98653853..47b2ea825164 100644
--- a/net/openldap22-server/pkg-install
+++ b/net/openldap22-server/pkg-install
@@ -2,10 +2,42 @@
#
# $FreeBSD$
#
-if [ X"$2" != X"POST-INSTALL" ]; then
- exit 0;
-fi
-mkdir -p "%%LDAP_RUN_DIR%%"
-mkdir -p -m 700 "%%LOCALSTATEDIR%%/openldap-data"
-mkdir -p -m 700 "%%LOCALSTATEDIR%%/openldap-slurp"
+CHOWN=/usr/sbin/chown
+ECHO_CMD=echo
+GREP=/usr/bin/grep
+PW=/usr/sbin/pw
+
+FTPUSERS=/etc/ftpusers
+
+case $2 in
+PRE-INSTALL)
+ if ! ${PW} usershow -n ldap >/dev/null 2>&1; then
+ if ! ${PW} groupshow -n ldap >/dev/null 2>&1; then
+ if ! ${PW} groupadd -n ldap -g 389; then
+ ${ECHO_CMD}
+ ${ECHO_CMD} "*** Failed to add a group ldap with id 389."
+ ${ECHO_CMD}
+ ${ECHO_CMD} "Please add the ldap user manually with"
+ ${ECHO_CMD} " ${PW} useradd -n ldap -g ldap -c 'OpenLDAP server' \\"
+ ${ECHO_CMD} " -d /nonexistent -s /sbin/nologin -h -"
+ ${ECHO_CMD} "and retry installing this package."
+ exit 1
+ fi
+ fi
+ if ${PW} useradd -n ldap -u 389 -g ldap -c 'OpenLDAP Server' \
+ -d /nonexistent -s /sbin/nologin -h -; then
+ ${GREP} -qs '^ldap$' ${FTPUSERS} || ${ECHO_CMD} ldap >> ${FTPUSERS}
+ else
+ ${ECHO_CMD}
+ ${ECHO_CMD} "*** Failed to add an user ldap with id 389."
+ ${ECHO_CMD}
+ ${ECHO_CMD} "Please add the ldap user manually with"
+ ${ECHO_CMD} " ${PW} useradd -n ldap -g ldap -c 'OpenLDAP server' \\"
+ ${ECHO_CMD} " -d /nonexistent -s /sbin/nologin -h -"
+ ${ECHO_CMD} "and retry installing this package."
+ exit 1
+ fi
+ fi
+ ;;
+esac