db53/db53.spec

435 lines
16 KiB
RPMSpec
Raw Normal View History

%define majver %(echo %version | cut -d . -f1-2)
%define MAJver %(echo %version | cut -d . -f1)
%define majvershort %(echo %version | cut -d . -f1-2 | tr -d .)
Name: db53
Version: 5.3.28
Release: 2mamba
Summary: The Berkeley DB database library
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.oracle.com/database/technologies/related/berkeleydb-downloads.html
Source: 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
# Patches from Fedora https://src.fedoraproject.org/rpms/libdb/
#Source3: libdb-5.3.28-manpages.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
#Adds missing constant to Optcodes.java and changes ClassReader.java to use it. This makes package to build with Java 8.
Patch26: java8-fix.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
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
%if "%{stage1}" != "1"
BuildRequires: javapackages
%endif
BuildRequires: sharutils
BuildRequires: libtcl-devel >= 8.6.9-2mamba
%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 -n libdb53
Summary: The Berkeley DB database library
Group: System/Libraries
Obsoletes: libdb53-java <= 5.3.28-1mamba
%ifarch x86_64 aarch64
Provides: libdb-5.3.so(DB5_3)(64bit)
%else
Provides: libdb-5.3.so(DB5_3)
%endif
%description -n libdb53
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 -n libdb53-cxx
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n libdb53-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 -n libdb53-tcl
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n libdb53-tcl
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 -n libdb53-sql
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n libdb53-sql
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 -n db53-tools
Summary: Tools for the managing Berkeley DB
Group: System/Libraries
Requires: libdb53 = %{version}-%{release}
%description -n db53-tools
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 tools for managing Berkeley DB.
%package -n libdb53-devel
Summary: Development files for the Berkeley DB library.
Group: Development/Libraries
Requires: libdb53 = %{version}-%{release}
Requires: libdb53-cxx = %{version}-%{release}
Requires: libdb53-tcl = %{version}-%{release}
Requires: libdb53-sql = %{version}-%{release}
Obsoletes: libdb53-java-devel <= 5.3.28-1mamba
Provides: libdb53-static
Obsoletes: libdb53-static <= 5.3.28-1mamba
%description -n libdb53-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.
%debug_package
%prep
%setup -q -n db-%{version} -a1
#-D -T
#:<< _EOF
cp %{SOURCE2} .
#tar -xf %{SOURCE3}
%patch 0 -p1
pushd db.1.85/PORT/linux
%patch 10 -p0
popd
pushd db.1.85
%patch 11 -p0
%patch 12 -p0
%patch 13 -p0
%patch 20 -p1
popd
%patch 22 -p1
%patch 24 -p1
%patch 25 -p1
%patch 26 -p1
%patch 27 -p1
%patch 28 -p1
%patch 29 -p1
%patch 30 -p1
%patch 31 -p1
%patch 32 -p1
%patch 33 -p1
%patch 34 -p1
%patch 35 -p1
%patch 36 -p1
%patch 37 -p1
%patch 38 -p1
%patch 39 -p1
# Update config files to understand aarch64
for dir in dist lang/sql/sqlite lang/sql/jdbc lang/sql/odbc; do
sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," $dir/config.{sub,guess}
done
%build
#:<< _EOF
CFLAGS="%{optflags} -fno-strict-aliasing"
CFLAGS="$CFLAGS -DSHAREDSTATEDIR='\"%{_sharedstatedir}\"' -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
pushd dist/dist-tls
ln -s ../configure .
%configure -C \
--enable-compat185 \
--enable-dump185 \
--enable-shared \
--enable-static \
--enable-tcl \
--with-tcl=%{_libdir} \
--enable-cxx \
--enable-sql \
--enable-test \
--disable-rpath \
--program-suffix=-53 \
--with-tcl=%{_prefix}/lib/tcl8.6
# --enable-java \
# 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
# 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
# Run some quick subsystem checks
echo "source ../../test/tcl/test.tcl; r env; r mut; r memp" | tclsh
popd
%install
%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 <db.h> 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
#mv man/* ${RPM_BUILD_ROOT}%{_mandir}/man1
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n libdb53 -p /sbin/ldconfig
%postun -n libdb53 -p /sbin/ldconfig
%post -n libdb53-cxx -p /sbin/ldconfig
%postun -n libdb53-cxx -p /sbin/ldconfig
%post -n libdb53-tcl -p /sbin/ldconfig
%postun -n libdb53-tcl -p /sbin/ldconfig
%post -n libdb53-sql -p /sbin/ldconfig
%postun -n libdb53-sql -p /sbin/ldconfig
%files -n libdb53
%defattr(-,root,root)
%{_libdir}/libdb-%{MAJver}.so
%{_libdir}/libdb-%{majver}.so
%files -n libdb53-cxx
%defattr(-,root,root)
%{_libdir}/libdb_cxx-%{MAJver}.so
%{_libdir}/libdb_cxx-%{majver}.so
%files -n libdb53-tcl
%defattr(-,root,root)
%{_libdir}/libdb_tcl-%{MAJver}.so
%{_libdir}/libdb_tcl-%{majver}.so
%files -n libdb53-sql
%defattr(-,root,root)
%{_libdir}/libdb_sql-%{MAJver}.so
%{_libdir}/libdb_sql-%{majver}.so
%files -n db53-tools
%defattr(-,root,root)
%{_bindir}/*
%files -n libdb53-devel
%defattr(-,root,root)
%dir %{_includedir}/db53
%{_includedir}/db53/*
%{_includedir}/db.h
%{_includedir}/db_185.h
%{_includedir}/db_cxx.h
%{_libdir}/*.a
%{_libdir}/libdb.so
%{_libdir}/libdb_cxx.so
%{_libdir}/libdb_sql.so
%{_libdir}/libdb_tcl.so
%doc docs examples
#%{_docdir}/libdb4-%{version}/*
%changelog
* Tue Oct 10 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 5.3.28-2mamba
- provide libdb-5.3.so(DB5_3)(64bit) for mailspring-bin, remove -java and -static subpackages
* Sat Jun 22 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 5.3.28-1mamba
- update to 5.3.28
* Tue May 28 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 5.3.21-1mamba
- update to 5.3.21
* Tue Sep 20 2011 Automatic Build System <autodist@mambasoft.it> 5.2.36-1mamba
- automatic version update by autodist
* Wed Aug 31 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2.28-2mamba
- renamed from db51 to db52 using --program-suffix=-52 to keep 5.1 still the default
* Tue Jun 14 2011 Automatic Build System <autodist@mambasoft.it> 5.2.28-1mamba
- automatic update by autodist
* Sat Mar 19 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.25-3mamba
- add libdb.so and libdb_cxx.so symlinks
* Mon Mar 07 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.25-2mamba
- make this the system default Berkeley DB
* Thu Feb 03 2011 Automatic Build System <autodist@mambasoft.it> 5.1.25-1mamba
- automatic update by autodist
* Fri Sep 10 2010 Automatic Build System <autodist@mambasoft.it> 5.1.19-1mamba
- automatic update to 5.1.19 by autodist
* Fri Jul 02 2010 Automatic Build System <autodist@mambasoft.it> 5.0.26-1mamba
- automatic update to 5.0.26 by autodist
* Sat May 22 2010 Automatic Build System <autodist@mambasoft.it> 5.0.21-1mamba
- automatic update to 5.0.21 by autodist
* Thu Dec 31 2009 Automatic Build System <autodist@mambasoft.it> 4.8.26-1mamba
- automatic update to 4.8.26 by autodist
* Fri Sep 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.24-1mamba
- update to 4.8.24
* Thu Jul 03 2008 gil <puntogil@libero.it> 4.7.25-1mamba
- update to version 4.7.25
- removed patches
* Wed Jun 04 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-8mamba
- specfile updated
* Thu Jul 13 2006 Davide Madrisan <davide.madrisan@qilinux.it> 4.2.52-7qilnx
- fixed openldap warning: "BerkeleyDB 4.2.52 library needs TXN patch!"
- official patches applied
- fixed permissions of binary files
* Wed Oct 26 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-6qilnx
- add OpenOffice patch
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-5qilnx
- do not link against libpthread
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-4qilnx
- rebuild with gcj
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-3qilnx
- rebuilt with java bindings
* Tue Jul 27 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.25-8qilnx
- new version build
- source RPM renamed to db42 (should cohexist with libdb4)
* Sun May 09 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-8qilnx
- added libdb.so provides
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-7qilnx
- fixed symlinks for compatibility
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-6qilnx
- rebuild with --enable-compat185
* Mon Sep 15 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-5qilnx
- Added symlink /usr/include/db.h so that db4 is system default version
* Tue Sep 09 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-4qilnx
- Moved includes to /usr/include/db4 for devel packages co-existence
* Fri Jul 25 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-3qilnx
- Removed compat185 (it looks broken, I'll try to use db2's compat185)
* Thu Jul 24 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-2qilnx
- Enabled compatibiliy with version 185
* Tue Apr 22 2003 Luca Tinelli <luca.tinelli@qinet.it> 4.1.25-1qilnx
- Creation of db4 package