%define __soversion 5.3 %define _libdb_a libdb-%{__soversion}.a %define _libcxx_a libdb_cxx-%{__soversion}.a %define libname_orig %mklibname db %define libname %{libname_orig}%{__soversion} %define libnamedev %{libname}-devel %define libnamestatic %{libname}-static-devel %define libdbcxx %{libname_orig}cxx%{__soversion} %define libdbsql %{libname_orig}sql%{__soversion} %define libdbtcl %{libname_orig}tcl%{__soversion} %define libdbnss %{libname_orig}nss%{__soversion} %define libdbnssdev %{libdbnss}-devel # Disable to boostrap and avoid cycle: db53 -> systemtap -> rpm-devel -> db53 %bcond_without systemtap %bcond_without sql %bcond_without tcl %bcond_with db1 # Define to build a stripped down version to use for nss libraries %bcond_with nss # Define to rename utilities and allow parallel installation %bcond_without parallel # mutexes defaults to POSIX/pthreads/library %bcond_with asmmutex Summary: The Berkeley DB database library for C Name: db53 Version: 5.3.28 Release: %mkrel 25 Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz # statically link db1 library Patch0: db-5.1.19-db185.patch Patch1: db-5.1.25-sql_flags.patch Patch2: db-5.1.19-tcl-link.patch # fedora patches # other patches Patch24: db-4.5.20-jni-include-dir.patch # License clarification patch # http://devel.trisquel.info/gitweb/?p=package-helpers.git;a=blob;f=helpers/DATA/db4.8/007-mt19937db.c_license.patch;h=1036db4d337ce4c60984380b89afcaa63b2ef88f;hb=df48d40d3544088338759e8bea2e7f832a564d48 Patch25: 007-mt19937db.c_license.patch # memp_stat fix provided by upstream (rhbz#1211871) Patch27: db-5.3.21-memp_stat-upstream-fix.patch # fix for mutexes not being released provided by upstream (rhbz#1277887) Patch28: db-5.3.21-mutex_leak.patch # fix for overflowing hash variable inside bundled lemon Patch29: db-5.3.28-lemon_hash.patch # upstream patch adding the ability to recreate libdb's environment on version mismatch # or when libpthread.so is modified (rhbz#1394862) Patch30: db-5.3.28-condition_variable.patch # additional changes to the upstream patch to address rhbz#1460003 Patch31: db-5.3.28-condition-variable-ppc.patch # downstream patch that adds a check for rpm transaction lock in order to be able to update libdb # FIXME: remove when able Patch32: db-5.3.28-rpm-lock-check.patch # downstream patch to hotfix rhbz#1464033, sent upstream Patch33: db-5.3.28-cwd-db_config.patch Patch34: libdb-5.3.21-region-size-check.patch # Patch sent upstream Patch35: checkpoint-opd-deadlock.patch Patch36: db-5.3.28-atomic_compare_exchange.patch # CDB race (rhbz #1099509) Patch37: libdb-cbd-race.patch # Limit concurrency to max 1024 CPUs (rhbz#1245410) # A fix for the issue should be in an upstream release already # https://community.oracle.com/message/13274780#13274780 Patch38: libdb-limit-cpu.patch # rhbz#1608749 Patch sent upstream # Expects libdb-5.3.21-mutex_leak.patch applied Patch39: libdb-5.3.21-trickle_cpu.patch # cve-2019-2708 fixed by mmuzila Patch40: db-5.3.28_cve-2019-2708.patch URL: http://www.oracle.com/technology/software/products/berkeley-db/ License: BSD and LGPLv2 and Sleepycat Group: System/Libraries %if %{with systemtap} BuildRequires: systemtap # dtrace utility was moved into systemtap-sdt-devel BuildRequires: systemtap-sdt-devel %endif %if %{with sql} BuildRequires: pkgconfig(sqlite3) %endif %if %{with tcl} BuildRequires: pkgconfig(tcl) %endif %if %{with db1} BuildRequires: db1-devel %endif BuildRequires: ed BuildRequires: libtool %description The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB is used by many applications, including Python and Perl, so this should be installed on all systems. %package -n %{libname} Summary: The Berkeley DB database library for C Group: System/Libraries Requires(pre): filesystem >= 2.1.9-18 %description -n %{libname} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB is used by many applications, including Python and Perl, so this should be installed on all systems. %package -n %{libdbcxx} Summary: The Berkeley DB database library for C++ Group: System/Libraries %description -n %{libdbcxx} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB is used by many applications, including Python and Perl, so this should be installed on all systems. This package contains the files needed to build C++ programs which use Berkeley DB. %if %{with sql} %package -n %{libdbsql} Summary: The Berkeley DB database library for SQL Group: System/Libraries %description -n %{libdbsql} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB is used by many applications, including Python and Perl, so this should be installed on all systems. This package contains the files needed to build SQL programs which use Berkeley DB. %endif %if %{with tcl} %package -n %{libdbtcl} Summary: The Berkeley DB database library for TCL Group: System/Libraries %description -n %{libdbtcl} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB is used by many applications, including Python and Perl, so this should be installed on all systems. This package contains the header files, libraries, and documentation for building tcl programs which use Berkeley DB. %endif %package utils Summary: Command line tools for managing Berkeley DB databases Group: Databases %if !%{with parallel} Conflicts: db4-utils Conflicts: db5-utils < %{__soversion} Conflicts: db-utils < %{__soversion} %endif Provides: db5-utils = %{EVRD} Requires: %{name}_recover = %{EVRD} %description utils The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching and database recovery. DB supports C, C++, Java and Perl APIs. This package contains command line tools for managing Berkeley DB databases. %package -n %{name}_recover Summary: Minimal package with '%{name}_recover' only Group: Databases Provides: db_recover = %{EVRD} Provides: db5_recover = %{EVRD} %description -n %{name}_recover This is a minimal package that ships with '%{name}_recover' only as it's required for using "RPM ACID". %package -n %{libnamedev} Summary: Development libraries/header files for the Berkeley DB library Group: Development/Databases Requires(pre): filesystem >= 2.1.9-18 Requires: %{libname} = %{EVRD} %if %{with sql} Requires: %{libdbsql} = %{EVRD} %endif %if %{with tcl} Requires: %{libdbtcl} = %{EVRD} %endif Requires: %{libdbcxx} = %{EVRD} Provides: db%{__soversion}-devel = %{EVRD} Provides: libdb%{__soversion}-devel = %{EVRD} Provides: libdb-devel = %{EVRD} Provides: db-devel = %{EVRD} Conflicts: db-devel < %{__soversion} Conflicts: db5-devel < %{__soversion} Provides: db5-devel = %{EVRD} Provides: %{name}-devel = %{EVRD} %description -n %{libnamedev} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching and database recovery. DB supports C, C++, Java, Perl and SQL APIs. This package contains the header files, libraries, and documentation for building programs which use Berkeley DB. %package -n %{libnamestatic} Summary: Development static libraries files for the Berkeley DB library Group: Development/Databases Requires: db%{__soversion}-devel = %{EVRD} Provides: db%{__soversion}-static-devel = %{EVRD} Provides: libdb%{__soversion}-static-devel = %{EVRD} Conflicts: db-static-devel < %{__soversion} Provides: db5-static-devel = %{EVRD} %description -n %{libnamestatic} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching and database recovery. DB supports C, C++, Java and Perl APIs. This package contains the static libraries for building programs which use Berkeley DB. %if %{with nss} %package -n %{libdbnss} Summary: The Berkeley DB database library for NSS modules Group: System/Libraries %description -n %{libdbnss} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching and database recovery. DB supports C, C++, Java and Perl APIs. This package contains the shared library required by some nss modules that use Berkeley DB. %package -n %{libdbnssdev} Summary: Development libraries/header files for building nss modules with Berkeley DB Group: Development/Databases Requires: %{libdbnss} = %{EVRD} Provides: db5_nss-devel = %{EVRD} Provides: db_nss-devel = %{EVRD} Conflicts: db_nss-devel < %{__soversion} %description -n %{libdbnssdev} The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching and database recovery. DB supports C, C++, Java and Perl APIs. This package contains the header files and libraries for building nss modules which use Berkeley DB. %endif %prep %setup -q -n db-%{version} # fix strange attribs find . -type f -perm 0444 -exec chmod 644 {} \; rm -r lang/sql/jdbc/doc %patch0 -p1 -b .db185~ %patch1 -p1 -b .sql_flags~ %patch2 -p1 -b .tcl~ # fedora patches %patch24 -p1 %patch25 -p1 %patch27 -p1 %patch28 -p1 %patch29 -p1 %patch30 -p1 %patch31 -p1 %patch32 -p1 %patch33 -p1 %patch34 -p1 %patch35 -p1 %patch36 -p1 %patch37 -p1 %patch38 -p1 %patch39 -p1 %patch40 -p1 -b .cve-2019-2708 pushd dist libtoolize --copy --force cat %{_datadir}/aclocal/libtool.m4 >> aclocal.m4 popd # Remove tags files which we don't need. find . -name tags | xargs rm -f # Define a shell function for fixing HREF references in the docs, which # would otherwise break when we split the docs up into subpackages. fixup_href() { for doc in $@ ; do chmod u+w ${doc} sed -e 's,="../api_c/,="../../%{name}-devel/api_c/,g' \ -e 's,="api_c/,="../%{name}-devel/api_c/,g' \ -e 's,="../api_cxx/,="../../%{name}-devel/api_cxx/,g' \ -e 's,="api_cxx/,="../%{name}-devel/api_cxx/,g' \ -e 's,="../api_tcl/,="../../%{name}-devel/api_tcl/,g' \ -e 's,="api_tcl/,="../%{name}-devel/api_tcl/,g' \ -e 's,="../java/,="../../%{name}-devel/java/,g' \ -e 's,="java/,="../%{name}-devel/java/,g' \ -e 's,="../examples_c/,="../../%{name}-devel/examples_c/,g' \ -e 's,="examples_c/,="../%{name}-devel/examples_c/,g' \ -e 's,="../examples_cxx/,="../../%{name}-devel/examples_cxx/,g' \ -e 's,="examples_cxx/,="../%{name}-devel/examples_cxx/,g' \ -e 's,="../ref/,="../../%{name}-devel/ref/,g' \ -e 's,="ref/,="../%{name}-devel/ref/,g' \ -e 's,="../images/,="../../%{name}-devel/images/,g' \ -e 's,="images/,="../%{name}-devel/images/,g' \ -e 's,="../utility/,="../../%{name}-utils/utility/,g' \ -e 's,="utility/,="../%{name}-utils/utility/,g' ${doc} > ${doc}.new touch -r ${doc} ${doc}.new cat ${doc}.new > ${doc} touch -r ${doc}.new ${doc} rm -f ${doc}.new done } set +x # XXX painful to watch # Fix all of the HTML files. fixup_href `find . -name "*.html"` set -x # XXX painful to watch cd dist ./s_config cd .. %build CFLAGS="$CFLAGS -DSHAREDSTATEDIR="'\"%{_sharedstatedir}\"' export CFLAGS # Update config files to understand aarch64 for dir in dist lang/sql/sqlite lang/sql/jdbc lang/sql/odbc; do cp /usr/lib/rpm/mageia/config.{guess,sub} "$dir" done pushd build_unix CONFIGURE_TOP="../dist" \ %configure --includedir=%{_includedir}/%{name} \ --enable-shared --enable-static \ --enable-dbm \ %if %{with systemtap} --enable-systemtap \ %endif --enable-o_direct \ %if %{with sql} --enable-sql \ %endif %if %{with db1} --enable-compat185 --enable-dump185 \ %endif %if %{with tcl} --enable-tcl --with-tcl=%{_libdir} --enable-test \ %endif --enable-cxx \ %if %{with asmmutex} %ifarch %{ix86} --disable-posixmutexes --with-mutex=x86/gcc-assembly %endif %ifarch x86_64 --disable-posixmutexes --with-mutex=x86_64/gcc-assembly %endif %ifarch %{arm} --disable-posixmutexes --with-mutex=ARM/gcc-assembly %endif %else --enable-posixmutexes --with-mutex=POSIX/pthreads/library %endif %make popd %if %{with nss} mkdir build_nss pushd build_nss CONFIGURE_TOP="../dist" \ %configure --includedir=%{_includedir}/db_nss \ --enable-shared --disable-static \ --enable-dbm \ %if %{with systemtap} --enable-systemtap \ %endif --enable-o_direct \ --disable-tcl --disable-cxx --disable-java \ --with-uniquename=_nss \ --enable-compat185 \ --disable-cryptography --disable-queue \ --disable-replication --disable-verify \ %if %{with asmmutex} %ifarch %{ix86} --disable-posixmutexes --with-mutex=x86/gcc-assembly %endif %ifarch x86_64 --disable-posixmutexes --with-mutex=x86_64/gcc-assembly %endif %ifarch %{arm} --disable-posixmutexes --with-mutex=ARM/gcc-assembly %endif %else --enable-posixmutexes --with-mutex=POSIX/pthreads/library %endif %make_build libdb_base=libdb_nss libso_target=libdb_nss-%{__soversion}.la libdir=%{_libdir} popd %endif %install make -C build_unix install_setup install_include install_lib install_utilities \ DESTDIR=%{buildroot} emode=755 %if %{with nss} make -C build_nss install_include install_lib libdb_base=libdb_nss \ DESTDIR=%{buildroot} LIB_INSTALL_FILE_LIST="" %endif ln -sf %{name}/db.h %{buildroot}%{_includedir}/db.h # XXX This is needed for parallel install with db4.2 %if %{with parallel} for F in %{buildroot}%{_bindir}/*db_* ; do mv $F `echo $F | sed -e 's,db_,%{name}_,'` done %endif rm -rf %{buildroot}%{_includedir}/db_nss/db_cxx.h %if %{with sql} mv %{buildroot}%{_bindir}/{dbsql,db%{__soversion}_sql} %endif %files -n %{libname} %defattr(644,root,root,755) %doc LICENSE README %attr(755,root,root) %{_libdir}/libdb-%{__soversion}.so %files -n %{libdbcxx} %defattr(755,root,root) %{_libdir}/libdb_cxx-%{__soversion}.so %if %{with sql} %files -n %{libdbsql} %defattr(755,root,root) %{_libdir}/libdb_sql-%{__soversion}.so %endif %if %{with tcl} %files -n %{libdbtcl} %defattr(755,root,root) %{_libdir}/libdb_tcl-%{__soversion}.so %endif %files utils %doc docs/api_reference/C/db_archive.html %doc docs/api_reference/C/db_checkpoint.html %doc docs/api_reference/C/db_deadlock.html %doc docs/api_reference/C/db_dump.html %doc docs/api_reference/C/db_load.html %doc docs/api_reference/C/db_printlog.html %doc docs/api_reference/C/db_replicate.html %doc docs/api_reference/C/db_stat.html %doc docs/api_reference/C/db_upgrade.html %doc docs/api_reference/C/db_verify.html %{_bindir}/db*_archive %{_bindir}/db*_checkpoint %{_bindir}/db*_deadlock %{_bindir}/db*_dump* %{_bindir}/db*_hotbackup %{_bindir}/db*_load %{_bindir}/db*_printlog %{_bindir}/db*_replicate %{_bindir}/db*_stat %{_bindir}/db*_tuner %{_bindir}/db*_upgrade %{_bindir}/db*_verify %if %{with sql} %doc docs/api_reference/C/dbsql.html %{_bindir}/db%{__soversion}_sql %endif %files -n %{name}_recover %doc docs/api_reference/C/db_recover.html %{_bindir}/db*_recover %files -n %{libnamedev} %defattr(644,root,root,755) %doc docs/api_reference %dir %{_includedir}/%{name} %{_includedir}/%{name}/db.h %if %{with db1} %{_includedir}/%{name}/db_185.h %endif %{_includedir}/%{name}/db_cxx.h %if %{with sql} %{_includedir}/%{name}/dbsql.h %endif %{_includedir}/db.h %{_libdir}/libdb.so %{_libdir}/libdb-5.so %{_libdir}/libdb-%{__soversion}.la %{_libdir}/libdb_cxx.so %{_libdir}/libdb_cxx-5.so %{_libdir}/libdb_cxx-%{__soversion}.la %if %{with sql} %{_libdir}/libdb_sql.so %{_libdir}/libdb_sql-5.so %{_libdir}/libdb_sql-%{__soversion}.la %endif %if %{with tcl} %{_libdir}/libdb_tcl.so %{_libdir}/libdb_tcl-5.so %{_libdir}/libdb_tcl-%{__soversion}.la %endif %files -n %{libnamestatic} %defattr(644,root,root,755) %{_libdir}/*.a %if %{with nss} %files -n %{libdbnss} %defattr(755,root,root) %{_libdir}/libdb_nss-%{__soversion}.so %files -n %{libdbnssdev} %defattr(644,root,root,755) %dir %{_includedir}/db_nss %{_includedir}/db_nss/db.h %if %{with db1} %{_includedir}/db_nss/db_185.h %endif %{_libdir}/libdb_nss.so %{_libdir}/libdb_nss-5.so %endif %exclude %_libdir/libdb_nss-%{__soversion}.la %changelog * Tue Dec 29 2020 luigiwalser <luigiwalser> 5.3.28-25.mga8 + Revision: 1664653 - build without db1 + tv <tv> - Clarify license * Fri Dec 04 2020 tv <tv> 5.3.28-24.mga8 + Revision: 1652514 - Resolves: CVE-2019-2708 (#1853243) * Fri Sep 11 2020 tv <tv> 5.3.28-23.mga8 + Revision: 1624550 - Removed java subpackage because it cannot compile with jdk-11 * Sun Jul 05 2020 joequant <joequant> 5.3.28-22.mga8 + Revision: 1602074 - bump - add aarch64 work around - bump version - fix typo for link - remove arm workaround + pterjan <pterjan> - Remove usage of obsolete macros (https://github.com/rpm-software-management/rpm/issues/1211) * Mon Feb 17 2020 umeabot <umeabot> 5.3.28-19.mga8 + Revision: 1536948 - Mageia 8 Mass Rebuild + wally <wally> - replace deprecated %%configure2_5x * Sun Oct 06 2019 tv <tv> 5.3.28-18.mga8 + Revision: 1449958 - Optimize trickle thread CPU usage (#1608749) - Add patch to workaround issues on large systems (>1024 CPU) (rhbz#1245410) * Thu Sep 13 2018 tv <tv> 5.3.28-17.mga7 + Revision: 1258826 - Add patch for CDB race issue (rhbz#1099509) - Fix deadlocks when reading/writing off-page duplicate tree (rhbz#1349779) - Run a number of quick subsystem checks on build - Fail properly when encountering removed or 0-byte regions (rhbz#1471011) * Sun Jun 03 2018 wally <wally> 5.3.28-16.mga7 + Revision: 1234194 - rebuild for aarch64 * Wed May 30 2018 pterjan <pterjan> 5.3.28-15.mga7 + Revision: 1233179 - Add a Fedora patch to avoid conflict with builtin __atomic_compare_exchange - Rebuild with aarch64 fix + wally <wally> - fix build on aarch64 * Fri Jan 05 2018 ngompa <ngompa> 5.3.28-14.mga7 + Revision: 1190407 - Fix db-devel Provides to be fully versioned - Add libdb-devel Provides to main devel subpackage * Mon Sep 11 2017 tv <tv> 5.3.28-13.mga7 + Revision: 1152687 - fix build with gcc7 * Tue Sep 05 2017 tv <tv> 5.3.28-12.mga7 + Revision: 1151448 - add more patches from FC for rpm - disable nss as this prevents building with those patches * Fri Aug 11 2017 neoclust <neoclust> 5.3.28-11.mga7 + Revision: 1139842 - Add P32 (mga#21203) + tv <tv> - remove support for unsupported arches * Wed Mar 23 2016 blino <blino> 5.3.28-10.mga6 + Revision: 994683 - rebuild on arm * Wed Mar 02 2016 neoclust <neoclust> 5.3.28-9.mga6 + Revision: 981756 - Rebuild on java8 + blino <blino> - buildrequire ant for com.sleepycat.persist javadoc (suggested by neoclust) + umeabot <umeabot> - Mageia 6 Mass Rebuild * Sun Oct 11 2015 blino <blino> 5.3.28-7.mga6 + Revision: 889441 - add systemtap conditional flag (to boostrap and avoid cycle: db53 -> systemtap -> rpm-devel -> db53) * Sat Oct 03 2015 tv <tv> 5.3.28-6.mga6 + Revision: 885849 - rebuild for new tcl * Fri Aug 21 2015 tmb <tmb> 5.3.28-5.mga6 + Revision: 867563 - rebuild for new gcc + pterjan <pterjan> - Fix arm build * Mon Oct 20 2014 cjw <cjw> 5.3.28-4.mga5 + Revision: 792173 - fix build with jdk 1.8 + umeabot <umeabot> - Second Mageia 5 Mass Rebuild - Rebuild to fix library dependencies - Mageia 5 Mass Rebuild * Wed Feb 05 2014 fwang <fwang> 5.3.28-1.mga5 + Revision: 583507 - new version 5.3.28 * Mon Oct 21 2013 umeabot <umeabot> 5.3.21-5.mga4 + Revision: 540830 - Mageia 4 Mass Rebuild * Thu Oct 10 2013 luigiwalser <luigiwalser> 5.3.21-4.mga4 + Revision: 494353 - update java BRs * Wed Sep 04 2013 luigiwalser <luigiwalser> 5.3.21-3.mga4 + Revision: 474909 - rpm no longer allows listing a symlink to a directory as a dir in files - rpm no longer allows using attr on a symlink in files * Fri Jan 11 2013 umeabot <umeabot> 5.3.21-2.mga3 + Revision: 348627 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild + fwang <fwang> - provides db-nss-devel * Mon Jul 30 2012 tv <tv> 5.3.21-1.mga3 + Revision: 276203 - imported package db53 * Mon Jul 30 2012 Thierry Vignaud <tv@mageia.org> 5.3.21-1.mga3 - initial release