%global __soversion_major 4 %global __soversion %{__soversion_major}.8 Summary: The Berkeley DB database library (version 4) for C Name: libdb4 Version: 4.8.30 Release: 1%{?dist} URL: http://www.oracle.com/database/berkeley-db/ License: Sleepycat and BSD Source0: %{name}-%{version}.tar.gz BuildRequires: gcc gcc-c++ BuildRequires: chrpath BuildRequires: ed BuildRequires: java-devel >= 1:1.6.0 BuildRequires: libtool BuildRequires: perl-interpreter BuildRequires: perl-Carp BuildRequires: tcl-devel >= 8.6.1 BuildRequires: util-linux-ng Conflicts: filesystem < 3 Obsoletes: db4 < 5.0.0 Provides: db4 = %{version} %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 devel Summary: C development files for the Berkeley DB (version 4) library Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: db4-devel < 5.0.0 Provides: db4-devel = %{version} %description devel This package contains the header files and libraries for building C programs which use the Berkeley DB. %package cxx Summary: The Berkeley DB database library (version 4) for C++ Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: db4-cxx < 5.0.0 Provides: db4-cxx = %{version} %description cxx This package contains the C++ version of the Berkeley DB library (v4). %package cxx-devel Summary: C++ development files for the Berkeley DB database library (version 4) Requires: %{name}-cxx%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} Obsoletes: db4-cxx-devel < 5.0.0 Provides: db4-cxx-devel = %{version} %description cxx-devel This package contains the header files and libraries for building C++ programs which use the Berkeley DB. %prep %autosetup -n %{name}-%{version} sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c %build pushd build_unix ../dist/configure --host=%{_host} --build=%{_build} \\\ --program-prefix=%{?_program_prefix} \\\ --disable-dependency-tracking \\\ --prefix=%{_prefix} \\\ --exec-prefix=%{_exec_prefix} \\\ --bindir=%{_bindir} \\\ --sbindir=%{_sbindir} \\\ --sysconfdir=%{_sysconfdir} \\\ --datadir=%{_datadir} \\\ --includedir=%{_includedir} \\\ --libdir=%{_libdir} \\\ --libexecdir=%{_libexecdir} \\\ --localstatedir=%{_localstatedir} \\\ --sharedstatedir=%{_sharedstatedir} \\\ --mandir=%{_mandir} \\\ --infodir=%{_infodir} \\\ --enable-cxx --disable-replication --enable-debug %make_build %install pushd build_unix # install library and include files only %{__make} install_lib install_include DESTDIR=%{?buildroot} INSTALL="%{__install} -p" # remove unnecessary .a and .la files rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.a rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la %ldconfig_scriptlets %files %license LICENSE %doc README %{_libdir}/libdb-%{__soversion}.so %{_libdir}/libdb-%{__soversion_major}.so %files devel %{_libdir}/libdb.so %{_includedir}/db.h %files cxx %{_libdir}/libdb_cxx-%{__soversion}.so %{_libdir}/libdb_cxx-%{__soversion_major}.so %files cxx-devel %{_includedir}/db_cxx.h %{_libdir}/libdb_cxx.so %changelog