import libdb-5.3.28-64.el10

i10ce changed/i10ce/libdb-5.3.28-64.el10
Arkady L. Shane 2 days ago
parent c0614b49cd
commit 7ec9f62386
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

5
.gitignore vendored

@ -1,3 +1,4 @@
SOURCES/db-5.3.28.tar.gz
SOURCES/db.1.85.tar.gz
SOURCES/libdb-5.3.28-manpages.tar.gz
SOURCES/v1.0.3.tar.gz
SOURCES/db.1.85.tar.gz
SOURCES/db-5.3.28.tar.gz

@ -1,3 +1,4 @@
fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9 SOURCES/db-5.3.28.tar.gz
ccb057b07761d1b2b34626e748c7392c749d5e6d SOURCES/db.1.85.tar.gz
c90635ffef230707c87f1353495972f8041882bd SOURCES/libdb-5.3.28-manpages.tar.gz
c90635ffef230707c87f1353495972f8041882bd SOURCES/libdb-5.3.28-manpages.tar.gz
733e74a4aac0dd5b4d0848f68b013a17322b819c SOURCES/v1.0.3.tar.gz
ccb057b07761d1b2b34626e748c7392c749d5e6d SOURCES/db.1.85.tar.gz
fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9 SOURCES/db-5.3.28.tar.gz

@ -1,54 +0,0 @@
This patch fixes: CWE-686,CWE-398
diff -ur db-5.3.28/src/log/log_verify_int.c new/src/log/log_verify_int.c
--- db-5.3.28/src/log/log_verify_int.c 2013-09-09 17:35:08.000000000 +0200
+++ new/src/log/log_verify_int.c 2021-08-05 13:33:06.378608924 +0200
@@ -433,9 +433,9 @@
putflag = DB_CURRENT;
doput = 1;
}
+ if (doput)
+ ret = __dbc_put(csr, &key, &data, putflag);
- if (doput && (ret = __dbc_put(csr, &key, &data, putflag)) != 0)
- goto err;
err:
if (csr != NULL && (tret = __dbc_close(csr)) != 0 && ret == 0)
ret = tret;
diff -ur db-5.3.28/src/log/log_verify_util.c new/src/log/log_verify_util.c
--- db-5.3.28/src/log/log_verify_util.c 2013-09-09 17:35:08.000000000 +0200
+++ new/src/log/log_verify_util.c 2021-08-04 15:10:07.900854238 +0200
@@ -2140,8 +2140,7 @@
for (ret = __dbc_pget(csr, &key, &data2, &data, DB_SET); ret == 0;
ret = __dbc_pget(csr, &key, &data2, &data, DB_NEXT_DUP))
BDBOP(__db_put(pdb, lvh->ip, NULL, &data2, &key2, 0));
- if ((ret = __del_txn_pages(lvh, ctxn)) != 0 && ret != DB_NOTFOUND)
- goto err;
+ ret = __del_txn_pages(lvh, ctxn);
err:
if (csr != NULL && (tret = __dbc_close(csr)) != 0 && ret == 0)
ret = tret;
diff -ur db-5.3.28/src/rep/rep_backup.c new/src/rep/rep_backup.c
--- db-5.3.28/src/rep/rep_backup.c 2013-09-09 17:35:09.000000000 +0200
+++ new/src/rep/rep_backup.c 2021-08-04 14:47:51.967782566 +0200
@@ -542,8 +542,6 @@
ret = __memp_fput(dbp->mpf, ip, pagep, dbc->priority);
pagep = NULL;
- if (ret != 0)
- goto err;
err:
/*
* Check status of pagep in case any new error paths out leave
diff -ur db-5.3.28/util/db_dump185.c new/util/db_dump185.c
--- db-5.3.28/util/db_dump185.c 2013-09-09 17:35:12.000000000 +0200
+++ new/util/db_dump185.c 2021-08-04 14:45:37.592794678 +0200
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#include <unistd.h>
#ifdef HAVE_DB_185_H
#include <db_185.h>
#else

@ -0,0 +1,34 @@
Do not build snprintf. Instead use the one in glibc.
This avoids an implicit function declaration of vsprintf.
snprintf is only called from db.1.85/btree/bt_open.c, and the length
checking in the glibc implementation seems harmless there.
Furthermore, NULL is not a valid integer constant, so use 0 directly
(the __bt_first function in bt_seq.c returns int).
diff -ur db-5.3.28.orig/db.1.85/PORT/linux/Makefile db-5.3.28/db.1.85/PORT/linux/Makefile
--- db-5.3.28.orig/db.1.85/PORT/linux/Makefile 2022-12-10 12:29:48.599322424 +0100
+++ db-5.3.28/db.1.85/PORT/linux/Makefile 2022-12-10 12:35:08.415288426 +0100
@@ -11,7 +11,7 @@
OBJ5= rec_close.o rec_delete.o rec_get.o rec_open.o rec_put.o rec_search.o \
rec_seq.o rec_utils.o
-MISC= snprintf.o
+MISC=
${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC}
rm -f $@
only in patch2:
unchanged:
--- db-5.3.28.orig/db.1.85/btree/bt_seq.c 1994-07-26 18:57:24.000000000 +0200
+++ db-5.3.28/db.1.85/btree/bt_seq.c 2024-01-05 15:53:31.859178929 +0100
@@ -358,7 +358,7 @@
* page) and return it.
*/
if ((ep = __bt_search(t, key, exactp)) == NULL)
- return (NULL);
+ return 0;
if (*exactp) {
if (F_ISSET(t, B_NODUPS)) {
*erval = *ep;

@ -0,0 +1,26 @@
Add additional header files to avoid implicit declaration of the flock
and usleep functions. Improves C99 compatibility.
diff -ur db-5.3.28.orig/src/os/os_flock.c db-5.3.28/src/os/os_flock.c
--- db-5.3.28.orig/src/os/os_flock.c 2022-12-10 12:29:48.614322281 +0100
+++ db-5.3.28/src/os/os_flock.c 2022-12-10 14:33:21.785814691 +0100
@@ -10,6 +10,8 @@
#include "db_int.h"
+#include <sys/file.h>
+
#if !defined(HAVE_FCNTL) || !defined(HAVE_FLOCK)
static int __os_filelocking_notsup __P((ENV *));
#endif
diff -ur db-5.3.28.orig/util/db_dump185.c db-5.3.28/util/db_dump185.c
--- db-5.3.28.orig/util/db_dump185.c 2013-09-09 17:35:12.000000000 +0200
+++ db-5.3.28/util/db_dump185.c 2022-12-10 12:35:08.415288426 +0100
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#ifdef HAVE_DB_185_H
#include <db_185.h>

@ -0,0 +1,285 @@
Port the configure script to C99. Add missing header files, avoid
calling the undeclared exit function, and add missing return types
main. This improves compatibility with compilers which do not accept
language features that were removed from C99.
diff -ur db-5.3.28.orig/dist/aclocal/clock.m4 db-5.3.28/dist/aclocal/clock.m4
--- db-5.3.28.orig/dist/aclocal/clock.m4 2013-09-09 17:35:02.000000000 +0200
+++ db-5.3.28/dist/aclocal/clock.m4 2022-12-10 12:35:08.415288426 +0100
@@ -21,12 +21,14 @@
AC_CACHE_CHECK([for clock_gettime monotonic clock], db_cv_clock_monotonic, [
AC_TRY_RUN([
#include <sys/time.h>
-main() {
+#include <time.h>
+int main() {
struct timespec t;
return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
}], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no,
AC_TRY_LINK([
-#include <sys/time.h>], [
+#include <sys/time.h>
+#include <time.h>], [
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no))
diff -u db-5.3.28/dist/aclocal/mmap.m4 db-5.3.28/dist/aclocal/mmap.m4
--- db-5.3.28/dist/aclocal/mmap.m4 2024-01-05 16:07:07.340002918 +0100
+++ db-5.3.28/dist/aclocal/mmap.m4 2024-01-05 16:45:12.128407358 +0100
@@ -42,13 +42,11 @@
#define MAP_FAILED (-1)
#endif
- int catch_sig(sig)
- int sig;
+ void catch_sig(int sig)
{
- exit(1);
}
- main() {
+ int main() {
const char *underlying;
unsigned gapsize;
char *base;
diff -ur db-5.3.28.orig/dist/aclocal/mutex.m4 db-5.3.28/dist/aclocal/mutex.m4
--- db-5.3.28.orig/dist/aclocal/mutex.m4 2013-09-09 17:35:02.000000000 +0200
+++ db-5.3.28/dist/aclocal/mutex.m4 2022-12-10 12:35:08.415288426 +0100
@@ -5,7 +5,7 @@
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
@@ -49,7 +49,7 @@
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
@@ -89,7 +89,7 @@
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_condattr_t condattr;
exit(pthread_condattr_init(&condattr) ||
@@ -110,7 +110,7 @@
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_rwlock_t rwlock;
pthread_rwlockattr_t rwlockattr;
exit(pthread_rwlockattr_init(&rwlockattr) ||
@@ -282,7 +282,7 @@
# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
AC_TRY_COMPILE(,[
#if (defined(i386) || defined(__i386__)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -291,7 +291,7 @@
# x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
AC_TRY_COMPILE(,[
#if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -314,7 +314,7 @@
AC_TRY_COMPILE(,[
#if defined(__sparc__) && defined(__GNUC__)
asm volatile ("membar #StoreStore|#StoreLoad|#LoadStore");
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -356,7 +356,7 @@
msem_init(&x, 0);
msem_lock(&x, 0);
msem_unlock(&x, 0);
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -373,7 +373,7 @@
msem_init(&x, 0);
msem_lock(&x, 0);
msem_unlock(&x, 0);
- exit(0);
+ return 0;
], [db_cv_mutex=UNIX/msem_init])
fi
@@ -395,7 +395,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__USLC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -452,7 +452,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__alpha) && defined(__DECC)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -463,7 +463,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__alpha) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -474,7 +474,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__arm__) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -485,7 +485,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -496,7 +496,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -507,7 +507,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -518,7 +518,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if (defined(mc68020) || defined(sun3)) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -529,7 +529,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__MVS__) && defined(__IBMC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -540,7 +540,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__s390__) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -551,7 +551,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(__ia64) && defined(__GNUC__)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -562,7 +562,7 @@
if test "$db_cv_mutex" = no; then
AC_TRY_COMPILE(,[
#if defined(_UTS)
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
@@ -910,9 +910,9 @@
if test "$db_cv_atomic" = no; then
AC_TRY_COMPILE(,[
#if ((defined(i386) || defined(__i386__)) && defined(__GNUC__))
- exit(0);
+ return 0;
#elif ((defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__))
- exit(0);
+ return 0;
#else
FAIL TO COMPILE/LINK
#endif
diff -ur db-5.3.28.orig/dist/aclocal/sequence.m4 db-5.3.28/dist/aclocal/sequence.m4
--- db-5.3.28.orig/dist/aclocal/sequence.m4 2022-12-10 12:29:48.598322433 +0100
+++ db-5.3.28/dist/aclocal/sequence.m4 2022-12-10 12:35:08.415288426 +0100
@@ -43,7 +43,9 @@
# test, which won't test for the appropriate printf format strings.
if test "$db_cv_build_sequence" = "yes"; then
AC_TRY_RUN([
- main() {
+ #include <stdio.h>
+ #include <string.h>
+ int main() {
$db_cv_seq_type l;
unsigned $db_cv_seq_type u;
char buf@<:@100@:>@;
@@ -59,7 +61,10 @@
return (1);
return (0);
}],, [db_cv_build_sequence="no"],
- AC_TRY_LINK(,[
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <string.h>
+ ],[
$db_cv_seq_type l;
unsigned $db_cv_seq_type u;
char buf@<:@100@:>@;
diff -ur db-5.3.28.orig/dist/configure.ac db-5.3.28/dist/configure.ac
--- db-5.3.28.orig/dist/configure.ac 2022-12-10 12:29:48.610322320 +0100
+++ db-5.3.28/dist/configure.ac 2022-12-10 12:43:38.840398043 +0100
@@ -1047,6 +1047,7 @@
AC_CACHE_CHECK([for dl_iterate_phdr], db_cv_dl_iterate_phdr, [
AC_TRY_LINK([
#include <sys/types.h>
+#include <link.h>
#include <netdb.h>], [
dl_iterate_phdr(0, 0);
], [db_cv_dl_iterate_phdr=yes], [db_cv_dl_iterate_phdr=no])])

@ -0,0 +1,20 @@
Avoid implicit function declarations due to missing prototypes for
internal functions.
diff -ur db-5.3.28.orig/lang/sql/sqlite/src/test_stat.c db-5.3.28/lang/sql/sqlite/src/test_stat.c
--- db-5.3.28.orig/lang/sql/sqlite/src/test_stat.c 2013-09-09 17:35:06.000000000 +0200
+++ db-5.3.28/lang/sql/sqlite/src/test_stat.c 2022-12-10 14:40:10.362683745 +0100
@@ -136,6 +136,13 @@
#endif
/*
+** Internal functions used by this test.
+*/
+int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage);
+void *sqlite3PagerGetData(DbPage *pPg);
+void sqlite3PagerUnref(DbPage *pPg);
+
+/*
** Connect to or create a statvfs virtual table.
*/
static int statConnect(

@ -1,17 +1,27 @@
# This must remain enabled even for RHEL/ELN until all libdb dependencies
# are dropped, then this should be Fedora-only
%bcond_without subpackages
%define __soversion_major 5
%define __soversion %{__soversion_major}.3
%define __tclversion 8.6
%define _converter_version 1.0.3
# The SQLite configure script does not support --runstatedir and is not
# regenerated.
%undefine _configure_use_runstatedir
Summary: The Berkeley DB database library for C
Name: libdb
Version: 5.3.28
Release: 53%{?dist}
Release: 64%{?dist}
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz
# For mt19937db.c
Source2: http://www.gnu.org/licenses/lgpl-2.1.txt
# libdb man pages generated from the 5.3.28 documentation
Source3: libdb-5.3.28-manpages.tar.gz
Source4: https://github.com/fila43/db_converter/archive/refs/tags/v%{_converter_version}.tar.gz
Patch0: libdb-multiarch.patch
# db-1.85 upstream patches
Patch10: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
@ -56,20 +66,28 @@ Patch38: libdb-limit-cpu.patch
Patch39: libdb-5.3.21-trickle_cpu.patch
# cve-2019-2708 fixed by mmuzila
Patch40: db-5.3.28_cve-2019-2708.patch
# Downstream covscan patch
Patch41: db-5.3.28-fix-CWE-686-398.patch
Patch42: db-5.3.28-mmap-high-cpu-usage.patch
# Prevents high CPU usage
Patch41: db-5.3.28-mmap-high-cpu-usage.patch
Patch42: libdb-1.85-c99.patch
Patch43: libdb-c99.patch
Patch44: libdb-configure-c99.patch
Patch45: libdb-sqlite-c99.patch
URL: http://www.oracle.com/database/berkeley-db/
License: BSD and LGPLv2 and Sleepycat
License: BSD-3-Clause AND LGPL-2.1-only AND Sleepycat
BuildRequires: gcc gcc-c++
BuildRequires: perl-interpreter libtool
BuildRequires: tcl-devel >= %{__tclversion}
BuildRequires: chrpath
BuildRequires: zlib-devel
BuildRequires: make
BuildRequires: make gdbm-devel lmdb-devel
Conflicts: filesystem < 3
# libdb was marked as deprecated in F33:
# https://fedoraproject.org/wiki/Changes/Libdb_deprecated
Provides: deprecated()
%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -84,6 +102,8 @@ be installed on all systems.
Summary: Command line tools for managing Berkeley DB databases
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description utils
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -96,6 +116,8 @@ recovery. DB supports C, C++ and Perl APIs.
Summary: C development files for the Berkeley DB library
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -109,6 +131,8 @@ Requires: %{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
BuildArch: noarch
Provides: deprecated()
%description devel-doc
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -120,6 +144,8 @@ Berkeley DB.
Summary: Berkeley DB static libraries
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description devel-static
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -131,6 +157,8 @@ Berkeley DB.
Summary: The Berkeley DB database library for C++
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description cxx
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -146,6 +174,8 @@ Summary: The Berkeley DB database library for C++
Requires: %{name}-cxx%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description cxx-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -160,6 +190,8 @@ be installed on all systems.
Summary: Development files for using the Berkeley DB with tcl
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description tcl
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -170,6 +202,8 @@ for building programs which use the Berkeley DB in Tcl.
Summary: Development files for using the Berkeley DB with tcl
Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description tcl-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -180,6 +214,8 @@ for building programs which use the Berkeley DB in Tcl.
Summary: Development files for using the Berkeley DB with sql
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description sql
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
@ -190,47 +226,65 @@ for building programs which use the Berkeley DB in SQL.
Summary: Development files for using the Berkeley DB with sql
Requires: %{name}-sql%{?_isa} = %{version}-%{release}
Provides: deprecated()
%description sql-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
client/server applications. This package contains the libraries
for building programs which use the Berkeley DB in SQL.
%package convert-util
Summary: Development files for using the Berkeley DB with sql
%description convert-util
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
client/server applications. This package contains the libraries
for building programs which use the Berkeley DB in SQL.
%prep
%setup -q -n db-%{version} -a 1
cp %{SOURCE2} .
tar -xf %{SOURCE3}
# db_converter
tar -xf %{SOURCE4}
%patch0 -p1
%patch -P0 -p1
pushd db.1.85/PORT/linux
%patch10 -p0
%patch -P10 -p0
popd
pushd db.1.85
%patch11 -p0
%patch12 -p0
%patch13 -p0
%patch20 -p1
%patch -P11 -p0
%patch -P12 -p0
%patch -P13 -p0
%patch -P20 -p1
popd
%patch22 -p1
%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
%patch41 -p1
%patch42 -p1
%patch -P22 -p1
%patch -P24 -p1
%patch -P25 -p1
%patch -P27 -p1
%patch -P28 -p1
%patch -P29 -p1
%patch -P30 -p1
%patch -P31 -p1
%patch -P32 -p1
%patch -P33 -p1
%patch -P34 -p1
%patch -P35 -p1
%patch -P36 -p1
%patch -P37 -p1
%patch -P38 -p1
%patch -P39 -p1
%patch -P40 -p1 -b .cve-2019-2708
%patch -P41 -p1
%patch -P42 -p1
%patch -P43 -p1
%patch -P44 -p1
%patch -P45 -p1
cd dist
./s_config
@ -246,7 +300,7 @@ make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
test -d dist/dist-tls || mkdir dist/dist-tls
# Static link db_dump185 with old db-185 libraries.
/bin/sh libtool --tag=CC --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c util/db_dump185.c -o dist/dist-tls/db_dump185.lo
/bin/sh libtool --tag=CC --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c util/db_dump185.c -o dist/dist-tls/db_dump185.lo
/bin/sh libtool --tag=LD --mode=link %{__cc} $RPM_LD_FLAGS -o dist/dist-tls/db_dump185 dist/dist-tls/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
# Update config files to understand aarch64
@ -263,7 +317,6 @@ pushd dist/dist-tls
--enable-cxx --enable-sql \
--enable-test \
--disable-rpath \
--with-cryptography=no \
--with-tcl=%{_libdir}/tcl%{__tclversion}
# Remove libtool predep_objects and postdep_objects wonkiness so that
@ -280,12 +333,20 @@ perl -pi -e 's/-shared -nostdlib/-shared/' libtool
echo "source ../../test/tcl/test.tcl; r env; r mut; r memp" | tclsh
popd
pushd db_converter-%{_converter_version}
# libdb-5.3.a is part of static package, build produces libdb.a
sed -i 's/-ldb-5.3/-ldb/g' Makefile
# Set path to headers and library to previously built files
# since this tool is intended to build statically
make LDFLAGS="-I../dist/dist-tls -L../dist/dist-tls -Wl,-z,now $RPM_LD_FLAGS" CFLAGS="-g -fPIC %build_cflags" static
popd
%install
%if %{with subpackages}
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
%make_install STRIP=/bin/true -C dist/dist-tls
# XXX Nuke non-versioned archives and symlinks
@ -326,13 +387,22 @@ mv man/* ${RPM_BUILD_ROOT}%{_mandir}/man1
%ldconfig_scriptlets cxx
%ldconfig_scriptlets sql
%ldconfig_scriptlets tcl
%else
mkdir -p %{buildroot}%{_bindir}
%endif
install -m 0755 db_converter-%{_converter_version}/db_converter %{buildroot}/%{_bindir}/db_converter
%files
%license LICENSE lgpl-2.1.txt
%if %{with subpackages}
%doc README
%{_libdir}/libdb-%{__soversion}.so
%{_libdir}/libdb-%{__soversion_major}.so
%else
%{_bindir}/db_converter
%endif
%if %{with subpackages}
%files devel
%{_libdir}/libdb.so
%dir %{_includedir}/%{name}
@ -340,16 +410,22 @@ mv man/* ${RPM_BUILD_ROOT}%{_mandir}/man1
%{_includedir}/%{name}/db_185.h
%{_includedir}/db.h
%{_includedir}/db_185.h
%endif
%if %{with subpackages}
%files devel-doc
%doc docs/*
%endif
%if %{with subpackages}
%files devel-static
%{_libdir}/libdb-%{__soversion}.a
%{_libdir}/libdb_cxx-%{__soversion}.a
%{_libdir}/libdb_tcl-%{__soversion}.a
%{_libdir}/libdb_sql-%{__soversion}.a
%endif
%if %{with subpackages}
%files utils
%{_bindir}/db*_archive
%{_bindir}/db*_checkpoint
@ -365,60 +441,111 @@ mv man/* ${RPM_BUILD_ROOT}%{_mandir}/man1
%{_bindir}/db*_verify
%{_bindir}/db*_tuner
%{_mandir}/man1/db_*
%endif
%if %{with subpackages}
%files convert-util
%{_bindir}/db_converter
%endif
%if %{with subpackages}
%files cxx
%{_libdir}/libdb_cxx-%{__soversion}.so
%{_libdir}/libdb_cxx-%{__soversion_major}.so
%endif
%if %{with subpackages}
%files cxx-devel
%{_includedir}/%{name}/db_cxx.h
%{_includedir}/db_cxx.h
%{_libdir}/libdb_cxx.so
%endif
%if %{with subpackages}
%files tcl
%{_libdir}/libdb_tcl-%{__soversion}.so
%{_libdir}/libdb_tcl-%{__soversion_major}.so
%endif
%if %{with subpackages}
%files tcl-devel
%{_libdir}/libdb_tcl.so
%endif
%if %{with subpackages}
%files sql
%{_libdir}/libdb_sql-%{__soversion}.so
%{_libdir}/libdb_sql-%{__soversion_major}.so
%endif
%if %{with subpackages}
%files sql-devel
%{_bindir}/dbsql
%{_libdir}/libdb_sql.so
%{_includedir}/%{name}/dbsql.h
%endif
%changelog
* Wed Nov 24 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-53
- Add missing RPM_LD_FLAGS for db_dump185
- Resolves: #2026417
* Wed Dec 25 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 5.3.28-64
- Rebuilt for MSVSphere 10
* Mon Sep 13 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-52
- Bad order of sys calls cause high CPU usage
- Related: #2002186
- Patch no. 42 was added
* Mon Sep 16 2024 Filip Janus <fjanus@redhat.com> - 5.3.28-64
- Rebase db_converter to the latest upstream version
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-63
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Mon Jun 10 2024 Ales Nezbeda <anezbeda@redhat.com> - 5.3.28-62
- Fix BZ#1817751 - Compile with PIE flag
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 5.3.28-51
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-60
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Aug 05 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-50
- fix static analyzer issues CWE-686-398
- Resolves: #1938760
* Fri Jan 05 2024 Florian Weimer <fweimer@redhat.com> - 5.3.28-59
- Additional C compatibility fixes (#2152303)
* Mon Jul 12 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-49
- Rebuild due to glibc
- Resolves: #1980975
* Fri Sep 08 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 5.3.28-58
- Re-enable subpackages in RHEL builds
* Fri Jun 25 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-48
- Disable crypto support
- Resolves: #1974657
* Tue Aug 29 2023 Filip Janus <fjanus@redhat.com> - 5.3.25-57
- Add convert-util subpackage
- It allowes to convert BerkeleyDB database format to GDBM/LMDB format
- Disable shiping libdb for rhel except convert-tool
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Dec 10 2022 Florian Weimer <fweimer@redhat.com> - 5.3.28-54
- Various changes to improve C99 compatibility (#2152303)
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Mar 02 2022 Filip Janus <fjanus@redhat.com> - 5.3.28-52
- Marked package as deprecated
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Sep 16 2021 Filip Januš <fjanus@redhat.com> - 5.3.29-50
- Fix mistake in patch 41
* Wed Sep 15 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-49
- Improve previous (patch 41) to cover more cases
* Mon Sep 13 2021 Filip Januš <fjanus@redhat.com> - 5.3.28-48
- Bad order of sys calls cause high CPU usage
- Related: #1992402
- Patch no. 41 was added
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 5.3.28-47
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save