%define migtools_version 46%define db_version 4.4.20%define ldbm_backend berkeley%define version_22 2.2.29%define version_23 2.3.27%define evolution_connector_prefix %{_libdir}/evolution-openldap%define evolution_connector_includedir %{evolution_connector_prefix}/include%define evolution_connector_libdir %{evolution_connector_prefix}/%{_lib}# For Fedora Core 5, we want 2.2 compatibility.%define compat_version %{version_22}%define nptl_arches %{ix86} ia64 ppc ppc64 s390 s390x sparcv9 x86_64Summary: The configuration files, libraries, and documentation for OpenLDAP.Name: openldapVersion: %{version_23}Release: 8%{?dist}.3License: OpenLDAPGroup: System Environment/DaemonsSource0: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-release/openldap-%{version_23}.tgzSource1: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-release/openldap-%{version_22}.tgzSource2: http://downloads.sleepycat.com/db-%{db_version}.tar.gzSource3: ftp://ftp.OpenLDAP.org/pub/tools/autoconf-2.13.1.tar.gzSource4: ftp://ftp.OpenLDAP.org/pub/tools/automake-1.4a.tar.gzSource5: ftp://ftp.padl.com/pub/MigrationTools-%{migtools_version}.tar.gzSource6: ldap.initSource7: migration-tools.txtSource8: autofs.schemaSource9: README.upgradingSource10: http://www.OpenLDAP.org/doc/admin/guide.htmlSource11: nptl-abi-note.SSource12: README.evolution# Patches that are still valid for 2.3Patch0: openldap-2.3.11-config.patchPatch1: openldap-1.2.11-cldap.patchPatch2: openldap-2.0.11-ldaprc.patchPatch3: openldap-2.2.13-setugid.patchPatch4: openldap-2.2.13-pie.patchPatch5: openldap-2.3.11-toollinks.patchPatch6: openldap-2.3.11-nosql.patch#Patch7: openldap-2.3.19-nostrip.patchPatch8: openldap-2.3.19-gethostbyXXXX_r.patchPatch9: openldap-2.3.27-getdn.patchPatch10: openldap-2.3.27-config-sasl-options.patchPatch11: openldap-2.3.27-timeout-option.patchPatch12: openldap-2.3.27-writable-socket.patchPatch13: openldap-2.3.27-acl-memleak.patchPatch14: openldap-2.3.27-classes.patchPatch15: openldap-2.3.27-modify-noop.patch# Patches for 2.2.29 for the compat-openldap package.Patch100: openldap-2.2.13-tls-fix-connection-test.patchPatch101: openldap-2.2.23-resolv.patchPatch102: openldap-2.2.29-ads.patch#Patch103: openldap-2.2.29-nostrip.patch# Patches for the evolution libraryPatch200: openldap-ntlm.diff# Patches for the MigrationTools packagePatch300: MigrationTools-38-instdir.patchPatch301: MigrationTools-36-mktemp.patchPatch302: MigrationTools-27-simple.patchPatch303: MigrationTools-26-suffix.patchPatch304: MigrationTools-46-schema.patchPatch305: MigrationTools-45-noaliases.patchPatch400: db-4.4.20-1.patchPatch401: db-4.4.20-2.patchURL: http://www.openldap.org/BuildRoot: %{_tmppath}/%{name}-%{version_23}-rootBuildPreReq: cyrus-sasl-devel >= 2.1, gdbm-devel, libtool >= 1.5.6-2, krb5-develBuildPreReq: openssl-devel, pam-devel, perl, pkgconfig, tcp_wrappers,BuildPreReq: unixODBC-devel, bind-libbind-devel, libtool-ltdl-develRequires: glibc >= 2.2.3-48, mktemp%descriptionOpenLDAP is an open source suite of LDAP (Lightweight Directory AccessProtocol) applications and development tools. LDAP is a set ofprotocols for accessing directory services (usually phone book styleinformation, but other information is possible) over the Internet,similar to the way DNS (Domain Name System) information is propagatedover the Internet. The openldap package contains configuration files,libraries, and documentation for OpenLDAP.%package develSummary: OpenLDAP development libraries and header files.Group: Development/LibrariesRequires: openldap = %{version_23}-%{release}, cyrus-sasl-devel >= 2.1Provides: openldap-evolution-devel = %{version_23}-%{release}%description develThe openldap-devel package includes the development libraries andheader files needed for compiling applications that use LDAP(Lightweight Directory Access Protocol) internals. LDAP is a set ofprotocols for enabling directory services over the Internet. Installthis package only if you plan to develop or will need to compilecustomized LDAP clients.%package serversSummary: OpenLDAP servers and related files.Prereq: fileutils, make, openldap = %{version_23}-%{release}, openssl, /usr/sbin/useradd, /sbin/chkconfig, /sbin/runuserGroup: System Environment/Daemons%description serversOpenLDAP is an open-source suite of LDAP (Lightweight Directory AccessProtocol) applications and development tools. LDAP is a set ofprotocols for accessing directory services (usually phone book styleinformation, but other information is possible) over the Internet,similar to the way DNS (Domain Name System) information is propagatedover the Internet. This package contains the slapd and slurpd servers,migration scripts, and related files.%package servers-sqlSummary: OpenLDAP server SQL support module.Prereq: openldap-servers = %{version_23}-%{release}Group: System Environment/Daemons%description servers-sqlOpenLDAP is an open-source suite of LDAP (Lightweight Directory AccessProtocol) applications and development tools. LDAP is a set ofprotocols for accessing directory services (usually phone book styleinformation, but other information is possible) over the Internet,similar to the way DNS (Domain Name System) information is propagatedover the Internet. This package contains a loadable module which theslapd server can use to read data from an RDBMS.%package clientsSummary: Client programs for OpenLDAP.Prereq: openldap = %{version_23}-%{release}Group: Applications/Internet%description clientsOpenLDAP is an open-source suite of LDAP (Lightweight Directory AccessProtocol) applications and development tools. LDAP is a set ofprotocols for accessing directory services (usually phone book styleinformation, but other information is possible) over the Internet,similar to the way DNS (Domain Name System) information is propagatedover the Internet. The openldap-clients package contains the clientprograms needed for accessing and modifying OpenLDAP directories.# Declare this subpackage LAST. This version tag redefines %%{version}, so# any future use would reference the wrong version.%package -n compat-openldapSummary: OpenLDAP compatibility shared libraries.Group: System Environment/Libraries# Require the current OpenLDAP libraries package in an attempt to ensure that# we have a /etc/openldap/ldap.conf file on the system.Requires: openldap = %{version_23}-%{release}# Why this weirdo version number? We want to ensure that version comparisons# for this package always sort in the same order as the main openldap package.Version: %{version_23}_%{compat_version}%description -n compat-openldapOpenLDAP is an open source suite of LDAP (Lightweight Directory AccessProtocol) applications and development tools. The compat-openldap packageincludes older versions of the OpenLDAP shared libraries which may berequired by some applications.%prep%setup -q -c -a 1 -a 2 -a 3 -a 4 -a 5pushd db-%{db_version}%patch400 -b .patch1%patch401 -b .patch2popdpushd openldap-%{version_23}cp %{_datadir}/libtool/config.{sub,guess} build/popdpushd openldap-%{version_23}%patch0 -p1 -b .config%patch1 -p1 -b .cldap%patch2 -p1 -b .ldaprc%patch3 -p1 -b .setugid%patch4 -p1 -b .pie%patch5 -p1 -b .toollinks%patch6 -p1 -b .nosql#%patch7 -p1 -b .nostrip%patch8 -p1 -b .gethostbyname_r%patch9 -p1 -b .getdn%patch10 -p1 -b .sasl%patch11 -p1 -b .timeout%patch12 -p1 -b .socket%patch13 -p1 -b .acl-memleak%patch14 -p0 -b .classes%patch15 -p1 -b .modify-noopcp %{_datadir}/libtool/config.{sub,guess} build/popd# Set up a build tree for a static version of libldap with the hooks for the# non-standard NTLM bind type which is needed to connect to Win2k GC servers# (Win2k3 supports SASL with DIGEST-MD5, so this shouldn't be needed for those# servers, though as of version 1.4 the connector doesn't try SASL first).if ! cp -al openldap-%{version_23} evo-openldap-%{version_23} ; then rm -fr evo-openldap-%{version_23} cp -a openldap-%{version_23} evo-openldap-%{version_23}fipushd evo-openldap-%{version_23}%patch200 -p0 -b .evolution-ntlmpopdpushd MigrationTools-%{migtools_version}%patch300 -p1 -b .instdir%patch301 -p1 -b .mktemp%patch302 -p1 -b .simple%patch303 -p1 -b .suffix%patch304 -p1 -b .schema%patch305 -p1 -b .noaliasespopdautodir=`pwd`/auto-instrootpushd autoconf-2.13.1./configure --prefix=$autodirmake all installpopdpushd automake-1.4a./configure --prefix=$autodirmake all installpopdpushd openldap-%{version_22}%patch100 -p1 -b .resolv%patch101 -p1 -b .CAN-2005-2069%patch102 -p1 -b .ads#%patch103 -p1 -b .nostrip for subdir in build-servers build-compat ; do mkdir $subdir ln -s ../configure $subdir done$autodir/bin/autoconfpopdpushd openldap-%{version_23} for subdir in build-servers build-clients ; do mkdir $subdir ln -s ../configure $subdir doneautoconfpopd%buildautodir=`pwd`/auto-instrootdbdir=`pwd`/db-instrootlibtool='%{_bindir}/libtool'tagname=CC; export tagnamePATH=${autodir}/bin:${PATH}%ifarch ia64RPM_OPT_FLAGS="$RPM_OPT_FLAGS -O0"%endif# Set CFLAGS to incorporate RPM_OPT_FLAGS.CFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -fPIC"; export CFLAGS# Build Berkeley DB and install it into a temporary area, isolating OpenLDAP# from any future changes to the system-wide Berkeley DB library. Version 4.2# or later is required by the BDB backend in OpenLDAP 2.1 and later.buildbdb() { subdir=$1 shift install -d db-%{db_version}/build-rpm${subdir:+-${subdir}} pushd db-%{db_version}/build-rpm${subdir:+-${subdir}} echo "${1:+db_cv_mutex=$1}" > config.cache shift ../dist/configure -C \ --with-pic \ --disable-static \ --enable-shared \ --with-uniquename=_openldap_slapd_rhl_42 \ --prefix=${dbdir} \ --includedir=${dbdir}/include \ --libdir=${dbdir}/%{_lib}${subdir:+/${subdir}} # XXX db-4.2.x handles O_DIRECT (by disabling on linux) correctly. # XXX hack out O_DIRECT support in db4 for now. perl -pi -e 's/#define HAVE_O_DIRECT 1/#undef HAVE_O_DIRECT/' db_config.h # fix libtool: no rpath perl -pi -e 's|hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=\"-L\\\$libdir\"|g;' libtool if test -n "$nptl_lo" ; then ./libtool --mode=compile %{__cc} -o $nptl_lo -c $nptl_s fi make %{_smp_mflags} libdb_base=libslapd_db libso_base=libslapd_db LIBSO_LIBS="$nptl_lo" make install libdb_base=libslapd_db libso_base=libslapd_db LIBSO_LIBS="$nptl_lo" ln -sf libslapd_db.so ${dbdir}/%{_lib}/${subdir}/libdb.so popd}# Build an NPTL libdb if we're on a Linux arch with NPTL. NPTL gives us the# ability to share mutexes between threads in different processes, and to have# threads in both honor those locks. We have to do this because if you build# libdb with support for intra-process locks, it dies if you don't have it and# the application has specified to libdb that it's multi-threaded (as slapd# does).%ifarch %{nptl_arches}unset nptl_s nptl_locase %{_os} inlinux|Linux) nptl_s=$RPM_SOURCE_DIR/nptl-abi-note.S nptl_lo=nptl-abi-note.lo ;;esacbuildbdb tls POSIX/pthreads/libraryunset nptl_s nptl_lo%endif# Build a non-NPTL libdb and tools, able to only use intra-process thread# locks. Useless for bdb's purposes (bdb requires shared env support), but# acceptable for ldbm.buildbdb "" POSIX/pthreads/library/private# Find OpenSSL's header and library dependencies.if pkg-config openssl ; then OPENSSL_CPPFLAGS=`pkg-config --cflags-only-I openssl` CPPFLAGS="$OPENSSL_CPPFLAGS" ; export CPPFLAGS OPENSSL_LDFLAGS=`pkg-config --libs-only-L openssl` LDFLAGS="$OPENSSL_LDFLAGS" ; export LDFLAGSfiCPPFLAGS="-I${dbdir}/include $OPENSSL_CPPFLAGS" ; export CPPFLAGSCFLAGS="$CPPFLAGS $RPM_OPT_FLAGS -D_REENTRANT -fPIC"; export CFLAGSLDFLAGS="-L${dbdir}/%{_lib} $OPENSSL_LDFLAGS" ; export LDFLAGSLD_LIBRARY_PATH=${dbdir}/%{_lib}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}; export LD_LIBRARY_PATH# Build the client libraries for the compat package.pushd openldap-%{compat_version}/build-compat%configure \ --disable-slapd --disable-slurpd \ --with-threads=posix --enable-static --enable-shared --enable-dynamic \ --enable-local --with-tls --with-cyrus-sasl --without-kerberosmake %{_smp_mflags}popd# Build 2.2.build() {%configure \ --with-threads=posix \ \ --enable-local --enable-rlookups \ \ --with-tls \ --with-cyrus-sasl \ \ --enable-wrappers \ \ --enable-passwd \ \ --enable-cleartext \ --enable-crypt \ --enable-spasswd \ --enable-lmpasswd \ --enable-modules \ --disable-sql \ --enable-overlays=yes \ \ --libexecdir=%{_libdir} \ $@make %{_smp_mflags} LIBTOOL="$libtool"}# Build the servers with Kerberos support (for password checking, mainly).LIBS=-lpthread; export LIBSLD_LIBRARY_PATH=${dbdir}/%{_lib}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}; export LD_LIBRARY_PATHpushd openldap-%{version_23}/build-serversbuild \ --enable-plugins \ --enable-slapd \ --enable-slurpd \ --enable-multimaster \ --enable-bdb \ --enable-hdb \ --enable-ldap \ --enable-ldbm \ --with-ldbm-api=%{ldbm_backend} \ --enable-meta \ --enable-monitor \ --enable-null \ --enable-shell \ --enable-sql=mod \ --disable-perl \ --disable-shared \ --disable-dynamic \ --enable-static \ --enable-overlays=yes \ --with-kerberos=k5onlyunset LIBSpopd# Build clients without Kerberos password-checking support, which is only# useful in the server anyway, to avoid stray dependencies.pushd openldap-%{version_23}/build-clientsbuild \ --disable-slapd \ --disable-slurpd \ --enable-shared \ --enable-dynamic \ --enable-static \ --without-kerberos \ --with-picpopd# Build evolution-specific clients just as we would normal clients, except with# a different installation directory in mind and no shared libraries.pushd evo-openldap-%{version_23}build \ --disable-slapd \ --disable-slurpd \ --disable-shared \ --disable-dynamic \ --enable-static \ --without-kerberos \ --with-pic \ --includedir=%{evolution_connector_includedir} \ --libdir=%{evolution_connector_libdir}popd%install[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOTlibtool='%{_bindir}/libtool'tagname=CC; export tagname# Install the 2.0 or 2.1 shared libraries for compatibility. The two sets of# libraries share sonames, so we have to choose one or the other.mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pushd openldap-%{compat_version}/build-compat/libraries make install DESTDIR=$RPM_BUILD_ROOT rm $RPM_BUILD_ROOT/%{_libdir}/*.a rm $RPM_BUILD_ROOT/%{_libdir}/*.la rm $RPM_BUILD_ROOT/%{_libdir}/*.sopopd# Install servers.%ifarch %{nptl_arches}case %{_target_platform} in i386*|i486*) archp=i486; arches="i586 i686";; i586*) archp=i586; arches=i686;; i686*) archp=i686; arches=;; athlon*) archp=i686; arches=;; *) archp=; arches=;;esacpushd db-instroot/%{_lib}/tls/install -d $RPM_BUILD_ROOT/%{_libdir}/tls/${archp}/install -m755 libslapd_db-*.*.so $RPM_BUILD_ROOT/%{_libdir}/tls/${archp}/for arch in $arches ; do install -d $RPM_BUILD_ROOT/%{_libdir}/tls/${arch}/ ln $RPM_BUILD_ROOT/%{_libdir}/tls/${archp}/* $RPM_BUILD_ROOT/%{_libdir}/tls/${arch}/donepopd%endifpushd db-instroot/%{_lib}/install -d $RPM_BUILD_ROOT/%{_libdir}/install -m755 libslapd_db-*.*.so $RPM_BUILD_ROOT/%{_libdir}/popdpushd openldap-%{version_23}/build-serversmake install DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} LIBTOOL="$libtool"popd# Install the bdb maintenance tools.pushd db-instroot/binfor binary in db_* ; do install -m755 ${binary} $RPM_BUILD_ROOT/%{_sbindir}/slapd_${binary}donepopd# Install clients and shared libraries. Install the evo-specific versions# first so that any conflicting files are overwritten by generic versions.pushd evo-openldap-%{version_23}make install DESTDIR=$RPM_BUILD_ROOT \ includedir=%{evolution_connector_includedir} \ libdir=%{evolution_connector_libdir} \ LIBTOOL="$libtool"install -m644 \ $RPM_SOURCE_DIR/README.evolution \ $RPM_BUILD_ROOT/%{evolution_connector_prefix}/popdpushd openldap-%{version_23}/build-clientsmake install DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} LIBTOOL="$libtool"popd# Create this directory so that authconfig setting TLS_CACERT to# /etc/openldap/cacerts doesn't cause TLS startup of any kind to fail# when the directory doesn't exist.mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/openldap/cacerts# make sure the certs directory existsmkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs# Touch the dummy slapd.pem to make rpmbuild happytouch $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/slapd.pem# Install the padl.com migration tools.mkdir -p $RPM_BUILD_ROOT%{_datadir}/openldap/migrationinstall -m 755 MigrationTools-%{migtools_version}/migrate_* \ $RPM_BUILD_ROOT%{_datadir}/openldap/migration/install -m 644 MigrationTools-%{migtools_version}/README \ $RPM_SOURCE_DIR/migration-tools.txt \ $RPM_BUILD_ROOT%{_datadir}/openldap/migration/cp MigrationTools-%{migtools_version}/README README.migrationcp $RPM_SOURCE_DIR/migration-tools.txt TOOLS.migration# Create the data directory.mkdir -p $RPM_BUILD_ROOT/var/lib/ldap# Create the new run directorymkdir -p $RPM_BUILD_ROOT/var/run/openldap# Hack the build root out of the default config files.perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/*.conf# Get the buildroot out of the man pages.perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/*/*.*# We don't need the default files -- RPM handles changes.rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/*.defaultrm -f $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/schema/*.default# Install an init script for the servers.mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.dinstall -m 755 $RPM_SOURCE_DIR/ldap.init $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ldap# Add some more schema for the sake of migration scripts.install -d -m755 $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema/redhatinstall -m644 \ $RPM_SOURCE_DIR/autofs.schema \ $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema/redhat/# Move slapd and slurpd out of _libdirmv $RPM_BUILD_ROOT/%{_libdir}/sl{apd,urpd} $RPM_BUILD_ROOT/%{_sbindir}/rm -f $RPM_BUILD_ROOT/%{_sbindir}/slap{acl,add,auth,cat,dn,index,passwd,test}rm -f $RPM_BUILD_ROOT/%{_libdir}/slap{acl,add,auth,cat,dn,index,passwd,test}for X in acl add auth cat dn index passwd test; do ln -s slapd $RPM_BUILD_ROOT/%{_sbindir}/slap$X ; done# Tweak permissions on the libraries to make sure they're correct.chmod 755 $RPM_BUILD_ROOT/%{_libdir}/lib*.so*chmod 644 $RPM_BUILD_ROOT/%{_libdir}/lib*.*a# Remove files which we don't want packaged.rm -f $RPM_BUILD_ROOT/%{_datadir}/openldap/migration/*.{instdir,simple,schema,mktemp,suffix,noaliases}rm -f $RPM_BUILD_ROOT/%{_libdir}/*.larm -f $RPM_BUILD_ROOT/%{evolution_connector_libdir}/*.larm -f $RPM_BUILD_ROOT/%{evolution_connector_libdir}/*.so*rm -f $RPM_BUILD_ROOT/%{_libdir}/openldap/*.arm -f $RPM_BUILD_ROOT/%{_libdir}/openldap/*.sorm -f $RPM_BUILD_ROOT/var/openldap-data/DB_CONFIG.examplermdir $RPM_BUILD_ROOT/var/openldap-slurp $RPM_BUILD_ROOT/var/openldap-data%cleanrm -rf $RPM_BUILD_ROOT%post -p /sbin/ldconfig%postun -p /sbin/ldconfig%pre servers# Take care to only do ownership-changing if we're adding the user.if /usr/sbin/useradd -c "LDAP User" -u 55 \ -s /bin/false -r -d /var/lib/ldap ldap 2> /dev/null ; then if [ -d /var/lib/ldap ] ; then for dbfile in /var/lib/ldap/* ; do if [ -f $dbfile ] ; then chown ldap:ldap $dbfile fi done fifi# See if slapd has been configured and (ever) startedfiles=$(echo /var/lib/ldap/{[a]lock,*.bdb,*.dbd,log.*,__db.*})if [ "$files" != '/var/lib/ldap/[a]lock /var/lib/ldap/*.bdb /var/lib/ldap/*.dbd /var/lib/ldap/log.* /var/lib/ldap/__db.*' ] ; then # Save an ldif of the database where the "%post servers" scriptlet can # restore it. Also save the database files to a "rpmorig" directory # Just In Case (TM) if /sbin/runuser -m -s /usr/sbin/slapcat -- ldap -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 ; then if [ -s /var/lib/ldap/upgrade.ldif ] ; then /bin/rm -fr /var/lib/ldap/rpmorig > /dev/null 2>&1 || : mkdir /var/lib/ldap/rpmorig mv /var/lib/ldap/{alock,*.bdb,*.dbd,__db.*,log.*} /var/lib/ldap/rpmorig > /dev/null 2>&1 || : cp -f /var/lib/ldap/DB_CONFIG /var/lib/ldap/rpmorig > /dev/null 2>&1 || : else /bin/rm -f /var/lib/ldap/upgrade.ldif fi fifi%post servers/sbin/ldconfig/sbin/chkconfig --add ldap# If there's a /var/lib/ldap/upgrade.ldif file, slapadd it and delete it.# It was created by the %pre and contains data of the previous version.if [ -f /var/lib/ldap/upgrade.ldif ] ; then /sbin/runuser -m -s /usr/sbin/slapadd -- "ldap" -l /var/lib/ldap/upgrade.ldif rm /var/lib/ldap/upgrade.ldiffiexec > /dev/null 2> /dev/nullif [ ! -f %{_sysconfdir}/pki/tls/certs/slapd.pem ] ; thenpushd %{_sysconfdir}/pki/tls/certsumask 077cat << EOF | make slapd.pem--SomeStateSomeCitySomeOrganizationSomeOrganizationalUnitlocalhost.localdomainroot@localhost.localdomainEOFchown root:ldap slapd.pemchmod 640 slapd.pempopdfiexit 0%preun serversif [ "$1" = "0" ] ; then /sbin/service ldap stop > /dev/null 2>&1 || : /sbin/chkconfig --del ldapfi%postun servers/sbin/ldconfigif [ $1 -ge 1 ] ; then /sbin/service ldap condrestart > /dev/null 2>&1 || :fi%posttrans servers# prev. versions of openldap-servers package exported the database# to /var/lib/ldap/upgrade.ldif and moved the database to# /var/lib/rpmorig in %preun, assuming that %post will be called# later and restore the DB from there. Unfortunatelly this# assumption is wrong, %preun is called after %post -># in the end the database is moved to /var/lib/rpmorig# and nobody restores it.# Let's restore it here:# If there's a /var/lib/ldap/upgrade.ldif file, slapadd it and delete it.# It was created by the uninstall of the previous version.if [ -f /var/lib/ldap/upgrade.ldif ] ; then STARTAGAIN=0 /sbin/service ldap status >/dev/null 2>/dev/null if [ "$?" = "0" ] ; then service ldap stop STARTAGAIN=1 fi # set the database owner - #preun of prev. version could create # the database with root:root owner (!) if [ -d /var/lib/ldap ] ; then for dbfile in /var/lib/ldap/* ; do if [ -f $dbfile ] ; then chown ldap:ldap $dbfile fi done fi /sbin/runuser -m -s /usr/sbin/slapadd -- "ldap" -l /var/lib/ldap/upgrade.ldif >/dev/null 2>/dev/null rm /var/lib/ldap/upgrade.ldif if [ "$STARTAGAIN" = 1 ] ; then service ldap start fifiexec > /dev/null 2> /dev/null%files%defattr(-,root,root)%doc openldap-%{version_23}/ANNOUNCEMENT%doc openldap-%{version_23}/CHANGES%doc openldap-%{version_23}/COPYRIGHT%doc openldap-%{version_23}/LICENSE%doc openldap-%{version_23}/README%attr(0755,root,root) %dir %{_sysconfdir}/openldap%attr(0755,root,root) %dir %{_sysconfdir}/openldap/cacerts%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/openldap/ldap*.conf%attr(0755,root,root) %{_libdir}/liblber-2.3*.so.*%attr(0755,root,root) %{_libdir}/libldap-2.3*.so.*%attr(0755,root,root) %{_libdir}/libldap_r-2.3*.so.*%attr(0644,root,root) %{_mandir}/man5/ldif.5*%attr(0644,root,root) %{_mandir}/man5/ldap.conf.5*%attr(0755,root,root) %dir %{_datadir}/openldap%files -n compat-openldap%defattr(-,root,root)%doc openldap-%{compat_version}/ANNOUNCEMENT%doc openldap-%{compat_version}/COPYRIGHT%doc openldap-%{compat_version}/LICENSE%attr(0755,root,root) %{_libdir}/liblber-2.2.so.*%attr(0755,root,root) %{_libdir}/libldap-2.2.so.*%attr(0755,root,root) %{_libdir}/libldap_r-2.2.so.*%files servers%defattr(-,root,root)%doc README.migration%doc TOOLS.migration%doc $RPM_SOURCE_DIR/README.upgrading $RPM_SOURCE_DIR/guide.html%ghost %config %{_sysconfdir}/pki/tls/certs/slapd.pem%attr(0755,root,root) %config %{_sysconfdir}/rc.d/init.d/ldap%attr(0640,root,ldap) %config(noreplace) %{_sysconfdir}/openldap/slapd.conf%attr(0640,root,ldap) %{_sysconfdir}/openldap/DB_CONFIG.example%attr(0755,root,root) %dir %{_sysconfdir}/openldap/schema%attr(0644,root,root) %dir %{_sysconfdir}/openldap/schema/README*%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/openldap/schema/*.schema*%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/openldap/schema/*.ldif%attr(0755,root,root) %dir %{_sysconfdir}/openldap/schema/redhat%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/openldap/schema/redhat/*.schema*%attr(0755,root,root) %{_sbindir}/sl*%attr(0644,root,root) %{_mandir}/man8/*%attr(0644,root,root) %{_mandir}/man5/slapd*.5*%attr(0644,root,root) %{_mandir}/man5/slapo-*.5*%attr(0755,root,root) %dir %{_datadir}/openldap/migration%attr(0644,root,root) %{_datadir}/openldap/migration/README%attr(0644,root,root) %config(noreplace) %{_datadir}/openldap/migration/*.ph%attr(0755,root,root) %{_datadir}/openldap/migration/*.pl%attr(0755,root,root) %{_datadir}/openldap/migration/*.sh%attr(0644,root,root) %{_datadir}/openldap/migration/*.txt%attr(0755,root,root) %dir %{_datadir}/openldap/ucdata%attr(0644,root,root) %dir %{_datadir}/openldap/ucdata/*%attr(0700,ldap,ldap) %dir /var/lib/ldap%attr(0755,ldap,ldap) %dir /var/run/openldap%attr(0755,root,root) %{_libdir}/libslapd_db-*.*.so%ifarch %{nptl_arches}%ifnarch %{ix86}%attr(0755,root,root) %{_libdir}/tls/libslapd_db-*.*.so%else%dir %attr(0755,root,root) %{_libdir}/tls/*%attr(0755,root,root) %{_libdir}/tls/*/libslapd_db-*.*.so%endif%endif%files servers-sql%defattr(-,root,root)%doc openldap-%{version_23}/servers/slapd/back-sql/docs/*%doc openldap-%{version_23}/servers/slapd/back-sql/rdbms_depend%attr(0755,root,root) %{_libdir}/openldap%attr(0755,root,root) %{_libdir}/openldap/back_sql.la%attr(0755,root,root) %{_libdir}/openldap/back_sql*.so.*%files clients%defattr(-,root,root)%attr(0755,root,root) %{_bindir}/*%attr(0644,root,root) %{_mandir}/man1/*%files devel%defattr(-,root,root)%doc openldap-%{version_23}/doc/drafts openldap-%{version_23}/doc/rfc%attr(0755,root,root) %{_libdir}/libl*.so%attr(0644,root,root) %{_libdir}/libl*.a%attr(0644,root,root) %{_includedir}/*%attr(0644,root,root) %{_mandir}/man3/*%attr(0755,root,root) %dir %{evolution_connector_prefix}%attr(0644,root,root) %{evolution_connector_prefix}/README*%attr(0755,root,root) %dir %{evolution_connector_includedir}%attr(0644,root,root) %{evolution_connector_includedir}/*.h%attr(0755,root,root) %dir %{evolution_connector_libdir}%attr(0644,root,root) %{evolution_connector_libdir}/*.a