#
# Conditional build:
-%bcond_without java # don't build java bindings
+%bcond_without apidocs # do not build and package API docs
+%bcond_without java # don't build Java bindings
%bcond_without tcl # don't build Tcl bindings
%bcond_without static_libs # don't build static libraries
+%bcond_without default_db # don't use this db as default system db [Th uses DB 4.7]
-%if "%{pld_release}" == "ti"
-%bcond_without java_sun # build with gcj
-%else
-%bcond_with java_sun # build with java-sun
-%endif
-
-%include /usr/lib/rpm/macros.java
+%{?with_java:%include /usr/lib/rpm/macros.java}
%define libver 4.7
-%define ver %{libver}.25
+%define ver %{libver}.25
%define patchlevel 4
Summary: Berkeley DB database library for C
Summary(pl.UTF-8): Biblioteka C do obsługi baz Berkeley DB
Name: db4.7
Version: %{ver}.%{patchlevel}
-Release: 5
+Release: 7
Epoch: 0
License: GPL-like (see LICENSE)
Group: Libraries
+#Source0Download: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
Source0: http://download.oracle.com/berkeley-db/db-%{ver}.tar.gz
# Source0-md5: ec2b87e833779681a0c3a814aa71359e
-%patchset_source -f http://www.oracle.com/technology/products/berkeley-db/db/update/%{ver}/patch.%{ver}.%g 1 %{patchlevel}
-URL: http://www.oracle.com/technology/products/berkeley-db/index.html
+%patchset_source -f http://download.oracle.com/berkeley-db/patches/db/%{ver}/patch.%{ver}.%g 1 %{patchlevel}
+URL: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html
BuildRequires: automake
BuildRequires: ed
%if %{with java}
-%{!?with_java_sun:BuildRequires: java-gcj-compat-devel}
-%{?with_java_sun:BuildRequires: java-sun}
-BuildRequires: rpm >= 4.4.9-56
+BuildRequires: jdk
BuildRequires: rpm-javaprov
%endif
BuildRequires: libstdc++-devel
BuildRequires: sed >= 4.0
%{?with_tcl:BuildRequires: tcl-devel >= 8.4.0}
Requires: uname(release) >= 2.6.0
+%if %{with default_db}
Provides: db = %{version}-%{release}
Provides: db = %{libver}
Obsoletes: db4
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%if %{without default_db}
+%define _includedir %{_prefix}/include/db%{libver}
+%endif
+
%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
Summary(pl.UTF-8): Pliki nagłówkowe do biblioteki Berkeley Database
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-devel = %{version}-%{release}
Obsoletes: db3-devel
Obsoletes: db4-devel
-Obsoletes: db4.5-devel
-Obsoletes: db4.6-devel
+%endif
%description devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
Summary(pl.UTF-8): Statyczne biblioteki Berkeley Database
Group: Development/Libraries
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-static = %{version}-%{release}
Obsoletes: db3-static
Obsoletes: db4-static
-Obsoletes: db4.5-static
-Obsoletes: db4.6-static
+%endif
%description static
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
Ten pakiet zawiera statyczne biblioteki do budowania programów
używających Berkeley DB.
+%package apidocs
+Summary: Berkeley database library API documentation
+Summary(pl.UTF-8): Dokumentacja API biblioteki baz danych Berkeley
+Group: Documentation
+
+%description apidocs
+API and internal documentation for Berkeley database library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API i wewnętrzna do biblioteki baz danych Berkeley.
+
%package cxx
Summary: Berkeley database library for C++
Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla C++
Group: Libraries
+%if %{with default_db}
Provides: db-cxx = %{version}-%{release}
Obsoletes: db4-cxx
+%endif
%description cxx
Berkeley database library for C++.
Group: Development/Libraries
Requires: %{name}-cxx = %{epoch}:%{version}-%{release}
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-cxx-devel = %{version}-%{release}
+%endif
Conflicts: db-devel < 4.1.25-3
%description cxx-devel
Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
Group: Development/Libraries
Requires: %{name}-cxx-devel = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-cxx-static = %{version}-%{release}
+%endif
Conflicts: db-static < 4.2.50-1
%description cxx-static
Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
Group: Libraries
Requires: jpackage-utils
+%if %{with default_db}
Provides: db-java = %{version}-%{release}
+%endif
%description java
Berkeley database library for Java.
Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
Group: Development/Languages/Java
Requires: %{name}-java = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-java-devel = %{version}-%{release}
+%endif
Conflicts: db-devel < 4.1.25-3
%description java-devel
Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
Group: Development/Languages/Tcl
Requires: tcl
+%if %{with default_db}
Provides: db-tcl = %{version}-%{release}
Obsoletes: db4-tcl
+%endif
%description tcl
Berkeley database library for Tcl.
Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
Group: Development/Languages/Tcl
Requires: %{name}-tcl = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-tcl-devel = %{version}-%{release}
+%endif
Conflicts: db-devel < 4.1.25-3
%description tcl-devel
Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
Group: Applications/Databases
Requires: %{name} = %{epoch}:%{version}-%{release}
+%if %{with default_db}
Provides: db-utils = %{version}-%{release}
Obsoletes: db3-utils
Obsoletes: db4-utils
+%endif
%description utils
The Berkeley Database (Berkeley DB) is a programmatic toolkit that
%prep
%setup -q -n db-%{ver}
-
# official patches
%patchset_patch 1 %{patchlevel}
CFLAGS="%{rpmcflags}"
CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
LDFLAGS="%{rpmcflags} %{rpmldflags}"
-
export CC CXX CFLAGS CXXFLAGS LDFLAGS
../dist/%configure \
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir},/%{_lib}}
+install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
%if %{with java}
install -d $RPM_BUILD_ROOT%{_javadir}
%endif
%if %{with static_libs}
%{__make} -C build_unix.static library_install \
+ DESTDIR=$RPM_BUILD_ROOT \
docdir=%{_docdir}/db-%{version}-docs \
- DESTDIR=$RPM_BUILD_ROOT
+ includedir=%{_includedir}
%endif
%{__make} -C build_unix library_install \
- docdir=%{_docdir}/db-%{version}-docs \
DESTDIR=$RPM_BUILD_ROOT \
- LIB_INSTALL_FILE_LIST=""
+ LIB_INSTALL_FILE_LIST="" \
+ docdir=%{_docdir}/db-%{version}-docs \
+ includedir=%{_includedir}
+%if %{with default_db}
+install -d $RPM_BUILD_ROOT/%{_lib}
mv $RPM_BUILD_ROOT%{_libdir}/libdb-%{libver}.so $RPM_BUILD_ROOT/%{_lib}
+%endif
cd $RPM_BUILD_ROOT%{_libdir}
+%if %{with static_libs}
+mv -f libdb.a libdb-%{libver}.a
+mv -f libdb_cxx.a libdb_cxx-%{libver}.a
+%endif
+%if %{with java}
+mv -f $RPM_BUILD_ROOT%{_libdir}/*.jar $RPM_BUILD_ROOT%{_javadir}
+%endif
+%if %{with default_db}
ln -sf /%{_lib}/libdb-%{libver}.so libdb.so
ln -sf /%{_lib}/libdb-%{libver}.so libdb4.so
ln -sf /%{_lib}/libdb-%{libver}.so libdb-%{libver}.so
ln -sf libdb-%{libver}.la libdb.la
ln -sf libdb-%{libver}.la libdb4.la
ln -sf libdb-%{libver}.la libndbm.la
+ln -sf libdb_cxx-%{libver}.so libdb_cxx.so
+ln -sf libdb_cxx-%{libver}.la libdb_cxx.la
%if %{with java}
ln -sf libdb_java-%{libver}.la libdb_java.la
-mv -f $RPM_BUILD_ROOT%{_libdir}/*.jar $RPM_BUILD_ROOT%{_javadir}
%endif
%if %{with tcl}
ln -sf libdb_tcl-%{libver}.so libdb_tcl.so
ln -sf libdb_tcl-%{libver}.la libdb_tcl.la
%endif
-ln -sf libdb_cxx-%{libver}.la libdb_cxx.la
%if %{with static_libs}
-mv -f libdb.a libdb-%{libver}.a
ln -sf libdb-%{libver}.a libdb.a
ln -sf libdb-%{libver}.a libdb4.a
ln -sf libdb-%{libver}.a libndbm.a
-mv -f libdb_cxx.a libdb_cxx-%{libver}.a
ln -sf libdb_cxx-%{libver}.a libdb_cxx.a
%endif
-ln -sf libdb_cxx-%{libver}.so libdb_cxx.so
+%endif
sed -i "s/old_library=''/old_library='libdb-%{libver}.a'/" libdb-%{libver}.la
sed -i "s/old_library=''/old_library='libdb_cxx-%{libver}.a'/" libdb_cxx-%{libver}.la
%endif
# in %doc
-rm -f $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/{index.html,license/license_db.html}
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/{index.html,license/license_db.html}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc LICENSE README docs/index.html docs/license
+%if %{with default_db}
%attr(755,root,root) /%{_lib}/libdb-%{libver}.so
+%else
+%attr(755,root,root) %{_libdir}/libdb-%{libver}.so
+%endif
%files devel
%defattr(644,root,root,755)
+%{_libdir}/libdb-%{libver}.la
+%if %{with default_db}
%attr(755,root,root) %{_libdir}/libdb-%{libver}.so
%attr(755,root,root) %{_libdir}/libdb4.so
%attr(755,root,root) %{_libdir}/libdb.so
%attr(755,root,root) %{_libdir}/libndbm.so
-%{_libdir}/libdb-%{libver}.la
%{_libdir}/libdb4.la
%{_libdir}/libdb.la
%{_libdir}/libndbm.la
+%else
+%dir %{_includedir}
+%endif
%{_includedir}/db.h
%{_includedir}/db_185.h
+%{_examplesdir}/db-%{version}
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libdb-%{libver}.a
+%if %{with default_db}
+%{_libdir}/libdb4.a
+%{_libdir}/libdb.a
+%{_libdir}/libndbm.a
+%endif
+%endif
+
+%if %{with apidocs}
+%files apidocs
+%defattr(644,root,root,755)
%dir %{_docdir}/db-%{version}-docs
%{_docdir}/db-%{version}-docs/api_c
%{_docdir}/db-%{version}-docs/articles
%{_docdir}/db-%{version}-docs/images
%{_docdir}/db-%{version}-docs/porting
%{_docdir}/db-%{version}-docs/ref
-%{_examplesdir}/db-%{version}
-
-%if %{with static_libs}
-%files static
-%defattr(644,root,root,755)
-%{_libdir}/libdb-%{libver}.a
-%{_libdir}/libdb4.a
-%{_libdir}/libdb.a
-%{_libdir}/libndbm.a
%endif
%files cxx
%files cxx-devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libdb_cxx.so
%{_libdir}/libdb_cxx-%{libver}.la
+%if %{with default_db}
+%attr(755,root,root) %{_libdir}/libdb_cxx.so
%{_libdir}/libdb_cxx.la
+%endif
%{_includedir}/db_cxx.h
%{_docdir}/db-%{version}-docs/api_cxx
%{_docdir}/db-%{version}-docs/gsg/CXX
%files cxx-static
%defattr(644,root,root,755)
%{_libdir}/libdb_cxx-%{libver}.a
+%if %{with default_db}
%{_libdir}/libdb_cxx.a
%endif
+%endif
%if %{with java}
%files java
%files java-devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libdb_java.so
%{_libdir}/libdb_java-%{libver}.la
+%if %{with default_db}
+%attr(755,root,root) %{_libdir}/libdb_java.so
%{_libdir}/libdb_java.la
+%endif
%{_docdir}/db-%{version}-docs/collections
%{_docdir}/db-%{version}-docs/gsg/JAVA
%{_docdir}/db-%{version}-docs/gsg_txn/JAVA
%files tcl-devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libdb_tcl.so
%{_libdir}/libdb_tcl-%{libver}.la
+%if %{with default_db}
+%attr(755,root,root) %{_libdir}/libdb_tcl.so
%{_libdir}/libdb_tcl.la
+%endif
%{_docdir}/db-%{version}-docs/api_tcl
%endif
%attr(755,root,root) %{_bindir}/db*_stat
%attr(755,root,root) %{_bindir}/db*_upgrade
%attr(755,root,root) %{_bindir}/db*_verify
+%dir %{_docdir}/db-%{version}-docs
%{_docdir}/db-%{version}-docs/utility