From 1e07f06a3a7c3413df90a41b66b2f8c7d856fac8 Mon Sep 17 00:00:00 2001 From: fenlason Date: Mon, 19 Feb 2007 20:44:22 +0000 Subject: [PATCH] - New upstream release - Upgrade the scripts for migrating the database so that they might actually work. - change bind-libbind-devel to bind-devel in BuildPreReq --- .cvsignore | 1 + openldap.spec | 52 ++++++++++++++++++++++++++++++++++++++------------- sources | 2 +- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/.cvsignore b/.cvsignore index 01ea5b7..dee2526 100644 --- a/.cvsignore +++ b/.cvsignore @@ -8,3 +8,4 @@ openldap-2.3.24.tgz openldap-2.3.27.tgz openldap-2.3.28.tgz openldap-2.3.30.tgz +openldap-2.3.34.tgz diff --git a/openldap.spec b/openldap.spec index f912571..931a73b 100644 --- a/openldap.spec +++ b/openldap.spec @@ -2,7 +2,7 @@ %define db_version 4.4.20 %define ldbm_backend berkeley %define version_22 2.2.29 -%define version_23 2.3.30 +%define version_23 2.3.34 %define evolution_connector_prefix %{_libdir}/evolution-openldap %define evolution_connector_includedir %{evolution_connector_prefix}/include %define evolution_connector_libdir %{evolution_connector_prefix}/%{_lib} @@ -13,7 +13,7 @@ Summary: The configuration files, libraries, and documentation for OpenLDAP. Name: openldap Version: %{version_23} -Release: 1.1%{?dist} +Release: 0%{?dist} License: OpenLDAP Group: System Environment/Daemons Source0: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-release/openldap-%{version_23}.tgz @@ -65,7 +65,7 @@ URL: http://www.openldap.org/ BuildRoot: %{_tmppath}/%{name}-%{version_23}-root BuildPreReq: cyrus-sasl-devel >= 2.1, gdbm-devel, libtool >= 1.5.6-2, krb5-devel BuildPreReq: openssl-devel, pam-devel, perl, pkgconfig, tcp_wrappers-devel, -BuildPreReq: unixODBC-devel, bind-libbind-devel, libtool-ltdl-devel +BuildPreReq: unixODBC-devel, bind-devel, libtool-ltdl-devel Requires: glibc >= 2.2.3-48, mktemp %description @@ -549,14 +549,31 @@ if /usr/sbin/useradd -c "LDAP User" -u 55 \ done fi fi +# (the below is copied from the preun servers scriptlet below) +# 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) +files=$(echo /var/lib/ldap/{log.*,__db.*,[a]lock}) +if [ "$files" != '/var/lib/ldap/log.* /var/lib/ldap/__db.* /var/lib/ldap/[a]lock' ] ; then + if /usr/sbin/slapcat -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,__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 + fi +fi %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 uninstall 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 +if [ -s /var/lib/ldap/upgrade.ldif ] ; then + /sbin/runuser -m -s /usr/sbin/slapadd -- "ldap" -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 rm /var/lib/ldap/upgrade.ldif fi exec > /dev/null 2> /dev/null @@ -580,17 +597,20 @@ exit 0 %preun servers if [ "$1" = "0" ] ; then - /sbin/service ldap stop > /dev/null 2>&1 || : - /sbin/chkconfig --del ldap -fi + /sbin/service ldap stop > /dev/null 2>&1 || : + /sbin/chkconfig --del ldap # 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 /usr/sbin/slapcat -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 ; then - rm -fr /var/lib/ldap/rpmorig > /dev/null 2>&1 || : - mkdir /var/lib/ldap/rpmorig - mv /var/lib/ldap/{alock,*.bdb,__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 || : + files="/var/lib/ldap/log.* /var/lib/ldap/__db.* /var/lib/ldap/[a]lock" + if [ "$files" != '/var/lib/ldap/log.* /var/lib/ldap/__db.* /var/lib/ldap/[a]lock' ] ; then + if /usr/sbin/slapcat -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 ; then + /bin/rm -fr /var/lib/ldap/rpmorig > /dev/null 2>&1 || : + mkdir /var/lib/ldap/rpmorig + mv /var/lib/ldap/{alock,*.bdb,__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 || : + fi + fi fi %postun servers @@ -692,6 +712,12 @@ fi %attr(0644,root,root) %{evolution_connector_libdir}/*.a %changelog +* Mon Feb 19 2007 Jay Fenlason 2.3.34-1%{?dist} +- New upstream release +- Upgrade the scripts for migrating the database so that they might + actually work. +- change bind-libbind-devel to bind-devel in BuildPreReq + * Mon Dec 4 2006 Thomas Woerner 2.3.30-1.1%{?dist} - tcp_wrappers has a new devel and libs sub package, therefore changing build requirement for tcp_wrappers to tcp_wrappers-devel diff --git a/sources b/sources index e1e04b4..0f2fc7e 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ 6c4c72a1336aa45b463e738034c078d6 openldap-2.2.29.tgz dc80548f76d6aeba2b51b15751e08b21 MigrationTools-46.tar.gz 33851f01b455cca48aa601956de93c6f db-4.4.20.tar.gz -1c0f108a94070edbb4915e7e40e1ce9c openldap-2.3.30.tgz +143eeb6e3c163e5f52d8e744b43a5960 openldap-2.3.34.tgz