diff --git a/.libdb.metadata b/.libdb.metadata new file mode 100644 index 0000000..c819cfb --- /dev/null +++ b/.libdb.metadata @@ -0,0 +1,2 @@ +32e43c4898c8996750c958a90c174bd116fcba83 SOURCES/db-5.3.21.tar.gz +ccb057b07761d1b2b34626e748c7392c749d5e6d SOURCES/db.1.85.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/007-mt19937db.c_license.patch b/SOURCES/007-mt19937db.c_license.patch new file mode 100644 index 0000000..eab05d7 --- /dev/null +++ b/SOURCES/007-mt19937db.c_license.patch @@ -0,0 +1,49 @@ +Description: mt19937db.c license should include the GPL + This file is distributed from upstream Berkeley DB under the Artistic + License (no version specified), althouth it was later released by the + original author under both GPL2+ and BSD. + . + References: + http://web.archive.org/web/20010806225716/http://www.math.keio.ac.jp/matumoto/mt19937int.c + http://web.archive.org/web/20130127064020/http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c + https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=886838 + https://lists.nongnu.org/archive/html/gnu-linux-libre/2010-05/msg00000.html + . +Author: Ruben Rodriguez + + +--- db-5.3.21/src/crypto/mersenne/mt19937db.c.licensefix ++++ db-5.3.21/src/crypto/mersenne/mt19937db.c +@@ -16,16 +16,27 @@ + /* Coded by Takuji Nishimura, considering the suggestions by */ + /* Topher Cooper and Marc Rieffel in July-Aug. 1997. */ + +-/* This library is free software under the Artistic license: */ +-/* see the file COPYING distributed together with this code. */ +-/* For the verification of the code, its output sequence file */ +-/* mt19937int.out is attached (2001/4/2) */ +- + /* Copyright (C) 1997, 1999 Makoto Matsumoto and Takuji Nishimura. */ + /* Any feedback is very welcome. For any question, comments, */ + /* see http://www.math.keio.ac.jp/matumoto/emt.html or email */ + /* matumoto@math.keio.ac.jp */ + ++/* This library is free software; you can redistribute it and/or */ ++/* modify it under the terms of the GNU Library General Public */ ++/* License as published by the Free Software Foundation; either */ ++/* version 2 of the License, or (at your option) any later */ ++/* version. */ ++/* This library is distributed in the hope that it will be useful, */ ++/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ ++/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ ++/* See the GNU Library General Public License for more details. */ ++/* You should have received a copy of the GNU Library General */ ++/* Public License along with this library; if not, write to the */ ++/* Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ ++/* 02111-1307 USA */ ++ ++/* This library is free software under the Artistic license: */ ++ + /* REFERENCE */ + /* M. Matsumoto and T. Nishimura, */ + /* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform */ diff --git a/SOURCES/db-1.85-errno.patch b/SOURCES/db-1.85-errno.patch new file mode 100644 index 0000000..ccc9ddf --- /dev/null +++ b/SOURCES/db-1.85-errno.patch @@ -0,0 +1,89 @@ +glibc doesn't like errno as the name of a field. +--- db.1.85/hash/hash.h Mon Feb 18 19:12:14 2002 ++++ db.1.85/hash/hash.h Mon Feb 18 19:12:20 2002 +@@ -103,7 +103,7 @@ + BUFHEAD *cpage; /* Current page */ + int cbucket; /* Current bucket */ + int cndx; /* Index of next item on cpage */ +- int errno; /* Error Number -- for DBM ++ int err; /* Error Number -- for DBM + * compatability */ + int new_file; /* Indicates if fd is backing store + * or no */ +--- db.1.85/hash/hash.c Mon Feb 18 19:12:24 2002 ++++ db.1.85/hash/hash.c Mon Feb 18 19:12:44 2002 +@@ -505,7 +505,7 @@ + else + if (wsize != sizeof(HASHHDR)) { + errno = EFTYPE; +- hashp->errno = errno; ++ hashp->err = errno; + return (-1); + } + for (i = 0; i < NCACHED; i++) +@@ -536,7 +536,7 @@ + + hashp = (HTAB *)dbp->internal; + if (flag) { +- hashp->errno = errno = EINVAL; ++ hashp->err = errno = EINVAL; + return (ERROR); + } + return (hash_access(hashp, HASH_GET, (DBT *)key, data)); +@@ -553,11 +553,11 @@ + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_NOOVERWRITE) { +- hashp->errno = errno = EINVAL; ++ hashp->err = errno = EINVAL; + return (ERROR); + } + if ((hashp->flags & O_ACCMODE) == O_RDONLY) { +- hashp->errno = errno = EPERM; ++ hashp->err = errno = EPERM; + return (ERROR); + } + return (hash_access(hashp, flag == R_NOOVERWRITE ? +@@ -574,11 +574,11 @@ + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_CURSOR) { +- hashp->errno = errno = EINVAL; ++ hashp->err = errno = EINVAL; + return (ERROR); + } + if ((hashp->flags & O_ACCMODE) == O_RDONLY) { +- hashp->errno = errno = EPERM; ++ hashp->err = errno = EPERM; + return (ERROR); + } + return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL)); +@@ -729,7 +729,7 @@ + + hashp = (HTAB *)dbp->internal; + if (flag && flag != R_FIRST && flag != R_NEXT) { +- hashp->errno = errno = EINVAL; ++ hashp->err = errno = EINVAL; + return (ERROR); + } + #ifdef HASH_STATISTICS +--- db.1.85/hash/ndbm.c Mon Feb 18 19:12:58 2002 ++++ db.1.85/hash/ndbm.c Mon Feb 18 19:13:05 2002 +@@ -180,7 +180,7 @@ + HTAB *hp; + + hp = (HTAB *)db->internal; +- return (hp->errno); ++ return (hp->err); + } + + extern int +@@ -190,7 +190,7 @@ + HTAB *hp; + + hp = (HTAB *)db->internal; +- hp->errno = 0; ++ hp->err = 0; + return (0); + } + diff --git a/SOURCES/db-4.5.20-jni-include-dir.patch b/SOURCES/db-4.5.20-jni-include-dir.patch new file mode 100644 index 0000000..b0881c3 --- /dev/null +++ b/SOURCES/db-4.5.20-jni-include-dir.patch @@ -0,0 +1,12 @@ +diff -up db-4.7.25/dist/configure.ac.jni db-4.7.25/dist/configure.ac +--- db-4.7.25/dist/configure.ac.jni 2008-08-20 14:22:59.000000000 +0200 ++++ db-4.7.25/dist/configure.ac 2008-08-20 14:23:39.000000000 +0200 +@@ -418,7 +418,7 @@ if test "$db_cv_java" = "yes"; then + AC_PROG_JAVAC + AC_PROG_JAR + AC_PROG_JAVA +- AC_JNI_INCLUDE_DIR ++ JNI_INCLUDE_DIRS="/usr/lib/jvm/java/include /usr/lib/jvm/java/include/linux" + + AC_MSG_CHECKING(java version) + case "$JAVA" in diff --git a/SOURCES/db-4.6.21-1.85-compat.patch b/SOURCES/db-4.6.21-1.85-compat.patch new file mode 100644 index 0000000..62ae950 --- /dev/null +++ b/SOURCES/db-4.6.21-1.85-compat.patch @@ -0,0 +1,14 @@ +diff -up db-5.1.19/dist/Makefile.in.185compat db-5.1.19/dist/Makefile.in +--- db-5.1.19/dist/Makefile.in.185compat 2010-08-27 17:08:03.000000000 +0200 ++++ db-5.1.19/dist/Makefile.in 2010-09-10 10:02:32.974640425 +0200 +@@ -193,8 +193,8 @@ libtso_major= $(libtcl_base)-$(LIBMAJOR) + # local libraries, for example. Do that by adding -I options to the DB185INC + # line, and -l options to the DB185LIB line. + ################################################## +-DB185INC= -c @CFLAGS@ -I$(topdir) @CPPFLAGS@ +-DB185LIB= ++DB185INC= -c @CFLAGS@ -I$(srcdir) -I$(srcdir)/db.1.85/PORT/linux/include @CPPFLAGS@ ++DB185LIB= ${srcdir}/db.1.85/PORT/linux/libdb.a + + ################################################## + # Performance Event Monitoring definitions diff --git a/SOURCES/libdb-multiarch.patch b/SOURCES/libdb-multiarch.patch new file mode 100644 index 0000000..f0e6ff6 --- /dev/null +++ b/SOURCES/libdb-multiarch.patch @@ -0,0 +1,12 @@ +diff -up db-5.3.15/dist/aclocal/sequence.m4.multiarch db-5.3.15/dist/aclocal/sequence.m4 +--- db-5.3.15/dist/aclocal/sequence.m4.multiarch 2010-06-25 17:50:36.000000000 +0200 ++++ db-5.3.15/dist/aclocal/sequence.m4 2011-12-20 02:00:49.000000000 +0100 +@@ -78,7 +78,7 @@ AC_DEFUN(AM_SEQUENCE_CONFIGURE, [ + fi + if test "$db_cv_build_sequence" = "yes"; then + AC_SUBST(db_seq_decl) +- db_seq_decl="typedef $db_cv_seq_type db_seq_t;"; ++ db_seq_decl="typedef int64_t db_seq_t;"; + + AC_DEFINE(HAVE_64BIT_TYPES) + AH_TEMPLATE(HAVE_64BIT_TYPES, diff --git a/SOURCES/patch.1.1 b/SOURCES/patch.1.1 new file mode 100644 index 0000000..fe3177d --- /dev/null +++ b/SOURCES/patch.1.1 @@ -0,0 +1,20 @@ +*** Makefile.orig Wed Jul 13 21:43:16 1994 +--- Makefile Wed Dec 31 19:00:00 1969 +*************** +*** 15,22 **** + + ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} + rm -f $@ +! ar cq $@ \ +! `lorder ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} | tsort` + ranlib $@ + + clean: +--- 15,21 ---- + + ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} + rm -f $@ +! ar cq $@ ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} + ranlib $@ + + clean: diff --git a/SOURCES/patch.1.2 b/SOURCES/patch.1.2 new file mode 100644 index 0000000..a343909 --- /dev/null +++ b/SOURCES/patch.1.2 @@ -0,0 +1,19 @@ +*** btree/bt_split.c Tue Jul 26 14:22:02 1994 +--- btree/bt_split.c Sat Jan 4 14:38:55 1997 +*************** +*** 673,679 **** + * where we decide to try and copy too much onto the left page. + * Make sure that doesn't happen. + */ +! if (skip <= off && used + nbytes >= full) { + --off; + break; + } +--- 673,679 ---- + * where we decide to try and copy too much onto the left page. + * Make sure that doesn't happen. + */ +! if (skip <= off && used + nbytes >= full || nxt == top - 1) { + --off; + break; + } diff --git a/SOURCES/patch.1.3 b/SOURCES/patch.1.3 new file mode 100644 index 0000000..5ca03df --- /dev/null +++ b/SOURCES/patch.1.3 @@ -0,0 +1,37 @@ +*** btree/bt_split.c.orig Sat Feb 8 10:14:10 1997 +--- btree/bt_split.c Sat Feb 8 10:14:51 1997 +*************** +*** 673,679 **** + * where we decide to try and copy too much onto the left page. + * Make sure that doesn't happen. + */ +! if (skip <= off && used + nbytes >= full || nxt == top - 1) { + --off; + break; + } +--- 673,680 ---- + * where we decide to try and copy too much onto the left page. + * Make sure that doesn't happen. + */ +! if (skip <= off && +! used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) { + --off; + break; + } +*************** +*** 686,692 **** + memmove((char *)l + l->upper, src, nbytes); + } + +! used += nbytes; + if (used >= half) { + if (!isbigkey || bigkeycnt == 3) + break; +--- 687,693 ---- + memmove((char *)l + l->upper, src, nbytes); + } + +! used += nbytes + sizeof(indx_t); + if (used >= half) { + if (!isbigkey || bigkeycnt == 3) + break; diff --git a/SOURCES/patch.1.4 b/SOURCES/patch.1.4 new file mode 100644 index 0000000..cec5fbc --- /dev/null +++ b/SOURCES/patch.1.4 @@ -0,0 +1,22 @@ +*** btree/bt_page.c.orig Wed Jul 13 21:29:02 1994 +--- btree/bt_page.c Wed Jun 11 20:14:43 1997 +*************** +*** 65,70 **** +--- 65,71 ---- + h->prevpg = P_INVALID; + h->nextpg = t->bt_free; + t->bt_free = h->pgno; ++ F_SET(t, B_METADIRTY); + + /* Make sure the page gets written back. */ + return (mpool_put(t->bt_mp, h, MPOOL_DIRTY)); +*************** +*** 92,97 **** +--- 93,99 ---- + (h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) { + *npg = t->bt_free; + t->bt_free = h->nextpg; ++ F_SET(t, B_METADIRTY); + return (h); + } + return (mpool_new(t->bt_mp, npg)); diff --git a/SOURCES/signed-overflow.patch b/SOURCES/signed-overflow.patch new file mode 100644 index 0000000..1c204ba --- /dev/null +++ b/SOURCES/signed-overflow.patch @@ -0,0 +1,25 @@ +diff -up db-5.3.21/lang/sql/generated/sqlite3.c.broken db-5.3.21/lang/sql/generated/sqlite3.c +--- db-5.3.21/lang/sql/generated/sqlite3.c.broken 2013-11-05 15:47:30.503756426 +0100 ++++ db-5.3.21/lang/sql/generated/sqlite3.c 2013-11-05 15:48:11.105888357 +0100 +@@ -8230,7 +8230,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdb + SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int); + SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp); + SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1); +-SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); ++SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2); + SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3); + SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5); + SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr); +@@ -48686,10 +48686,9 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP1( + ** Change the value of the P2 operand for a specific instruction. + ** This routine is useful for setting a jump destination. + */ +-SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){ ++SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){ + assert( p!=0 ); +- assert( addr>=0 ); +- if( p->nOp>addr ){ ++ if( ((u32)p->nOp)>addr ){ + p->aOp[addr].p2 = val; + } + } diff --git a/SPECS/libdb.spec b/SPECS/libdb.spec new file mode 100644 index 0000000..4a720a3 --- /dev/null +++ b/SPECS/libdb.spec @@ -0,0 +1,536 @@ +%define __soversion_major 5 +%define __soversion %{__soversion_major}.3 + +Summary: The Berkeley DB database library for C +Name: libdb +Version: 5.3.21 +Release: 14%{?dist} +Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz +Source1: http://download.oracle.com/berkeley-db/db.1.85.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 +Patch11: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.2 +Patch12: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3 +Patch13: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4 +# other patches +Patch20: db-1.85-errno.patch +Patch22: db-4.6.21-1.85-compat.patch +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 +# sqlite3 overflow fix backport +Patch26: signed-overflow.patch +URL: http://www.oracle.com/database/berkeley-db/ +License: BSD and LGPLv2 and Sleepycat +Group: System Environment/Libraries +BuildRequires: perl libtool +BuildRequires: tcl-devel >= 8.5.2-3 +BuildRequires: java-devel >= 1:1.6.0 +BuildRequires: chrpath +Conflicts: filesystem < 3 + +%description +The Berkeley Database (Berkeley DB) is a programmatic toolkit that +provides embedded database support for both traditional and +client/server applications. The Berkeley DB includes B+tree, Extended +Linear Hashing, Fixed and Variable-length record access methods, +transactions, locking, logging, shared memory caching, and database +recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is +used by many applications, including Python and Perl, so this should +be installed on all systems. + +%package utils +Summary: Command line tools for managing Berkeley DB databases +Group: Applications/Databases +Requires: %{name}%{?_isa} = %{version}-%{release} + +%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. + +%package devel +Summary: C development files for the Berkeley DB library +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description 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 header files, +libraries, and documentation for building programs which use the +Berkeley DB. + +%package devel-doc +Summary: C development documentation files for the Berkeley DB library +Group: Documentation +Requires: %{name} = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} +BuildArch: noarch + +%description devel-doc +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 header files, +libraries, and documentation for building programs which use the +Berkeley DB. + +%package devel-static +Summary: Berkeley DB static libraries +Group: Development/Libraries +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description devel-static +The Berkeley Database (Berkeley DB) is a programmatic toolkit that +provides embedded database support for both traditional and +client/server applications. This package contains static libraries +needed for applications that require static linking of +Berkeley DB. + +%package cxx +Summary: The Berkeley DB database library for C++ +Group: System Environment/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description cxx +The Berkeley Database (Berkeley DB) is a programmatic toolkit that +provides embedded database support for both traditional and +client/server applications. The Berkeley DB includes B+tree, Extended +Linear Hashing, Fixed and Variable-length record access methods, +transactions, locking, logging, shared memory caching, and database +recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is +used by many applications, including Python and Perl, so this should +be installed on all systems. + +%package cxx-devel +Summary: The Berkeley DB database library for C++ +Group: System Environment/Libraries +Requires: %{name}-cxx%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description cxx-devel +The Berkeley Database (Berkeley DB) is a programmatic toolkit that +provides embedded database support for both traditional and +client/server applications. The Berkeley DB includes B+tree, Extended +Linear Hashing, Fixed and Variable-length record access methods, +transactions, locking, logging, shared memory caching, and database +recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is +used by many applications, including Python and Perl, so this should +be installed on all systems. + +%package tcl +Summary: Development files for using the Berkeley DB with tcl +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tcl +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 Tcl. + +%package tcl-devel +Summary: Development files for using the Berkeley DB with tcl +Group: Development/Libraries +Requires: %{name}-tcl%{?_isa} = %{version}-%{release} + +%description tcl-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 Tcl. + +%package sql +Summary: Development files for using the Berkeley DB with sql +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description sql +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 sql-devel +Summary: Development files for using the Berkeley DB with sql +Group: Development/Libraries +Requires: %{name}-sql%{?_isa} = %{version}-%{release} + +%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 java +Summary: Development files for using the Berkeley DB with Java +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description java +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 Java. + +%package java-devel +Summary: Development files for using the Berkeley DB with Java +Group: Development/Libraries +Requires: %{name}-java%{?_isa} = %{version}-%{release} + +%description java-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 Java. + +%prep +%setup -q -n db-%{version} -a 1 + +%patch0 -p1 -b .multiarch +pushd db.1.85/PORT/linux +%patch10 -p0 -b .1.1 +popd +pushd db.1.85 +%patch11 -p0 -b .1.2 +%patch12 -p0 -b .1.3 +%patch13 -p0 -b .1.4 +%patch20 -p1 -b .errno +popd + +%patch22 -p1 -b .185compat +%patch24 -p1 -b .4.5.20.jni +%patch25 -p1 -b .licensefix + +%patch26 -p1 -b .overflow + +cd dist +./s_config + +%build +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +CFLAGS="$CFLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -I../../../lang/sql/sqlite/ext/fts3/" +export CFLAGS + +# Build the old db-185 libraries. +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=LD --mode=link %{__cc} -o dist/dist-tls/db_dump185 dist/dist-tls/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a + +# update gnu-config files for aarch64 +cp /usr/lib/rpm/redhat/config.guess dist +cp /usr/lib/rpm/redhat/config.sub dist +cp /usr/lib/rpm/redhat/config.guess lang/sql/sqlite +cp /usr/lib/rpm/redhat/config.sub lang/sql/sqlite +cp /usr/lib/rpm/redhat/config.guess lang/sql/jdbc +cp /usr/lib/rpm/redhat/config.sub lang/sql/jdbc +cp /usr/lib/rpm/redhat/config.guess lang/sql/odbc +cp /usr/lib/rpm/redhat/config.sub lang/sql/odbc + +pushd dist/dist-tls +ln -sf ../configure . +%configure -C \ + --enable-compat185 --enable-dump185 \ + --enable-shared --enable-static \ + --enable-tcl --with-tcl=%{_libdir} \ + --enable-cxx --enable-sql \ + --enable-java \ + --enable-test \ + --disable-rpath \ + --with-tcl=%{_libdir}/tcl8.5 + +# Remove libtool predep_objects and postdep_objects wonkiness so that +# building without -nostdlib doesn't include them twice. Because we +# already link with g++, weird stuff happens if you don't let the +# compiler handle this. +perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool +perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool +perl -pi -e 's/-shared -nostdlib/-shared/' libtool + +make %{?_smp_mflags} + +# XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai +LDBJ=./.libs/libdb_java-%{__soversion}.la +if test -f ${LDBJ} -a ! -f ${LDBJ}i; then + sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i +fi +popd + +%install +rm -rf ${RPM_BUILD_ROOT} +mkdir -p ${RPM_BUILD_ROOT}%{_includedir} +mkdir -p ${RPM_BUILD_ROOT}%{_libdir} + +# Force off stripping of installed binaries +%makeinstall STRIP=/bin/true -C dist/dist-tls + +# XXX Nuke non-versioned archives and symlinks +rm -f ${RPM_BUILD_ROOT}%{_libdir}/{libdb.a,libdb_cxx.a,libdb_tcl.a,libdb_sql.a} + +chmod +x ${RPM_BUILD_ROOT}%{_libdir}/*.so* + +# Move the header files to a subdirectory, in case we're deploying on a +# system with multiple versions of DB installed. +mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name} +mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ + +# Create symlinks to includes so that "use and link with -ldb" works. +for i in db.h db_cxx.h db_185.h; do + ln -s %{name}/$i ${RPM_BUILD_ROOT}%{_includedir} +done + +# Move java jar file to the correct place +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java +mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java + +# Eliminate installed doco +rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs + +# XXX Avoid Permission denied. strip when building as non-root. +chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/* + +# remove unneeded .la files (#225675) +rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la + +# remove RPATHs +chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/* + +# unify documentation and examples, remove stuff we don't need +rm -rf docs/csharp +rm -rf examples/csharp +rm -rf docs/installation +mv examples docs + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post -p /sbin/ldconfig cxx + +%postun -p /sbin/ldconfig cxx + +%post -p /sbin/ldconfig sql + +%postun -p /sbin/ldconfig sql + +%post -p /sbin/ldconfig tcl + +%postun -p /sbin/ldconfig tcl + +%post -p /sbin/ldconfig java + +%postun -p /sbin/ldconfig java + +%files +%defattr(-,root,root,-) +%doc LICENSE README +%{_libdir}/libdb-%{__soversion}.so +%{_libdir}/libdb-%{__soversion_major}.so + +%files devel +%defattr(-,root,root,-) +%{_libdir}/libdb.so +%dir %{_includedir}/%{name} +%{_includedir}/%{name}/db.h +%{_includedir}/%{name}/db_185.h +%{_includedir}/db.h +%{_includedir}/db_185.h + +%files devel-doc +%defattr(-,root,root,-) +%doc docs/* + +%files devel-static +%defattr(-,root,root,-) +%{_libdir}/libdb-%{__soversion}.a +%{_libdir}/libdb_cxx-%{__soversion}.a +%{_libdir}/libdb_tcl-%{__soversion}.a +%{_libdir}/libdb_sql-%{__soversion}.a +%{_libdir}/libdb_java-%{__soversion}.a + +%files utils +%defattr(-,root,root,-) +%{_bindir}/db*_archive +%{_bindir}/db*_checkpoint +%{_bindir}/db*_deadlock +%{_bindir}/db*_dump* +%{_bindir}/db*_hotbackup +%{_bindir}/db*_load +%{_bindir}/db*_printlog +%{_bindir}/db*_recover +%{_bindir}/db*_replicate +%{_bindir}/db*_stat +%{_bindir}/db*_upgrade +%{_bindir}/db*_verify +%{_bindir}/db*_tuner + +%files cxx +%defattr(-,root,root,-) +%{_libdir}/libdb_cxx-%{__soversion}.so +%{_libdir}/libdb_cxx-%{__soversion_major}.so + +%files cxx-devel +%defattr(-,root,root,-) +%{_includedir}/%{name}/db_cxx.h +%{_includedir}/db_cxx.h +%{_libdir}/libdb_cxx.so + +%files tcl +%defattr(-,root,root,-) +%{_libdir}/libdb_tcl-%{__soversion}.so +%{_libdir}/libdb_tcl-%{__soversion_major}.so + +%files tcl-devel +%defattr(-,root,root,-) +%{_libdir}/libdb_tcl.so + +%files sql +%defattr(-,root,root,-) +%{_libdir}/libdb_sql-%{__soversion}.so +%{_libdir}/libdb_sql-%{__soversion_major}.so + +%files sql-devel +%defattr(-,root,root,-) +%{_bindir}/dbsql +%{_libdir}/libdb_sql.so +%{_includedir}/%{name}/dbsql.h + +%files java +%defattr(-,root,root,-) +%{_libdir}/libdb_java-%{__soversion_major}*.so +%{_datadir}/java/*.jar + +%files java-devel +%defattr(-,root,root,-) +%{_libdir}/libdb_java.so + +%changelog +* Tue Nov 05 2013 Jan Stanek - 5.3.21-14 +- Backported fix for possible signed overflow (#1026878) + +* Tue Nov 05 2013 Jan Stanek - 5.3.21-13 +- Updated config files for the aarch64 (#1023795) + +* Wed Oct 23 2013 Jan Stanek - 5.3.21-12 +- Added Sleepycat to the license list + +* Thu May 16 2013 Jan Stanek - 5.3.21-11 +- Fix missing debuginfo issue for utils subpackage + +* Thu May 9 2013 Tom Callaway - 5.3.21-10 +- add license clarification fix + +* Wed Apr 03 2013 Jan Stanek 5.3.21-9 +- Added sqlite compability CFLAGS (#788496) + +* Wed Mar 27 2013 Jan Stanek 5.3.21-8 +- Cleaning the specfile - removed gcc-java dependecy other way + +* Wed Mar 27 2013 Jan Stanek 5.3.21-7 +- Removed dependency on obsolete gcc-java package (#927742) + +* Thu Mar 7 2013 Jindrich Novy 5.3.21-6 +- add LGPLv2+ and remove Sleepycat in license tag (#886838) + +* Thu Feb 14 2013 Fedora Release Engineering - 5.3.21-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 27 2012 Tom Callaway - 5.3.21-4 +- fix license tag + +* Thu Jul 19 2012 Fedora Release Engineering - 5.3.21-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jul 14 2012 Peter Robinson - 5.3.21-2 +- Specify tag for libtool (fixes FTBFS # 838334 ) + +* Thu Jul 5 2012 Jindrich Novy 5.3.21-1 +- update to 5.3.21 +http://download.oracle.com/otndocs/products/berkeleydb/html/changelog_5_3.html + +* Tue Jul 3 2012 Jindrich Novy 5.3.15-5 +- move C++ header files to cxx-devel + +* Tue Jul 3 2012 Jindrich Novy 5.3.15-4 +- fix -devel packages dependencies yet more (#832225) + +* Sun May 6 2012 Jindrich Novy 5.3.15-3 +- package -devel packages correctly + +* Sat Apr 21 2012 Jindrich Novy 5.3.15-2 +- fix multiarch conflict in libdb-devel (#812901) +- remove unneeded dos2unix BR + +* Thu Mar 15 2012 Jindrich Novy 5.3.15-1 +- update to 5.3.15 + http://download.oracle.com/otndocs/products/berkeleydb/html/changelog_5_3.html + +* Fri Feb 17 2012 Deepak Bhole 5.2.36-5 +- Resolves rhbz#794472 +- Patch from Omair Majid to remove explicit Java 6 req. + +* Wed Jan 25 2012 Harald Hoyer 5.2.36-4 +- add filesystem guard + +* Wed Jan 25 2012 Harald Hoyer 5.2.36-3 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Jan 13 2012 Fedora Release Engineering - 5.2.36-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Jun 15 2011 Jindrich Novy 5.2.36-1 +- update to 5.2.36, + http://download.oracle.com/otndocs/products/berkeleydb/html/changelog_5_2.html#id3647664 + +* Wed Jun 15 2011 Jindrich Novy 5.2.28-2 +- move development documentation to devel-doc subpackage (#705386) + +* Tue Jun 14 2011 Jindrich Novy 5.2.28-1 +- update to 5.2.28 + +* Mon Feb 07 2011 Fedora Release Engineering - 5.1.25-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Feb 3 2011 Jindrich Novy 5.1.25-1 +- update to 5.1.25 + +* Wed Sep 29 2010 jkeating - 5.1.19-2 +- Rebuilt for gcc bug 634757 + +* Fri Sep 10 2010 Jindrich Novy 5.1.19-1 +- update to 5.1.19 +- rename -devel-static to -static subpackage (#617800) +- build java on all arches + +* Wed Jul 7 2010 Jindrich Novy 5.0.26-1 +- update to 5.0.26 +- drop BR: ed + +* Thu Jun 17 2010 Jindrich Novy 5.0.21-2 +- add Requires: libdb-cxx to libdb-devel + +* Wed Apr 21 2010 Jindrich Novy 5.0.21-1 +- initial build + +* Thu Apr 15 2010 Jindrich Novy 5.0.21-0.2 +- remove C# documentation +- disable/remove rpath +- fix description +- tighten dependencies +- run ldconfig for cxx and sql subpackages + +* Fri Apr 9 2010 Jindrich Novy 5.0.21-0.1 +- enable sql +- package 5.0.21