aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/openldap21-server/Makefile39
-rw-r--r--net/openldap21-server/distinfo2
-rw-r--r--net/openldap21-server/files/slapd.sh11
-rw-r--r--net/openldap21-server/files/slurpd.sh2
-rw-r--r--net/openldap21-server/pkg-install52
-rw-r--r--net/openldap21-server/pkg-message8
-rw-r--r--net/openldap21-server/pkg-plist2
-rw-r--r--net/openldap21/Makefile39
-rw-r--r--net/openldap21/distinfo2
-rw-r--r--net/openldap21/files/slapd.sh11
-rw-r--r--net/openldap21/files/slurpd.sh4
-rw-r--r--net/openldap21/pkg-install52
-rw-r--r--net/openldap21/pkg-message8
-rw-r--r--net/openldap21/pkg-plist2
-rw-r--r--net/openldap22-server/Makefile39
-rw-r--r--net/openldap22-server/distinfo2
-rw-r--r--net/openldap22-server/files/slapd.sh11
-rw-r--r--net/openldap22-server/files/slurpd.sh2
-rw-r--r--net/openldap22-server/pkg-install52
-rw-r--r--net/openldap22-server/pkg-message8
-rw-r--r--net/openldap22-server/pkg-plist2
-rw-r--r--net/openldap22/Makefile39
-rw-r--r--net/openldap22/distinfo2
-rw-r--r--net/openldap22/files/slapd.sh11
-rw-r--r--net/openldap22/files/slurpd.sh2
-rw-r--r--net/openldap22/pkg-install52
-rw-r--r--net/openldap22/pkg-message8
-rw-r--r--net/openldap22/pkg-plist2
-rw-r--r--net/openldap23-server/Makefile39
-rw-r--r--net/openldap23-server/distinfo2
-rw-r--r--net/openldap23-server/files/slapd.sh11
-rw-r--r--net/openldap23-server/files/slurpd.sh2
-rw-r--r--net/openldap23-server/pkg-install52
-rw-r--r--net/openldap23-server/pkg-message8
-rw-r--r--net/openldap23-server/pkg-plist2
-rw-r--r--net/openldap24-server/Makefile39
-rw-r--r--net/openldap24-server/distinfo2
-rw-r--r--net/openldap24-server/files/slapd.sh11
-rw-r--r--net/openldap24-server/files/slurpd.sh2
-rw-r--r--net/openldap24-server/pkg-install52
-rw-r--r--net/openldap24-server/pkg-message8
-rw-r--r--net/openldap24-server/pkg-plist2
42 files changed, 589 insertions, 109 deletions
diff --git a/net/openldap21-server/Makefile b/net/openldap21-server/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap21-server/Makefile
+++ b/net/openldap21-server/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap21-server/distinfo b/net/openldap21-server/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap21-server/distinfo
+++ b/net/openldap21-server/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap21-server/files/slapd.sh b/net/openldap21-server/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap21-server/files/slapd.sh
+++ b/net/openldap21-server/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap21-server/files/slurpd.sh b/net/openldap21-server/files/slurpd.sh
index 4551c5fb0c2..9f347253a5d 100644
--- a/net/openldap21-server/files/slurpd.sh
+++ b/net/openldap21-server/files/slurpd.sh
@@ -4,7 +4,7 @@
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap21-server/pkg-install b/net/openldap21-server/pkg-install
new file mode 100644
index 00000000000..76c6c8ff1b3
--- /dev/null
+++ b/net/openldap21-server/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap21-server/pkg-message b/net/openldap21-server/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap21-server/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap21-server/pkg-plist b/net/openldap21-server/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap21-server/pkg-plist
+++ b/net/openldap21-server/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true
diff --git a/net/openldap21/Makefile b/net/openldap21/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap21/Makefile
+++ b/net/openldap21/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap21/distinfo b/net/openldap21/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap21/distinfo
+++ b/net/openldap21/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap21/files/slapd.sh b/net/openldap21/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap21/files/slapd.sh
+++ b/net/openldap21/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap21/files/slurpd.sh b/net/openldap21/files/slurpd.sh
index 8c0685db281..2d2e823d18c 100644
--- a/net/openldap21/files/slurpd.sh
+++ b/net/openldap21/files/slurpd.sh
@@ -1,10 +1,10 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/net/openldap21/files/Attic/slurpd.sh,v 1.1 2003-02-24 04:27:22 edwin Exp $
+# $FreeBSD: /tmp/pcvs/ports/net/openldap21/files/Attic/slurpd.sh,v 1.2 2003-05-23 00:21:04 edwin Exp $
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap21/pkg-install b/net/openldap21/pkg-install
new file mode 100644
index 00000000000..769ec1a303f
--- /dev/null
+++ b/net/openldap21/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/net/openldap21/Attic/pkg-install,v 1.1 2003-05-23 00:21:04 edwin Exp $
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap21/pkg-message b/net/openldap21/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap21/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap21/pkg-plist b/net/openldap21/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap21/pkg-plist
+++ b/net/openldap21/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true
diff --git a/net/openldap22-server/Makefile b/net/openldap22-server/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap22-server/Makefile
+++ b/net/openldap22-server/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap22-server/distinfo b/net/openldap22-server/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap22-server/distinfo
+++ b/net/openldap22-server/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap22-server/files/slapd.sh b/net/openldap22-server/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap22-server/files/slapd.sh
+++ b/net/openldap22-server/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap22-server/files/slurpd.sh b/net/openldap22-server/files/slurpd.sh
index 4551c5fb0c2..9f347253a5d 100644
--- a/net/openldap22-server/files/slurpd.sh
+++ b/net/openldap22-server/files/slurpd.sh
@@ -4,7 +4,7 @@
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap22-server/pkg-install b/net/openldap22-server/pkg-install
new file mode 100644
index 00000000000..76c6c8ff1b3
--- /dev/null
+++ b/net/openldap22-server/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap22-server/pkg-message b/net/openldap22-server/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap22-server/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap22-server/pkg-plist b/net/openldap22-server/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap22-server/pkg-plist
+++ b/net/openldap22-server/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true
diff --git a/net/openldap22/Makefile b/net/openldap22/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap22/Makefile
+++ b/net/openldap22/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap22/distinfo b/net/openldap22/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap22/distinfo
+++ b/net/openldap22/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap22/files/slapd.sh b/net/openldap22/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap22/files/slapd.sh
+++ b/net/openldap22/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap22/files/slurpd.sh b/net/openldap22/files/slurpd.sh
index 4551c5fb0c2..9f347253a5d 100644
--- a/net/openldap22/files/slurpd.sh
+++ b/net/openldap22/files/slurpd.sh
@@ -4,7 +4,7 @@
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap22/pkg-install b/net/openldap22/pkg-install
new file mode 100644
index 00000000000..76c6c8ff1b3
--- /dev/null
+++ b/net/openldap22/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap22/pkg-message b/net/openldap22/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap22/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap22/pkg-plist b/net/openldap22/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap22/pkg-plist
+++ b/net/openldap22/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true
diff --git a/net/openldap23-server/Makefile b/net/openldap23-server/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap23-server/Makefile
+++ b/net/openldap23-server/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap23-server/distinfo b/net/openldap23-server/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap23-server/distinfo
+++ b/net/openldap23-server/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap23-server/files/slapd.sh b/net/openldap23-server/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap23-server/files/slapd.sh
+++ b/net/openldap23-server/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap23-server/files/slurpd.sh b/net/openldap23-server/files/slurpd.sh
index 4551c5fb0c2..9f347253a5d 100644
--- a/net/openldap23-server/files/slurpd.sh
+++ b/net/openldap23-server/files/slurpd.sh
@@ -4,7 +4,7 @@
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap23-server/pkg-install b/net/openldap23-server/pkg-install
new file mode 100644
index 00000000000..76c6c8ff1b3
--- /dev/null
+++ b/net/openldap23-server/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap23-server/pkg-message b/net/openldap23-server/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap23-server/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap23-server/pkg-plist b/net/openldap23-server/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap23-server/pkg-plist
+++ b/net/openldap23-server/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true
diff --git a/net/openldap24-server/Makefile b/net/openldap24-server/Makefile
index 5714c226db6..8d5c15fff46 100644
--- a/net/openldap24-server/Makefile
+++ b/net/openldap24-server/Makefile
@@ -10,16 +10,20 @@
# SLAPD_ONLY builds openldap21-slapd-PORTVERSION (slapd and slapd tools)
# SLURPD_ONLY builds openldap21-slurpd-PORTVERSION (slurpd only)
# SERVERS_ONLY builds openldap21-servers-PORTVERSION (slapd and slurpd)
+# WITHOUT_SASL do not build against sasl2
+#
+# OPENLDAP_STABLE an attempt to track the openldap stable branch
+# It remains to be seen if this stays practical.
#
# $FreeBSD$
#
PORTNAME= openldap21
-PORTVERSION= 2.1.17
-PORTREVISION= 0
+PORTVERSION= 2.1.20
+PORTREVISION= 1
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
- http://www.PlanetMirror.com/pub/openldap/%SUBDIR%/ \
+ http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/\
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
@@ -47,27 +51,42 @@ COMMENT= Open source LDAP client and server software
LIB_DEPENDS+= db41:${PORTSDIR}/databases/db41
-CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
-CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} -I${LOCALBASE}/include/db41
+CXXFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
+CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
+ -I${LOCALBASE}/include \
+ -I${LOCALBASE}/include/db41
+
LDFLAGS+= -L${LOCALBASE}/lib
USE_OPENSSL= yes
HAS_CONFIGURE= yes
-CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
+CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--enable-bdb \
--enable-crypt
+.if defined(WITHOUT_SASL)
+CONFIGURE_ARGS+= \
+ --without-cyrus-sasl
+.else
+LIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2
+CONFIGURE_ARGS+= \
+ --with-cyrus-sasl \
+ --enable-spasswd
+.endif
+
# ------------------------------------------------------------------------------
# common configure
#
CONFIGURE_ARGS+= \
--with-tls \
- --without-cyrus-sasl \
--localstatedir=/var/db
# Include tcp-wrapper support
@@ -382,8 +401,8 @@ PLIST_SUB+= NO_SLUPRD="@comment "
post-patch:
@${CP} ${WRKSRC}/servers/slapd/slapd.conf \
${WRKSRC}/servers/slapd/slapd.conf.Dist
- @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run#' \
- -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run#' \
+ @${SED} -e '/^pidfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
+ -e '/^argsfile/s#%LOCALSTATEDIR%#/var/run/ldap#' \
${WRKSRC}/servers/slapd/slapd.conf.Dist > \
${WRKSRC}/servers/slapd/slapd.conf
diff --git a/net/openldap24-server/distinfo b/net/openldap24-server/distinfo
index 140c904122c..341a1c1cc0c 100644
--- a/net/openldap24-server/distinfo
+++ b/net/openldap24-server/distinfo
@@ -1,2 +1,2 @@
MD5 (openldap-stable-20030410.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
-MD5 (openldap-2.1.17.tgz) = 53fb6c157a7c54b988cf7555e56f11e6
+MD5 (openldap-2.1.20.tgz) = fe6d5f8571672e3107b42299a03e92ce
diff --git a/net/openldap24-server/files/slapd.sh b/net/openldap24-server/files/slapd.sh
index 0e3601b07e5..e8f6ed6b018 100644
--- a/net/openldap24-server/files/slapd.sh
+++ b/net/openldap24-server/files/slapd.sh
@@ -7,18 +7,18 @@ slapd_program=@@PREFIX@@/libexec/slapd
# Uncomment one of the following:
#
# IPv4 Only
-#slapd_args='-h ldap://0.0.0.0'
+#slapd_args='-u ldap -g ldap -h ldap://0.0.0.0'
#
# IPv6 and IPv4
-#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
+#slapd_ags='-u ldap -g ldap -h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
-#slapd_args='-h ldap://[::]'
+#slapd_args='-u ldap -g ldap -h ldap://[::]'
#
#
-slapd_args=
+slapd_args="-u ldap -g ldap"
-pidfile=/var/run/slapd.pid
+pidfile=/var/run/ldap/slapd.pid
case "$1" in
start)
@@ -31,7 +31,6 @@ start)
stop)
if [ -f $pidfile ]; then
kill `cat $pidfile`
- telnet localhost ldap </dev/null >/dev/null 2>&1
echo -n ' slapd'
rm $pidfile
else
diff --git a/net/openldap24-server/files/slurpd.sh b/net/openldap24-server/files/slurpd.sh
index 4551c5fb0c2..9f347253a5d 100644
--- a/net/openldap24-server/files/slurpd.sh
+++ b/net/openldap24-server/files/slurpd.sh
@@ -4,7 +4,7 @@
#
slurpd=@@PREFIX@@/libexec/slurpd
-pidfile=/var/run/slurpd.pid
+pidfile=/var/run/ldap/slurpd.pid
case "$1" in
start)
diff --git a/net/openldap24-server/pkg-install b/net/openldap24-server/pkg-install
new file mode 100644
index 00000000000..76c6c8ff1b3
--- /dev/null
+++ b/net/openldap24-server/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+BATCH=${BATCH:=no}
+
+USER=ldap
+USER_UID=389
+
+GROUP=ldap
+GROUP_GID=389
+
+if [ x"$2" = xPRE-INSTALL ]; then
+ if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if /usr/sbin/pw groupadd ${GROUP} -g ${GROUP_GID} -h -
+ then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+
+ if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if /usr/sbin/pw useradd ${USER} -u ${USER_UID} -g ${GROUP} -h - \
+ -d /nonexistent \
+ -s /sbin/nologin \
+ -c "OpenLDAP Server"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+fi
+
+if [ x"$2" = xPOST-INSTALL ]; then
+ chown -R $USER:$GROUP /var/db/openldap-data
+ chown -R $USER:$GROUP /var/run/ldap
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf
+ chown $USER:$GROUP $PKG_PREFIX/etc/openldap/slapd.conf.default
+fi
+
diff --git a/net/openldap24-server/pkg-message b/net/openldap24-server/pkg-message
new file mode 100644
index 00000000000..dce1c78534b
--- /dev/null
+++ b/net/openldap24-server/pkg-message
@@ -0,0 +1,8 @@
+The openldap21 port now creates a ldap user an a ldap group.
+
+If you use slapadd as root to populate your ldap Database please
+remember to chown the database directories and containing files
+to user ldap and group ldap.
+
+ chown -R ldap:ldap /var/db/openldap-data
+
diff --git a/net/openldap24-server/pkg-plist b/net/openldap24-server/pkg-plist
index daf831f7fa4..6be84f593b8 100644
--- a/net/openldap24-server/pkg-plist
+++ b/net/openldap24-server/pkg-plist
@@ -93,3 +93,5 @@
%%NO_SLAPD%%@unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
%%NO_SLAPD%%@exec [ -d /var/db/openldap-data ] || /bin/mkdir /var/db/openldap-data
%%NO_SLAPD%%@unexec /bin/rmdir /var/db/openldap-data 2>/dev/null || true
+%%NO_SLAPD%%@exec [ -d /var/run/ldap ] || /bin/mkdir /var/run/ldap
+%%NO_SLAPD%%@unexec /bin/rmdir /var/run/ldap 2>/dev/null || true