diff options
author | root <root@rshg047.dnsready.net> | 2011-06-20 23:03:55 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-06-20 23:03:55 +0000 |
commit | f02c28de0bbcb85e152fc19d0008805021fe1a33 (patch) | |
tree | 0cb0a135fbbb06d2e31fe64ff2caad474dcc3813 /staging/openldap | |
parent | 5457eacc747fc3f91e10a1f452230b1feac39eff (diff) |
Mon Jun 20 23:03:54 UTC 2011
Diffstat (limited to 'staging/openldap')
-rw-r--r-- | staging/openldap/PKGBUILD | 107 | ||||
-rwxr-xr-x | staging/openldap/slapd | 48 | ||||
-rw-r--r-- | staging/openldap/slapd.default | 6 |
3 files changed, 161 insertions, 0 deletions
diff --git a/staging/openldap/PKGBUILD b/staging/openldap/PKGBUILD new file mode 100644 index 000000000..44029b398 --- /dev/null +++ b/staging/openldap/PKGBUILD @@ -0,0 +1,107 @@ +# $Id: PKGBUILD 127879 2011-06-19 07:32:04Z andrea $ +# Maintainer: +# Contributor: Judd Vinet <jvinet@zeroflux.org> + +pkgname=openldap +pkgver=2.4.24 +pkgrel=2 +pkgdesc="LDAP Server" +arch=('i686' 'x86_64') +license=('custom') +url="http://www.openldap.org/" +backup=('etc/openldap/slapd.conf' 'etc/default/slapd' 'etc/conf.d/slapd') +depends=("libldap>=${pkgver}" 'tcp_wrappers' 'libfetch' 'util-linux-ng') +provides=('openldap-clients') +replaces=('openldap-clients') +source=("ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${pkgname}-${pkgver}.tgz" + 'slapd' + 'slapd.default') +md5sums=('116fe1e23a7b67686d5e62274367e6c0' + '832354417c495f29affd2c772808959d' + '6be69f6b7e522cb64cce8703da81ed32') +options=('emptydirs') + +build() { + cd "${srcdir}"/${pkgname}-${pkgver} + + export LIBS=-ldb + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --libexecdir=/usr/sbin \ + --sysconfdir=/etc \ + --localstatedir=/var/lib/openldap \ + --enable-bdb \ + --enable-crypt \ + --enable-dynamic \ + --with-threads \ + --enable-wrappers \ + --enable-spasswd \ + --with-cyrus-sasl + + find . -name 'Makefile' -exec \ + sed -e 's|$(LDAP_LIBDIR)/liblber/liblber.la|/usr/lib/liblber-2.4.so.2|g' \ + -e 's|$(LDAP_LIBDIR)/libldap/libldap.la|/usr/lib/libldap-2.4.so.2|g' \ + -e 's|$(LDAP_LIBDIR)/libldap_r/libldap_r.la|/usr/lib/libldap_r-2.4.so.2|g' \ + -i {} \; + + cd include + make + + cd ../libraries + for dir in liblutil librewrite liblunicode; do + pushd ${dir} + make depend + make + popd + done + + cd ../servers + make depend + make + + cd ../clients + make depend + make + + cd ../doc/man + for dir in man{1,5,8}; do + pushd ${dir} + make + popd + done +} + +package() { + cd "${srcdir}"/${pkgname}-${pkgver} + + cd servers + make DESTDIR="${pkgdir}" install + + cd ../clients + make DESTDIR="${pkgdir}" install + + cd ../doc/man + for dir in man{1,5,8}; do + pushd ${dir} + make DESTDIR="${pkgdir}" install + popd + done + rm "${pkgdir}"/usr/share/man/man5/ldap.conf.5 + + cd ../.. + + install -dm700 "${pkgdir}"/etc/openldap/slapd.d + install -Dm755 "${srcdir}"/slapd "${pkgdir}"/etc/rc.d/slapd + install -Dm644 "${srcdir}"/slapd.default "${pkgdir}"/etc/conf.d/slapd + install -dm700 "${pkgdir}"/var/lib/openldap + + # get rid of duplicate default conf files + rm "${pkgdir}"/etc/openldap/*.default + + # hack to fix screwed up dirs + sed -e 's|^pidfile[[:space:]].*$|pidfile /var/run/slapd.pid|g' \ + -e 's|^argsfile[[:space:]].*$|argsfile /var/run/slapd.args|g' \ + -i "${pkgdir}"/etc/openldap/slapd.conf + + install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE +} diff --git a/staging/openldap/slapd b/staging/openldap/slapd new file mode 100755 index 000000000..392075027 --- /dev/null +++ b/staging/openldap/slapd @@ -0,0 +1,48 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +[ -f "/etc/conf.d/slapd" ] && . /etc/conf.d/slapd + +PID=`pidof -o %PPID /usr/sbin/slapd` +case "$1" in + start) + stat_busy "Starting OpenLDAP" + if [ -z "$PID" ]; then + if [ -z "$SLAPD_SERVICES" ]; then + /usr/sbin/slapd $SLAPD_OPTIONS + else + /usr/sbin/slapd -h "$SLAPD_SERVICES" $SLAPD_OPTIONS + fi + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + add_daemon slapd + else + stat_fail + fi + ;; + stop) + stat_busy "Stopping OpenLDAP" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm -f /var/run/slapd.pid + rm -f /var/run/slapd.args + rm_daemon slapd + stat_done + fi + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/staging/openldap/slapd.default b/staging/openldap/slapd.default new file mode 100644 index 000000000..72ae2a6a7 --- /dev/null +++ b/staging/openldap/slapd.default @@ -0,0 +1,6 @@ +# slapd normally serves ldap only on all TCP-ports 389. slapd can also +# service requests on TCP-port 636 (ldaps) and requests via unix +# sockets. +# Example usage: +#SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" +SLAPD_OPTIONS="" |