Import package vendor original specs for necessary manipulations.

Mon, 20 Apr 2009 01:18:20 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 20 Apr 2009 01:18:20 +0200
changeset 174
8998cbee3fc3
parent 173
51607f58727f
child 175
66c4ec7f657e

Import package vendor original specs for necessary manipulations.

openldap/fsl.openldap file | annotate | diff | comparison | revisions
openldap/openldap.patch file | annotate | diff | comparison | revisions
openldap/openldap.pc file | annotate | diff | comparison | revisions
openldap/openldap.spec file | annotate | diff | comparison | revisions
openldap/rc.openldap file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/openldap/fsl.openldap	Mon Apr 20 01:18:20 2009 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +##
     1.5 +##  fsl.openldap -- OSSP fsl configuration
     1.6 +##
     1.7 +
     1.8 +ident (slap.*)/.+ q{
     1.9 +    prefix(
    1.10 +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
    1.11 +    )
    1.12 +    -> {
    1.13 +        debug: file(
    1.14 +            path="@l_prefix@/var/openldap/openldap.log",
    1.15 +            perm=0644
    1.16 +        )
    1.17 +    }
    1.18 +};
    1.19 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/openldap/openldap.patch	Mon Apr 20 01:18:20 2009 +0200
     2.3 @@ -0,0 +1,52 @@
     2.4 +Index: include/ac/fdset.h
     2.5 +--- include/ac/fdset.h.orig	2008-02-12 00:26:40 +0100
     2.6 ++++ include/ac/fdset.h	2008-10-13 11:38:23 +0200
     2.7 +@@ -22,6 +22,13 @@
     2.8 + #ifndef _AC_FDSET_H
     2.9 + #define _AC_FDSET_H
    2.10 + 
    2.11 ++#if defined(HAVE_SYS_TYPES_H)
    2.12 ++#include <sys/types.h>
    2.13 ++#endif
    2.14 ++#if defined(HAVE_SYS_SELECT_H)
    2.15 ++#include <sys/select.h>
    2.16 ++#endif
    2.17 ++
    2.18 + #if !defined( OPENLDAP_FD_SETSIZE ) && !defined( FD_SETSIZE )
    2.19 + #  define OPENLDAP_FD_SETSIZE 4096
    2.20 + #endif
    2.21 +Index: include/ldap_int_thread.h
    2.22 +--- include/ldap_int_thread.h.orig	2008-02-12 00:26:40 +0100
    2.23 ++++ include/ldap_int_thread.h	2008-10-13 11:38:23 +0200
    2.24 +@@ -100,6 +100,7 @@
    2.25 +  *                                 *
    2.26 +  ***********************************/
    2.27 + 
    2.28 ++#define _POSIX_PTHREAD_SEMANTICS
    2.29 + #define PTH_SYSCALL_SOFT 1
    2.30 + #include <pth.h>
    2.31 + 
    2.32 +Index: libraries/libldap_r/tpool.c
    2.33 +--- libraries/libldap_r/tpool.c.orig	2008-03-21 01:46:03 +0100
    2.34 ++++ libraries/libldap_r/tpool.c	2008-10-13 11:38:23 +0200
    2.35 +@@ -950,6 +950,6 @@
    2.36 + {
    2.37 + 	ldap_int_thread_userctx_t *ctx = vctx;
    2.38 + 
    2.39 +-	return ctx->ltu_id;
    2.40 ++	return ctx != NULL ? ctx->ltu_id : 0;
    2.41 + }
    2.42 + #endif /* LDAP_THREAD_HAVE_TPOOL */
    2.43 +Index: servers/slapd/back-perl/config.c
    2.44 +--- servers/slapd/back-perl/config.c.orig	2008-02-12 00:26:47 +0100
    2.45 ++++ servers/slapd/back-perl/config.c	2008-10-13 11:38:23 +0200
    2.46 +@@ -49,6 +49,9 @@
    2.47 + 		}
    2.48 + 
    2.49 + #ifdef PERL_IS_5_6
    2.50 ++		if (argc > 2)
    2.51 ++		    snprintf( eval_str, EVAL_BUF_SIZE, "require \"%s\";", argv[2] );
    2.52 ++		else
    2.53 + 		snprintf( eval_str, EVAL_BUF_SIZE, "use %s;", argv[1] );
    2.54 + 		eval_pv( eval_str, 0 );
    2.55 + 
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/openldap/openldap.pc	Mon Apr 20 01:18:20 2009 +0200
     3.3 @@ -0,0 +1,10 @@
     3.4 +prefix=@l_prefix@
     3.5 +exec_prefix=${prefix}
     3.6 +libdir=${exec_prefix}/lib
     3.7 +includedir=${prefix}/include
     3.8 +
     3.9 +Name: openldap
    3.10 +Description: OpenLDAP Libraries
    3.11 +Version: @version@
    3.12 +Libs: -L${libdir} @libs@
    3.13 +Cflags: -I${includedir}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/openldap/openldap.spec	Mon Apr 20 01:18:20 2009 +0200
     4.3 @@ -0,0 +1,332 @@
     4.4 +##
     4.5 +##  openldap.spec -- OpenPKG RPM Package Specification
     4.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     4.7 +##
     4.8 +##  Permission to use, copy, modify, and distribute this software for
     4.9 +##  any purpose with or without fee is hereby granted, provided that
    4.10 +##  the above copyright notice and this permission notice appear in all
    4.11 +##  copies.
    4.12 +##
    4.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    4.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    4.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    4.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    4.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    4.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    4.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    4.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    4.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    4.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    4.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    4.24 +##  SUCH DAMAGE.
    4.25 +##
    4.26 +
    4.27 +#   package information
    4.28 +Name:         openldap
    4.29 +Summary:      Lightweight Directory Access Protocol (LDAP) Toolkit
    4.30 +URL:          http://www.openldap.org/
    4.31 +Vendor:       OpenLDAP Project
    4.32 +Packager:     OpenPKG Foundation e.V.
    4.33 +Distribution: OpenPKG Community
    4.34 +Class:        BASE
    4.35 +Group:        LDAP
    4.36 +License:      GPL
    4.37 +Version:      2.4.16
    4.38 +Release:      20090406
    4.39 +
    4.40 +#   package options
    4.41 +%option       with_server   yes
    4.42 +%option       with_fsl      yes
    4.43 +%option       with_crypt    yes
    4.44 +%option       with_overlays yes
    4.45 +%option       with_pth      yes
    4.46 +%option       with_pthreads no
    4.47 +%option       with_sasl     no
    4.48 +%option       with_perl     no
    4.49 +%option       with_odbc     no
    4.50 +
    4.51 +#   list of sources
    4.52 +Source0:      ftp://ftp.openldap.org/pub/openldap/openldap-release/openldap-%{version}.tgz
    4.53 +Source1:      rc.openldap
    4.54 +Source2:      fsl.openldap
    4.55 +Source3:      openldap.pc
    4.56 +Patch0:       openldap.patch
    4.57 +
    4.58 +#   build information
    4.59 +Prefix:       %{l_prefix}
    4.60 +BuildRoot:    %{l_buildroot}
    4.61 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc
    4.62 +PreReq:       OpenPKG, openpkg >= 20060823
    4.63 +BuildPreReq:  openssl, db >= 4.5
    4.64 +PreReq:       openssl, db >= 4.5
    4.65 +%if "%{with_server}" == "yes" && "%{with_fsl}" == "yes"
    4.66 +BuildPreReq:  fsl
    4.67 +PreReq:       fsl
    4.68 +%endif
    4.69 +%if "%{with_server}" == "yes" && "%{with_pthreads}" == "yes"
    4.70 +BuildPreReq:  db::with_pthreads = yes
    4.71 +PreReq:       db::with_pthreads = yes
    4.72 +%endif
    4.73 +%if "%{with_server}" == "yes" && "%{with_pth}" == "yes"
    4.74 +BuildPreReq:  pth
    4.75 +PreReq:       pth
    4.76 +%endif
    4.77 +%if "%{with_sasl}" == "yes"
    4.78 +BuildPreReq:  sasl
    4.79 +PreReq:       sasl
    4.80 +%endif
    4.81 +%if "%{with_server}" == "yes" && "%{with_odbc}" == "yes"
    4.82 +BuildPreReq:  ODBC
    4.83 +PreReq:       ODBC
    4.84 +%endif
    4.85 +AutoReq:      no
    4.86 +AutoReqProv:  no
    4.87 +
    4.88 +%description
    4.89 +    OpenLDAP is an open source implementation of the Lightweight
    4.90 +    Directory Access Protocol (LDAP). The suite includes libraries
    4.91 +    implementing the LDAP protocol plus a stand-alone LDAP server
    4.92 +    slapd(8).
    4.93 +
    4.94 +%track
    4.95 +    prog openldap = {
    4.96 +        version   = %{version}
    4.97 +        url       = ftp://ftp.openldap.org/pub/openldap/openldap-release/
    4.98 +        regex     = openldap-(__VER__)\.tgz
    4.99 +    }
   4.100 +
   4.101 +%prep
   4.102 +    %setup -q
   4.103 +    %patch -p0
   4.104 +    %{l_shtool} subst \
   4.105 +        -e 's;-ldb-4\.[1-9];-ldb;g' \
   4.106 +        -e 's;-ldb-4-[1-9];-ldb;g' \
   4.107 +        -e 's;-ldb-4[1-9];-ldb;g' \
   4.108 +        -e 's;-ldb-4;-ldb;g' \
   4.109 +        configure
   4.110 +
   4.111 +%build
   4.112 +    cp /dev/null config.cache
   4.113 +
   4.114 +    #   configuration: standard build flags
   4.115 +    export CC="%{l_cc}"
   4.116 +    export CFLAGS="%{l_cflags -O}"
   4.117 +    export CPPFLAGS="%{l_cppflags}"
   4.118 +    export LDFLAGS="%{l_ldflags}"
   4.119 +    export LIBS=""
   4.120 +    export ARGS=""
   4.121 +    ARGS="$ARGS --prefix=%{l_prefix}"
   4.122 +    ARGS="$ARGS --libexecdir=%{l_prefix}/libexec/openldap"
   4.123 +    ARGS="$ARGS --localstatedir=%{l_prefix}/var/openldap"
   4.124 +    ARGS="$ARGS --enable-syslog"
   4.125 +    ARGS="$ARGS --with-tls"
   4.126 +    ARGS="$ARGS --without-fetch"
   4.127 +    ARGS="$ARGS --disable-dynamic"
   4.128 +    ARGS="$ARGS --disable-shared"
   4.129 +%if "%{with_server}" == "yes"
   4.130 +    ARGS="$ARGS --enable-slapd"
   4.131 +    ARGS="$ARGS --disable-modules"
   4.132 +    ARGS="$ARGS --enable-local"
   4.133 +    ARGS="$ARGS --enable-bdb"
   4.134 +    ARGS="$ARGS --enable-hdb"
   4.135 +    ARGS="$ARGS --enable-rewrite"
   4.136 +    ARGS="$ARGS --enable-ldap"
   4.137 +    ARGS="$ARGS --enable-meta"
   4.138 +    ARGS="$ARGS --enable-monitor"
   4.139 +    ARGS="$ARGS --enable-dnssrv"
   4.140 +    ARGS="$ARGS --enable-null"
   4.141 +    ARGS="$ARGS --enable-shell"
   4.142 +    ARGS="$ARGS --with-proxycache"
   4.143 +%else
   4.144 +    ARGS="$ARGS --disable-slapd"
   4.145 +    ARGS="$ARGS --disable-modules"
   4.146 +%endif
   4.147 +
   4.148 +    #   configuration: force to use OSSP fsl
   4.149 +%if "%{with_server}" == "yes"
   4.150 +    LDFLAGS="$LDFLAGS %{l_fsl_ldflags}"
   4.151 +    LIBS="$LIBS %{l_fsl_libs}"
   4.152 +%endif
   4.153 +
   4.154 +    #   configuration: force to use GNU pth if enabled
   4.155 +%if "%{with_server}" == "yes"
   4.156 +%if "%{with_pth}" == "yes"
   4.157 +    CFLAGS="$CFLAGS `%{l_prefix}/bin/pth-config --cflags`"
   4.158 +    CPPFLAGS="$CPPFLAGS -I`%{l_prefix}/bin/pth-config --includedir`"
   4.159 +    LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pth-config --ldflags`"
   4.160 +    LIBS="`%{l_prefix}/bin/pth-config --libs` $LIBS"
   4.161 +    ARGS="$ARGS --with-threads=pth"
   4.162 +    ( echo "ac_cv_header_sys_devpoll_h=no"
   4.163 +      echo "ac_cv_header_sys_epoll_h=no"
   4.164 +    ) >>config.cache
   4.165 +%else
   4.166 +%if "%{with_pthreads}" == "yes"
   4.167 +    ARGS="$ARGS --with-threads=posix"
   4.168 +%else
   4.169 +    ARGS="$ARGS --with-threads=no"
   4.170 +%endif
   4.171 +%endif
   4.172 +%endif
   4.173 +
   4.174 +    #   configuration: optional overlay support
   4.175 +%if "%{with_server}" == "yes" && "%{with_overlays}" == "yes"
   4.176 +    ARGS="$ARGS --enable-overlays=yes"
   4.177 +%endif
   4.178 +
   4.179 +    #   configuration: optional SASL support
   4.180 +%if "%{with_sasl}" == "yes"
   4.181 +    ( echo "ac_cv_lib_sasl2_sasl_client_init=yes"
   4.182 +    ) >>config.cache
   4.183 +    CPPFLAGS="%{l_cppflags sasl} $CPPFLAGS"
   4.184 +    ARGS="$ARGS --with-cyrus-sasl --enable-spasswd"
   4.185 +%else
   4.186 +    ARGS="$ARGS --without-cyrus-sasl --disable-spasswd"
   4.187 +%endif
   4.188 +
   4.189 +    #   configuration: optional crypt(3) support
   4.190 +%if "%{with_crypt}" == "yes"
   4.191 +    ARGS="$ARGS --enable-crypt"
   4.192 +%endif
   4.193 +
   4.194 +    #   configuration: optional Perl support
   4.195 +%if "%{with_server}" == "yes" && "%{with_perl}" == "yes"
   4.196 +    ARGS="$ARGS --enable-perl"
   4.197 +%endif
   4.198 +
   4.199 +    #   configuration: optional ODBC-based RDBMS support
   4.200 +%if "%{with_server}" == "yes" && "%{with_odbc}" == "yes"
   4.201 +    ARGS="$ARGS --enable-sql"
   4.202 +%endif
   4.203 +
   4.204 +    #   configuration: special platform support
   4.205 +    case "%{l_platform -t}" in
   4.206 +        *-sunos* ) CFLAGS="$CFLAGS -D_AVL_H"; LIBS="$LIBS -lrt" ;;
   4.207 +    esac
   4.208 +
   4.209 +    #   configuration: use hard-links and make sure our Berkeley-DB is picked up first
   4.210 +    %{l_shtool} subst \
   4.211 +        -e 's;ln -s;ln;g' \
   4.212 +        -e 's;-ldb4[1-9];%{l_prefix}/lib/libdb.a;g' \
   4.213 +        -e 's;<db\.h>;"db.h";g' \
   4.214 +        configure
   4.215 +
   4.216 +    #   configuration
   4.217 +    ./configure --cache-file=./config.cache $ARGS
   4.218 +
   4.219 +    #   build toolkit
   4.220 +    %{l_make} %{l_mflags} depend
   4.221 +    %{l_make} %{l_mflags}
   4.222 +
   4.223 +%install
   4.224 +    #   install toolkit
   4.225 +    rm -rf $RPM_BUILD_ROOT
   4.226 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   4.227 +
   4.228 +    #   post adjustment: remove extra files
   4.229 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
   4.230 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*/*.default
   4.231 +
   4.232 +    #   post adjustment: move files
   4.233 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/DB_CONFIG.example
   4.234 +%if "%{with_server}" == "yes"
   4.235 +    mv  $RPM_BUILD_ROOT%{l_prefix}/var/openldap/openldap-data/DB_CONFIG.example \
   4.236 +        $RPM_BUILD_ROOT%{l_prefix}/var/openldap/openldap-data/DB_CONFIG
   4.237 +%endif
   4.238 +
   4.239 +    #   post adjustment: enable and correct slapd.pid
   4.240 +%if "%{with_server}" == "yes"
   4.241 +    %{l_shtool} subst \
   4.242 +        -e 's;^[ #]*\(pidfile \).*$;\1 %{l_prefix}/var/openldap/run/slapd.pid;' \
   4.243 +        $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
   4.244 +%endif
   4.245 +
   4.246 +    #   post adjustment: remove OSSP fsl dependency from libtool files
   4.247 +%if "%{with_server}" == "yes"
   4.248 +    %{l_shtool} subst \
   4.249 +        -e 's;-lfsl *;;' \
   4.250 +        $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   4.251 +%endif
   4.252 +
   4.253 +    #   install run-command script
   4.254 +%if "%{with_server}" == "yes"
   4.255 +    %{l_shtool} mkdir -f -p -m 755 \
   4.256 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   4.257 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   4.258 +        %{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   4.259 +%endif
   4.260 +
   4.261 +    #   install OSSP fsl configuration
   4.262 +%if "%{with_server}" == "yes"
   4.263 +    %{l_shtool} mkdir -f -p -m 755 \
   4.264 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   4.265 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   4.266 +        %{SOURCE fsl.openldap} \
   4.267 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   4.268 +%endif
   4.269 +
   4.270 +    #   install pkg-config configuration
   4.271 +    %{l_shtool} mkdir -f -p -m 755 \
   4.272 +        $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
   4.273 +    libs="-lldap -llber"
   4.274 +%if "%{with_sasl}" == "yes"
   4.275 +    libs="$libs -lsasl2"
   4.276 +%endif
   4.277 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   4.278 +        -e "s;@version@;%{version};" \
   4.279 +        -e "s;@libs@;$libs;" \
   4.280 +        %{SOURCE openldap.pc} \
   4.281 +        $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
   4.282 +
   4.283 +    #   optionally remove server-components
   4.284 +%if "%{with_server}" != "yes"
   4.285 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/schema
   4.286 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
   4.287 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/sbin
   4.288 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/openldap
   4.289 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/include/slapi-plugin.h
   4.290 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man5/slap*
   4.291 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/slap*
   4.292 +%endif
   4.293 +
   4.294 +    #   determine installation files
   4.295 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   4.296 +        %{l_files_std} \
   4.297 +%if "%{with_server}" == "yes"
   4.298 +        '%config %{l_prefix}/etc/fsl/fsl.openldap' \
   4.299 +        '%config %{l_prefix}/etc/openldap/schema/*.schema' \
   4.300 +        '%config %{l_prefix}/etc/openldap/schema/*.ldif' \
   4.301 +%endif
   4.302 +        '%config %{l_prefix}/etc/openldap/*.conf'
   4.303 +
   4.304 +%files -f files
   4.305 +
   4.306 +%clean
   4.307 +    rm -rf $RPM_BUILD_ROOT
   4.308 +
   4.309 +%pre
   4.310 +%if "%{with_server}" == "yes"
   4.311 +    #   before upgrade, save status and stop service
   4.312 +    [ $1 -eq 2 ] || exit 0
   4.313 +    eval `%{l_rc} openldap status 2>/dev/null | tee %{l_tmpfile}`
   4.314 +    %{l_rc} openldap stop 2>/dev/null
   4.315 +    exit 0
   4.316 +%endif
   4.317 +
   4.318 +%post
   4.319 +    #   after upgrade, restore status
   4.320 +%if "%{with_server}" == "yes"
   4.321 +    [ $1 -eq 2 ] || exit 0
   4.322 +    { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
   4.323 +    [ ".$openldap_active" = .yes ] && %{l_rc} openldap start
   4.324 +    exit 0
   4.325 +%endif
   4.326 +
   4.327 +%preun
   4.328 +    #   before erase, stop service and remove log files
   4.329 +%if "%{with_server}" == "yes"
   4.330 +    [ $1 -eq 0 ] || exit 0
   4.331 +    %{l_rc} openldap stop 2>/dev/null
   4.332 +    rm -f $RPM_INSTALL_PREFIX/var/openldap/openldap.log* >/dev/null 2>&1 || true
   4.333 +    exit 0
   4.334 +%endif
   4.335 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/openldap/rc.openldap	Mon Apr 20 01:18:20 2009 +0200
     5.3 @@ -0,0 +1,63 @@
     5.4 +#!@l_prefix@/bin/openpkg rc
     5.5 +##
     5.6 +##  rc.openldap -- Run-Commands
     5.7 +##
     5.8 +
     5.9 +%config
    5.10 +    openldap_enable="$openpkg_rc_def"
    5.11 +    openldap_flags=""
    5.12 +    openldap_url="ldap://127.0.0.1:389/"
    5.13 +    openldap_log_prolog="true"
    5.14 +    openldap_log_epilog="true"
    5.15 +    openldap_log_numfiles="10"
    5.16 +    openldap_log_minsize="1M"
    5.17 +    openldap_log_complevel="9"
    5.18 +
    5.19 +%common
    5.20 +    openldap_slapd_cfgfile="@l_prefix@/etc/openldap/slapd.conf"
    5.21 +    openldap_slapd_pidfile="@l_prefix@/var/openldap/run/slapd.pid"
    5.22 +    openldap_slapd_signal () {
    5.23 +        [ -f $openldap_slapd_pidfile ] && kill -$1 `cat $openldap_slapd_pidfile`
    5.24 +    }
    5.25 +
    5.26 +%status -u @l_susr@ -o
    5.27 +    openldap_usable="unknown"
    5.28 +    openldap_active="no"
    5.29 +    rcService openldap enable yes && \
    5.30 +        openldap_slapd_signal 0 && openldap_active="yes"
    5.31 +    echo "openldap_enable=\"$openldap_enable\""
    5.32 +    echo "openldap_usable=\"$openldap_usable\""
    5.33 +    echo "openldap_active=\"$openldap_active\""
    5.34 +
    5.35 +%start -p 300 -u @l_susr@
    5.36 +    rcService openldap enable yes || exit 0
    5.37 +    openldap_slapd_signal 0
    5.38 +    if [ $? -ne 0 ]; then
    5.39 +        flags="$openldap_flags"
    5.40 +        echo $flags | grep -- -h >/dev/null
    5.41 +        if [ $? -ne 0 -a ".$openldap_url" != . ]; then
    5.42 +            flags="$flags -h \"$openldap_url\""
    5.43 +        fi
    5.44 +        eval @l_prefix@/libexec/openldap/slapd $flags || exit $?
    5.45 +    fi
    5.46 +
    5.47 +%stop -p 700 -u @l_susr@
    5.48 +    rcService openldap enable yes || exit 0
    5.49 +    rcService openldap active no  && exit 0
    5.50 +    openldap_slapd_signal INT
    5.51 +    sleep 2
    5.52 +
    5.53 +%restart -u @l_susr@
    5.54 +    rcService openldap enable yes || exit 0
    5.55 +    rcService openldap active no  && exit 0
    5.56 +    rc openldap stop start
    5.57 +
    5.58 +%daily -u @l_susr@
    5.59 +    rcService openldap enable yes || exit 0
    5.60 +    shtool rotate -f \
    5.61 +        -n ${openldap_log_numfiles} -s ${openldap_log_minsize} -d \
    5.62 +        -z ${openldap_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
    5.63 +        -P "${openldap_log_prolog}" \
    5.64 +        -E "${openldap_log_epilog}; rc openldap restart" \
    5.65 +        @l_prefix@/var/openldap/openldap.log
    5.66 +

mercurial