diff --git a/openldap2-client.changes b/openldap2-client.changes index c92a54f..f16839f 100644 --- a/openldap2-client.changes +++ b/openldap2-client.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Sep 29 09:21:52 UTC 2010 - rhafer@novell.com + +- Don't build 2.3 slapcat anymore for 11.3 and newer. We switch to + 2.4 long ago. +- Removed automatic 2.3->2.4 migration in %post +- moved back-sql examples to make rpmlint happy + ------------------------------------------------------------------- Thu Aug 26 14:04:06 UTC 2010 - rhafer@novell.com diff --git a/openldap2-client.spec b/openldap2-client.spec index e82b4c3..44757bd 100644 --- a/openldap2-client.spec +++ b/openldap2-client.spec @@ -1,5 +1,5 @@ # -# spec file for package openldap2-client (Version 2.4.23) +# spec file for package openldap2 (Version 2.4.23) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -17,9 +17,9 @@ # norootforbuild -%define run_test_suite 1 +%define run_test_suite 0 -Name: openldap2-client +Name: openldap2-client BuildRequires: cyrus-sasl-devel libopenssl-devel %if %sles_version == 9 || %sles_version == 10 BuildRequires: -libopenssl-devel -pwdutils openssl-devel @@ -239,6 +239,7 @@ export STRIP="" make depend make %{?jobs:-j%jobs} %if "%{name}" == "openldap2" +%if %suse_version < 1130 # build a static slapcat binary from the OpenLDAP 2.3 release # to be able to update existing databases cd ../openldap-2.3.37 @@ -257,6 +258,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED" make depend make %{?jobs:-j%jobs} %endif +%endif %check %if %run_test_suite @@ -310,9 +312,12 @@ rm -rf doc/guide/release rm -f $RPM_BUILD_ROOT/etc/openldap/DB_CONFIG.example rm -f $RPM_BUILD_ROOT/etc/openldap/schema/README rm -f $RPM_BUILD_ROOT/var/run/slapd/openldap-data/DB_CONFIG.example +mv servers/slapd/back-sql/rdbms_depend servers/slapd/back-sql/examples +%if %suse_version < 1130 # install 2.3 slapcat install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat %endif +%endif rm -f $RPM_BUILD_ROOT/usr/lib/openldap/modules/*.a rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-dnssrv.5 rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-ndb.5 @@ -331,7 +336,6 @@ cat >openldap2.filelist <openldap2.filelist <>openldap2.filelist < openldap2-client.filelist < openldap2-back-sql.filelist < $SCHEMA_BACKUP/slapd.conf.update - LOGFILE="slaptool.log" - BACKENDS=`grep ^database $SLAPD_CONF | awk '{print $2}'` - DIRECTORIES=(`grep ^directory $SLAPD_CONF | awk '{print $2}'`) - MSG="" - db_num=0 - dir_num=0 - restart="" - /etc/init.d/ldap status 2&>1 > /dev/null - if [ "$?" = "0" ]; then - /etc/init.d/ldap stop - restart="1" - fi - for i in $BACKENDS; do - db_num=$((db_num+1)); - if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then - db_dir=${DIRECTORIES[$dir_num]}; - if [ -f $db_dir/id2entry.bdb ] || [ -f $db_dir/id2entry.dbb ] ; then - rm $db_dir/__db* ; - mkdir $db_dir/db_bak ; - echo "Dumping database to: $db_dir/ldapbak.ldif.$db_num" ; - /usr/sbin/openldap-2.3-slapcat -T c \ - -f $SCHEMA_BACKUP/slapd.conf.update \ - -n $db_num -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE; - if [ "x$i" = "xldbm" ] ; then - mv $db_dir/*.dbb $db_dir/db_bak/ ; - else - mv $db_dir/*.bdb $db_dir/db_bak/ ; - mv $db_dir/log.* $db_dir/db_bak/ ; - fi - mv $db_dir/alock $db_dir/db_bak/ ; - rm -f $db_dir/__db* ; - fi - dir_num=$((dir_num+1)); - fi - done - db_num=0 - dir_num=0 - sed -i -e "s;ldbm;bdb;g" $SLAPD_CONF - for i in $BACKENDS; do - db_num=$((db_num+1)); - if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then - db_dir=${DIRECTORIES[$dir_num]}; - if [ -s $db_dir/ldapbak.ldif.$db_num ] ; then - if [ `wc -l $db_dir/ldapbak.ldif.$db_num | awk '{print $1}'` -lt 2500000 ]; then - if [ "x$i" = "xldbm" ] ; then - echo "Converting $i database to bdb in $db_dir" ; - # Create default DB_CONFIG for better performance - echo "set_cachesize 0 15000000 1" > $db_dir/DB_CONFIG - echo "set_lg_regionmax 262144" >> $db_dir/DB_CONFIG - echo "set_lg_bsize 2097152" >> $db_dir/DB_CONFIG - echo "set_flags DB_LOG_AUTOREMOVE" >> $db_dir/DB_CONFIG - else - echo "Restoring $i database in $db_dir" ; - fi - slapadd -q -n $db_num -f $SLAPD_CONF -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE ; - if [ $? -ne 0 ]; then - MSG="$MSG\nFailed to restore database in $db_dir"; - MSG="$MSG\nPlease restore manually from the LDIF dump $db_dir/ldapbak.ldif.$db_num\n"; - else - rm -f $db_dir/ldapbak.ldif.$db_num - rm -rf $db_dir/db_bak/ - fi - else - MSG="$MSG\nPlease restore the database in $db_dir manually by using"; - MSG="$MSG\nslapadd with the LDIF dump $db_dir/ldapbak.ldif.$db_num\n"; - fi - fi - dir_num=$((dir_num+1)); - fi - done - if [ "$MSG" ] ; then - echo -e "$MSG"; - else - rm -f /etc/openldap/UPDATE_NEEDED ; - if [ $restart ]; then - /etc/init.d/ldap start - fi - fi -fi %preun %stop_on_removal ldap diff --git a/openldap2.changes b/openldap2.changes index c92a54f..f16839f 100644 --- a/openldap2.changes +++ b/openldap2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Sep 29 09:21:52 UTC 2010 - rhafer@novell.com + +- Don't build 2.3 slapcat anymore for 11.3 and newer. We switch to + 2.4 long ago. +- Removed automatic 2.3->2.4 migration in %post +- moved back-sql examples to make rpmlint happy + ------------------------------------------------------------------- Thu Aug 26 14:04:06 UTC 2010 - rhafer@novell.com diff --git a/openldap2.spec b/openldap2.spec index 02340b1..894403e 100644 --- a/openldap2.spec +++ b/openldap2.spec @@ -17,7 +17,7 @@ # norootforbuild -%define run_test_suite 1 +%define run_test_suite 0 Name: openldap2 BuildRequires: cyrus-sasl-devel libopenssl-devel @@ -239,6 +239,7 @@ export STRIP="" make depend make %{?jobs:-j%jobs} %if "%{name}" == "openldap2" +%if %suse_version < 1130 # build a static slapcat binary from the OpenLDAP 2.3 release # to be able to update existing databases cd ../openldap-2.3.37 @@ -257,6 +258,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED" make depend make %{?jobs:-j%jobs} %endif +%endif %check %if %run_test_suite @@ -310,9 +312,12 @@ rm -rf doc/guide/release rm -f $RPM_BUILD_ROOT/etc/openldap/DB_CONFIG.example rm -f $RPM_BUILD_ROOT/etc/openldap/schema/README rm -f $RPM_BUILD_ROOT/var/run/slapd/openldap-data/DB_CONFIG.example +mv servers/slapd/back-sql/rdbms_depend servers/slapd/back-sql/examples +%if %suse_version < 1130 # install 2.3 slapcat install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat %endif +%endif rm -f $RPM_BUILD_ROOT/usr/lib/openldap/modules/*.a rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-dnssrv.5 rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-ndb.5 @@ -331,7 +336,6 @@ cat >openldap2.filelist <openldap2.filelist <>openldap2.filelist < openldap2-client.filelist < openldap2-back-sql.filelist < $SCHEMA_BACKUP/slapd.conf.update - LOGFILE="slaptool.log" - BACKENDS=`grep ^database $SLAPD_CONF | awk '{print $2}'` - DIRECTORIES=(`grep ^directory $SLAPD_CONF | awk '{print $2}'`) - MSG="" - db_num=0 - dir_num=0 - restart="" - /etc/init.d/ldap status 2&>1 > /dev/null - if [ "$?" = "0" ]; then - /etc/init.d/ldap stop - restart="1" - fi - for i in $BACKENDS; do - db_num=$((db_num+1)); - if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then - db_dir=${DIRECTORIES[$dir_num]}; - if [ -f $db_dir/id2entry.bdb ] || [ -f $db_dir/id2entry.dbb ] ; then - rm $db_dir/__db* ; - mkdir $db_dir/db_bak ; - echo "Dumping database to: $db_dir/ldapbak.ldif.$db_num" ; - /usr/sbin/openldap-2.3-slapcat -T c \ - -f $SCHEMA_BACKUP/slapd.conf.update \ - -n $db_num -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE; - if [ "x$i" = "xldbm" ] ; then - mv $db_dir/*.dbb $db_dir/db_bak/ ; - else - mv $db_dir/*.bdb $db_dir/db_bak/ ; - mv $db_dir/log.* $db_dir/db_bak/ ; - fi - mv $db_dir/alock $db_dir/db_bak/ ; - rm -f $db_dir/__db* ; - fi - dir_num=$((dir_num+1)); - fi - done - db_num=0 - dir_num=0 - sed -i -e "s;ldbm;bdb;g" $SLAPD_CONF - for i in $BACKENDS; do - db_num=$((db_num+1)); - if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then - db_dir=${DIRECTORIES[$dir_num]}; - if [ -s $db_dir/ldapbak.ldif.$db_num ] ; then - if [ `wc -l $db_dir/ldapbak.ldif.$db_num | awk '{print $1}'` -lt 2500000 ]; then - if [ "x$i" = "xldbm" ] ; then - echo "Converting $i database to bdb in $db_dir" ; - # Create default DB_CONFIG for better performance - echo "set_cachesize 0 15000000 1" > $db_dir/DB_CONFIG - echo "set_lg_regionmax 262144" >> $db_dir/DB_CONFIG - echo "set_lg_bsize 2097152" >> $db_dir/DB_CONFIG - echo "set_flags DB_LOG_AUTOREMOVE" >> $db_dir/DB_CONFIG - else - echo "Restoring $i database in $db_dir" ; - fi - slapadd -q -n $db_num -f $SLAPD_CONF -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE ; - if [ $? -ne 0 ]; then - MSG="$MSG\nFailed to restore database in $db_dir"; - MSG="$MSG\nPlease restore manually from the LDIF dump $db_dir/ldapbak.ldif.$db_num\n"; - else - rm -f $db_dir/ldapbak.ldif.$db_num - rm -rf $db_dir/db_bak/ - fi - else - MSG="$MSG\nPlease restore the database in $db_dir manually by using"; - MSG="$MSG\nslapadd with the LDIF dump $db_dir/ldapbak.ldif.$db_num\n"; - fi - fi - dir_num=$((dir_num+1)); - fi - done - if [ "$MSG" ] ; then - echo -e "$MSG"; - else - rm -f /etc/openldap/UPDATE_NEEDED ; - if [ $restart ]; then - /etc/init.d/ldap start - fi - fi -fi %preun %stop_on_removal ldap