From 273ff89580ef322f006f21c6eece41f76d532243b3b09c38727d4408b3d94ec8 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 29 Sep 2010 09:24:42 +0000 Subject: [PATCH 1/4] - 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 OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=47 --- openldap2-client.changes | 8 +++ openldap2-client.spec | 104 ++++++--------------------------------- openldap2.changes | 8 +++ openldap2.spec | 100 +++++-------------------------------- 4 files changed, 42 insertions(+), 178 deletions(-) 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 From 526cf25e7d6b25b8b8b8a5642774159a075388a7e1775a6106a66e946464b172 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 29 Sep 2010 09:26:37 +0000 Subject: [PATCH 2/4] testsuite OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=48 --- openldap2-client.spec | 2 +- openldap2.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openldap2-client.spec b/openldap2-client.spec index 44757bd..79275e0 100644 --- a/openldap2-client.spec +++ b/openldap2-client.spec @@ -17,7 +17,7 @@ # norootforbuild -%define run_test_suite 0 +%define run_test_suite 1 Name: openldap2-client BuildRequires: cyrus-sasl-devel libopenssl-devel diff --git a/openldap2.spec b/openldap2.spec index 894403e..6a8fe94 100644 --- a/openldap2.spec +++ b/openldap2.spec @@ -17,7 +17,7 @@ # norootforbuild -%define run_test_suite 0 +%define run_test_suite 1 Name: openldap2 BuildRequires: cyrus-sasl-devel libopenssl-devel From e4735dff7687514e9820f57afc5154a83d3688d3a3e7936d323c2bd82524f2fb Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Fri, 1 Oct 2010 22:00:20 +0000 Subject: [PATCH 3/4] Updating link to change in openSUSE:Factory/openldap2 revision 68.0 OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=5c1bc584ad88835e5be73c4e925be4f8 --- openldap2-client.spec | 2 +- openldap2.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openldap2-client.spec b/openldap2-client.spec index 79275e0..d760098 100644 --- a/openldap2-client.spec +++ b/openldap2-client.spec @@ -25,7 +25,7 @@ BuildRequires: cyrus-sasl-devel libopenssl-devel BuildRequires: -libopenssl-devel -pwdutils openssl-devel %endif Version: 2.4.23 -Release: 1 +Release: 2 Url: http://www.openldap.org License: BSD3c(or similar) ; openldap 2.8 %if "%{name}" == "openldap2" diff --git a/openldap2.spec b/openldap2.spec index 6a8fe94..5de3ad8 100644 --- a/openldap2.spec +++ b/openldap2.spec @@ -25,7 +25,7 @@ BuildRequires: cyrus-sasl-devel libopenssl-devel BuildRequires: -libopenssl-devel -pwdutils openssl-devel %endif Version: 2.4.23 -Release: 1 +Release: 2 Url: http://www.openldap.org License: BSD3c(or similar) ; openldap 2.8 %if "%{name}" == "openldap2" From 31dd2dfe2faaa95c4790b3e8ed4b09829344a2adbe251184520f0c24bd8b12c3 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 1 Oct 2010 22:00:20 +0000 Subject: [PATCH 4/4] Accepting request 49498 from network:ldap checked in (request 49498) OBS-URL: https://build.opensuse.org/request/show/49498 OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=49 --- openldap2-client.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openldap2-client.spec b/openldap2-client.spec index d760098..c6c0b73 100644 --- a/openldap2-client.spec +++ b/openldap2-client.spec @@ -1,5 +1,5 @@ # -# spec file for package openldap2 (Version 2.4.23) +# spec file for package openldap2-client (Version 2.4.23) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,7 +19,7 @@ %define run_test_suite 1 -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