Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 2bf4e4d595cb943ba695555b64e4d951 > files > 6

db4-4.1.25-11mdv2008.0.src.rpm

%define	major	4.1
%define	_libdb_a	libdb-%{major}.a
%define	_libcxx_a	libdb_cxx-%{major}.a

%define libname_orig	%mklibname db
%define libname		%{libname_orig}%{major}
%define libnamedev	%{libname}-devel
%define libnamestatic	%{libname}-static-devel

%define libdbcxx	%{libname_orig}cxx%{major}
%define libdbtcl	%{libname_orig}tcl%{major}
%define libdbjava	%{libname_orig}java%{major}

# Define to build Java bindings (default)
%define build_java	0

# Allow --with[out] JAVA rpm command line buil
%{?_with_JAVA: %{expand: %%define build_java 1}}
%{?_without_JAVA: %{expand: %%define build_java 0}}

# Don't build Java bindings for any MDK release < 9.0
%if %{mdkversion} < 900
%define build_java	0
%endif

%define name db4
%define version 4.1.25
%define release %mkrel 11

Summary: The Berkeley DB database library for C.
Name: %{name}
Version: %{version}
Release: %{release}
Source: http://download.oracle.com/berkeley-db/db-%{version}.tar.bz2
URL: http://www.sleepycat.com
License: BSD
Group: System/Libraries
BuildRequires: tcl, db1-devel
%if %{mdkversion} >= 900
BuildRequires: glibc-static-devel	
%endif
%if %{build_java}
BuildRequires: gcc-java >= 3.1.1-0.8mdk
%endif

# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=70362
#Patch0: db-4.0.14-recover.patch.bz2

#http://www.oracle.com/technology/products/berkeley-db/db/update/4.1.25/patch.4.1.25.html
Patch1: http://www.sleepycat.com/update/4.1.25/patch.4.1.25.1

# Add fast AMD64 mutexes
Patch2: db-4.1.25-amd64-mutexes.patch
# NPTL pthreads mutex are evil
Patch3: db-4.2.52-disable-pthreadsmutexes.patch
Patch4: db-4.2.52-db185.patch
Patch5: db-4.1.25-jni-pkgconfig.patch

BuildRoot: %{_tmppath}/%{name}-root

%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
embedded database support for both traditional and client/server applications.
Berkeley DB is used by many applications, including Python and Perl, so this
should be installed on all systems.

%package -n %{libname}
Summary: The Berkeley DB database library for C.
Group: System/Libraries

%description -n %{libname}
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
embedded database support for both traditional and client/server applications.
Berkeley DB is used by many applications, including Python and Perl, so this
should be installed on all systems.

%package -n %{libdbcxx}
Summary: The Berkeley DB database library for C++.
Group: System/Libraries
Provides: libdbcxx = %{version}-%{release}

%description -n %{libdbcxx}
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
embedded database support for both traditional and client/server applications.
Berkeley DB is used by many applications, including Python and Perl, so this
should be installed on all systems.

This package contains the files needed to build C++ programs which use
Berkeley DB.

%package -n %{libdbjava}
Summary: The Berkeley DB database library for C++.
Group: System/Libraries
Provides: libdbjava = %{version}-%{release}

%description -n %{libdbjava}
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
embedded database support for both traditional and client/server applications.
Berkeley DB is used by many applications, including Python and Perl, so this
should be installed on all systems.

This package contains the files needed to build Java programs which use
Berkeley DB.

%package -n %{libdbtcl}
Summary: The Berkeley DB database library for TCL.
Group: System/Libraries
Provides: libdbtcl = %{version}-%{release}

%description -n %{libdbtcl}
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
embedded database support for both traditional and client/server applications.
Berkeley DB is used by many applications, including Python and Perl, so this
should be installed on all systems.

This package contains the header files, libraries, and documentation for
building tcl programs which use Berkeley DB.

%package -n db41-utils
Summary: Command line tools for managing Berkeley DB databases.
Group: Databases
#Conflicts: db3-utils

%description -n db41-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.

This package contains command line tools for managing Berkeley DB databases.

%package -n %{libnamedev}
Summary: Development libraries/header files for the Berkeley DB library.
Group: Development/Databases
Requires: %{libname} = %{version}-%{release}
Requires: %{libdbtcl} = %{version}-%{release}
Requires: %{libdbcxx} = %{version}-%{release}
Provides: db4.1-devel = %{version}-%{release}
Provides: libdb4.1-devel = %{version}-%{release}
Conflicts: %{libname_orig}3.3-devel, %{libname_orig}4.0-devel
Conflicts: %{libname_orig}4.2-devel

%description -n %{libnamedev}
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.

This package contains the header files, libraries, and documentation for
building programs which use Berkeley DB.

%package -n %{libnamestatic}
Summary: Development static libraries files for the Berkeley DB library.
Group: Development/Databases
Requires: db4.1-devel = %{version}-%{release}
Provides: db4.1-static-devel = %{version}-%{release}
Provides: libdb4.1-static-devel = %{version}-%{release}
Conflicts: %{libname_orig}3.3-static-devel, %{libname_orig}4.0-static-devel
Conflicts: %{libname_orig}4.2-static-devel

%description -n %{libnamestatic}
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.

This package contains the static libraries for building programs which
use Berkeley DB.


%prep
%setup -q -n db-%{version}
#%patch0 -p1 -b .recover
%patch1
%patch2 -p1 -b .amd64-mutexes
%patch3 -p1 -b .pthreadsmutexes
%patch4 -p1 -b .db185
%patch5 -p1 -b .jni-pkgconfig

# Remove tags files which we don't need.
find . -name tags | xargs rm -f
# Define a shell function for fixing HREF references in the docs, which
# would otherwise break when we split the docs up into subpackages.
fixup_href() {
    for doc in $@ ; do
        chmod u+w ${doc}
        sed -e 's,="../api_c/,="../../%{name}-devel-%{version}/api_c/,g' \
            -e 's,="api_c/,="../%{name}-devel-%{version}/api_c/,g' \
            -e 's,="../api_cxx/,="../../%{name}-devel-%{version}/api_cxx/,g' \
            -e 's,="api_cxx/,="../%{name}-devel-%{version}/api_cxx/,g' \
            -e 's,="../api_java/,="../../%{name}-devel-%{version}/api_java/,g' \
            -e 's,="api_java/,="../%{name}-devel-%{version}/api_java/,g' \
            -e 's,="../api_tcl/,="../../%{name}-devel-%{version}/api_tcl/,g' \
            -e 's,="api_tcl/,="../%{name}-devel-%{version}/api_tcl/,g' \
            -e 's,="../examples_c/,="../../%{name}-devel-%{version}/examples_c/,g' \
            -e 's,="examples_c/,="../%{name}-devel-%{version}/examples_c/,g' \
            -e 's,="../examples_cxx/,="../../%{name}-devel-%{version}/examples_cxx/,g' \
            -e 's,="examples_cxx/,="../%{name}-devel-%{version}/examples_cxx/,g' \
            -e 's,="../ref/,="../../%{name}-devel-%{version}/ref/,g' \
            -e 's,="ref/,="../%{name}-devel-%{version}/ref/,g' \
            -e 's,="../sleepycat/,="../../%{name}-devel-%{version}/sleepycat/,g' \
            -e 's,="sleepycat/,="../%{name}-devel-%{version}/sleepycat/,g' \
            -e 's,="../images/,="../../%{name}-%{version}/images/,g' \
            -e 's,="images/,="../%{name}-%{version}/images/,g' \
            -e 's,="../utility/,="../../%{name}-%{version}/utility/,g' \
            -e 's,="utility/,="../%{name}-%{version}/utility/,g' ${doc} > ${doc}.new
        touch -r ${doc} ${doc}.new
        cat ${doc}.new > ${doc}
        touch -r ${doc}.new ${doc}
        rm -f ${doc}.new
    done
}

set +x	# XXX painful to watch
# Fix all of the HTML files.
fixup_href `find . -name "*.html"`
set -x	# XXX painful to watch

chmod -R u+w dist
(cd dist && ./s_config)

%build
CFLAGS="$RPM_OPT_FLAGS"
%ifarch ppc
CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT"
%endif
export CFLAGS

%if %{build_java}
# Use javac trampoline from gcj
mkdir -p build_unix/gcj
pushd build_unix/gcj;
cat > javac << EOF
#!/bin/sh
exec /usr/bin/gcj-`gcj -dumpversion` "\$@"
EOF
chmod +x javac
export PATH=$PWD:$PATH
# Kludge lookup of <jni.h> and make configure grab the right one from gcj
ln -s `gcj -print-file-name=include`/libgcj include
popd
%endif

%if %{build_java}
ENABLE_JAVA="--enable-java"
%endif

%if %{mdkversion} < 1010
%define __libtoolize /bin/true
%endif
pushd build_unix
CONFIGURE_TOP="../dist" %configure2_5x \
	--enable-compat185 --enable-dump185 \
	--enable-shared --enable-static --enable-rpc \
	--enable-tcl --with-tcl=%{_libdir} \
	--enable-cxx $ENABLE_JAVA --enable-test  \
	--disable-pthreadsmutexes \
	# --enable-diagnostic \
	# --enable-debug --enable-debug_rop --enable-debug_wop \

%make
popd

%install
rm -rf %{buildroot}
make -C build_unix install_setup install_include install_lib install_utilities \
	includedir=%{buildroot}%{_includedir}/db4 \
	libdir=%{buildroot}%{_libdir} \
	bindir=%{buildroot}%{_bindir} \
	emode=755

ln -sf db4/db.h %{buildroot}%{_includedir}/db.h

# XXX This is needed for parallel install with db4.2
for F in %{buildroot}%{_bindir}/*db_* ; do
   mv $F `echo $F | sed -e 's,db_,db41_,'`
done

# Move db.jar file to the correct place, and version it
%if %{build_java}
mkdir -p %{buildroot}%{_datadir}/java
mv %{buildroot}%{_libdir}/db.jar %{buildroot}%{_datadir}/java/db-%{major}.jar
%endif

%clean
rm -rf %{buildroot}

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%post -n %{libdbcxx} -p /sbin/ldconfig
%postun -n %{libdbcxx} -p /sbin/ldconfig

%if %{build_java}
%post -n %{libdbjava} -p /sbin/ldconfig
%postun -n %{libdbjava} -p /sbin/ldconfig
%endif
 
%post -n %{libdbtcl} -p /sbin/ldconfig
%postun -n %{libdbtcl} -p /sbin/ldconfig

%files -n %{libname}
%defattr(644,root,root,755)
%doc LICENSE README
%attr(755,root,root) %{_libdir}/libdb-%{major}.so

%files -n %{libdbcxx}
%defattr(755,root,root) 
%{_libdir}/libdb_cxx-%{major}.so

%if %{build_java}
%files -n %{libdbjava}
%defattr(644,root,root,755) 
%doc docs/api_java
%attr(755,root,root) %{_libdir}/libdb_java-%{major}.so
%attr(755,root,root) %{_libdir}/libdb_java-%{major}_g.so
%{_datadir}/java/db-%{major}.jar
%endif

%files -n %{libdbtcl}
%defattr(755,root,root)
%{_libdir}/libdb_tcl-%{major}.so

%files -n db41-utils
%defattr(644,root,root,755)
%doc docs/utility/*
%defattr(755,root,root)
%{_bindir}/berkeley_db*_svc
%{_bindir}/db*_archive
%{_bindir}/db*_checkpoint
%{_bindir}/db*_deadlock
%{_bindir}/db*_dump
%{_bindir}/db*_dump185
%{_bindir}/db*_load
%{_bindir}/db*_printlog
%{_bindir}/db*_recover
%{_bindir}/db*_stat
%{_bindir}/db*_upgrade
%{_bindir}/db*_verify

%files -n %{libnamedev}
%defattr(644,root,root,755)
%doc docs/api_c docs/api_cxx docs/api_java docs/api_tcl docs/index.html
%doc docs/ref docs/sleepycat docs/images
%doc examples_c examples_cxx
%dir %{_includedir}/db4
%{_includedir}/db4/db.h
%{_includedir}/db4/db_185.h
%{_includedir}/db4/db_cxx.h
%{_includedir}/db4/cxx_common.h
%{_includedir}/db4/cxx_except.h
%{_includedir}/db.h
%{_libdir}/libdb.so
%{_libdir}/libdb-4.so
%{_libdir}/libdb-%{major}.la
%{_libdir}/libdb_cxx.so
%{_libdir}/libdb_cxx-4.so
%{_libdir}/libdb_cxx-%{major}.la
%{_libdir}/libdb_tcl.so
%{_libdir}/libdb_tcl-4.so
%{_libdir}/libdb_tcl-%{major}.la
%if %build_java
%{_libdir}/libdb_java.so
%{_libdir}/libdb_java-4.so
%{_libdir}/libdb_java-%{major}.la
%endif

%files -n %{libnamestatic}
%defattr(644,root,root,755)
%{_libdir}/*.a



%changelog
* Sat Apr 28 2007 Olivier Blin <oblin@mandriva.com> 4.1.25-11mdv2008.0
+ Revision: 18998
- remove ldconfig Requires, they are automatically computed, and should have been Requires(post) and Requires(postun) anyway

  + Adam Williamson <awilliamson@mandriva.com>
    - clean spec (rpmlint)

* Fri Apr 27 2007 Adam Williamson <awilliamson@mandriva.com> 4.1.25-10mdv2008.0
+ Revision: 18799
- rebuild for new era
- update upstream patch
- disable java build (doesn't work with gcj 4.x, packages aren't in Cooker anyway)
- clean spec

  + Mandriva <devel@mandriva.com>


* Wed Aug 10 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 4.1.25-9mdk
- use pkg-config to gather gcj bits

* Sat Sep 18 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.1.25-8mdk
- fix x86_64 mutexes from previous merge

* Thu Aug 12 2004 Luca Berra <bluca@vodka.it> 4.1.25-7mdk 
- do not provide db4 devel (for upgrade to 4.2)
- cleanded specfile
- renamed utils

* Wed Jun 09 2004 Luca Berra <bluca@vodka.it> 4.1.25-6mdk 
- disabled pthreads mutexes

* Fri Jun 04 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.1.25-5mdk
- rebuilt against gcc3.4

* Fri Feb 27 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 4.1.25-4mdk
- Own %%includedir/db4
- db4-utils conflicts db3-utils
- fix unpackaged files

* Sat Aug 23 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.1.25-3mdk
- Add some provides & conflicts to ease installations

* Thu Jul 31 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.1.25-2mdk
- Patch2: Add fast mutexes for AMD64
- %%configure2_5x, fix mklibnamification

* Fri Jun 27 2003 Stefan van der Eijk <stefan@eijk.nu> 4.1.25-1mdk
- Buchan's package
  * Sun May 18 2003 Buchan Milne <bgmilne@linux-mandrake.com> 4.1.25-1mdk
  - 4.1.25 (see if we can get openldap-2.1 to build with bdb support)
  - Remove db_recover patch(0), add official patch(1)
  - Maybe someone needs libdb_java-4.1.la, and if no-one does, at least
   use the macro so it doesn't have to be changed every time ...

* Wed Feb 19 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.0.14-6mdk
- Only package libdbcxx*.so.* into dedicated package
- Remove extra Provides: db4, since they are bindings in different languages

* Wed Feb 19 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.0.14-5mdk
- Patch0: SleepyCat patch for db_recover
- When moving a package from contribs to main, especially if it now
  the default, maintainer is expected to check that contributor hasn't
  nuked away changes that were made to initial package!
  - Add -D_GNU_SOURCE -D_REENTRANT to CFLAGS for PPC - fix crazy 2GB .db files
  - Conditionalize build of Java bindings --with[out] JAVA
  - Sanitize specfile (use %%configure, %%makeinstall, etc.)
  - Enable Java bindings, disable debug
  - Rpmlint fixes: strange-permission, hardcoded-library-path
  - Move docs images to devel package.
  - Make a new libdbcxx package.
  - Remove duplicate BuildPrereq, fix BuildRequires
  - Add missing files

* Mon Feb 17 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.14-4mdk
- use %%mklibname and other rpmlint stuff

* Mon Feb 17 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.14-3mdk
- remove libdb-4.0.so from -devel package
- fix BuildRequires

* Wed Jan 01 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.0.14-2mdk
- add missing files
- remove unwanted but elswhere installed doc files
- add a static-devel sub package
- misc spec file fixes

* Wed Apr 03 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.0.14-1mdk
- 4.0.14.
- Don't install libdb-4.0.so in /lib.
- Spec cleanup.

* Fri Oct 26 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.3.11-5mdk
- Add missing files.

* Fri Oct 12 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.3.11-4mdk
- Add a description to the main package.
- Applied db 3.3.11.1 patch.

* Fri Oct 12 2001 Frederic Lepied <flepied@mandrakesoft.com> 3.3.11-3mdk
- don't obsolete libdb3.2

* Fri Oct 12 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.3.11-2mdk
- rebuild.

* Thu Oct 11 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.3.11-1mdk
- 3.3.11.

* Sat Oct 06 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.2.9-3mdk
- Change License for BSD (thanks to Geoffrey).
- devel package provide libdb-devel.

* Wed Sep 05 2001 Christian Belisle <cbelisle@mandrakesoft.com> 3.2.9-2mdk
- rebuild.
- s/Copyright/License.

* Wed Jul 04 2001 Frederic Lepied <flepied@mandrakesoft.com> 3.2.9-1mdk
- 3.2.9

* Mon Mar 12 2001 Frederic Lepied <flepied@mandrakesoft.com> 3.1.17-1mdk
- 3.1.17

* Thu Dec 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 3.1.14-2mdk
- new lib policy.

* Tue Oct 17 2000 Frederic Lepied <flepied@mandrakesoft.com> 3.1.14-1mdk
- first mandrake version.

* Thu Aug 31 2000 Matt Wilson <msw@redhat.com>
- rebuild to cope with glibc locale binary incompatibility, again

* Thu Aug 24 2000 Jeff Johnson <jbj@redhat.com>
- remove redundant strip of libnss_db* that is nuking symbols.
- change location in /usr/lib/libdb-3.1.la to point to /lib (#16776).

* Fri Aug 18 2000 Jeff Johnson <jbj@redhat.com>
- summaries from specspo.
- all of libdb_tcl* (including symlinks) in db3-utils, should be db3->tcl?

* Thu Aug 17 2000 Jakub Jelinek <jakub@redhat.com>
- temporarily build nss_db in this package, should be moved
  into separate nss_db package soon

* Thu Jul 20 2000 Jakub Jelinek <jakub@redhat.com>
- rebuild to cope with glibc locale binary incompatibility

* Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jun 12 2000 Jeff Johnson <jbj@redhat.com>
- upgrade to 3.1.14.
- create db3-utils sub-package to hide tcl dependency, enable tcl Yet Again.
- FHS packaging.

* Tue Jun 06 2000 Jeff Johnson <jbj@redhat.com>
- disable tcl Yet Again, base packages cannot depend on libtcl.so.

* Sun Jun 04 2000 Jeff Johnson <jbj@redhat.com>
- enable tcl, rebuild against tcltk 8.3.1 (w/o pthreads).

* Wed May 31 2000 Matt Wilson <msw@redhat.com>
- include /lib/libdb.so in the devel package

* Thu May 11 2000 Jeff Johnson <jbj@redhat.com>
- put in "System Environment/Libraries" per msw instructions.

* Wed May 10 2000 Jeff Johnson <jbj@redhat.com>
- install shared library in /lib, not /usr/lib.
- move API docs to db3-devel.

* Tue May 09 2000 Jeff Johnson <jbj@redhat.com>
- don't rename db_* to db3_*.

* Wed May 03 2000 Jeff Johnson <jbj@redhat.com>
- disable --enable-test --enable-debug_rop --enable-debug_wop.
- disable --enable-posixmutexes --enable-tcl as well, to avoid glibc-2.1.3
  problems.

* Tue Apr 25 2000 Jeff Johnson <jbj@redhat.com>
- add 3.0.55.1 alignment patch.
- add --enable-posixmutexes (linux threads has not pthread_*attr_setpshared).
- add --enable-tcl (needed -lpthreads).

* Sun Apr 02 2000 Jeff Johnson <jbj@redhat.com>
- add --enable-debug_{r,w}op for now.
- add variable to set shm perms.

* Sat Mar 25 2000 Jeff Johnson <jbj@redhat.com>
- update to 3.0.55

* Tue Dec 29 1998 Jeff Johnson <jbj@redhat.com>
- Add --enable-cxx to configure.

* Fri Jun 19 1998 Jeff Johnson <jbj@redhat.com>
- Create.