3 %bcond_without java # don't build Java library
4 %bcond_without tcl # don't build Tcl bindings
5 %bcond_with pmutex # use POSIX mutexes (only process-private with linuxthreads)
6 %bcond_with nptl # use process-shared POSIX mutexes (NPTL provides full interface)
7 %bcond_without static_libs # don't build static libraries
8 %bcond_with default_db # use this db as default system db
12 %{?with_nptl:%define with_pmutex 1}
13 Summary: Berkeley DB database library for C
14 Summary(pl.UTF-8): Biblioteka C do obsługi baz Berkeley DB
16 Version: %{ver}.%{patchlevel}
18 License: Sleepycat public license (GPL-like, see LICENSE)
20 #Source0Download: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
21 Source0: http://download.oracle.com/berkeley-db/db-%{ver}.tar.gz
22 # Source0-md5: cbc77517c9278cdb47613ce8cb55779f
23 %patchset_source -f http://download.oracle.com/berkeley-db/patches/db/%{ver}/patch.%{ver}.%g 1 %{patchlevel}
24 Patch0: db-so-suffix.patch
25 Patch1: %{name}-amd64-fastmutex.patch
26 URL: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html
27 BuildRequires: autoconf
28 BuildRequires: automake
30 %{?with_java:BuildRequires: jdk}
31 BuildRequires: libstdc++-devel
32 BuildRequires: libtool >= 2:2.2
33 BuildRequires: rpmbuild(macros) >= 1.426
34 BuildRequires: sed >= 4.0
35 %{?with_tcl:BuildRequires: tcl-devel >= 8.4.0}
36 %if %{with default_db}
37 Provides: db = %{version}-%{release}
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 %if %{without default_db}
43 %define _includedir %{_prefix}/include/db4.2
47 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
48 provides embedded database support for both traditional and
49 client/server applications. Berkeley DB is used by many applications,
50 including Python and Perl, so this should be installed on all systems.
52 %description -l pl.UTF-8
53 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
54 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
55 klient-serwer. Berkeley db jest używana w wielu aplikacjach, w tym w
59 Summary: Header files for Berkeley database library
60 Summary(pl.UTF-8): Pliki nagłówkowe do biblioteki Berkeley Database
61 Group: Development/Libraries
62 Requires: %{name} = %{version}-%{release}
63 %if %{with default_db}
64 Provides: db-devel = %{version}-%{release}
70 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
71 provides embedded database support for both traditional and
72 client/server applications. Berkeley DB includes B+tree, Extended
73 Linear Hashing, Fixed and Variable-length record access methods,
74 transactions, locking, logging, shared memory caching and database
75 recovery. DB supports C, C++, Java and Perl APIs.
77 This package contains the header files, libraries, and documentation
78 for building programs which use Berkeley DB.
80 %description devel -l pl.UTF-8
81 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
82 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
83 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
84 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
85 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
86 dla C, C++, Javy i Perla.
88 Ten pakiet zawiera pliki nagłówkowe i dokumentację do budowania
89 programów używających Berkeley DB.
92 Summary: Static libraries for Berkeley database library
93 Summary(pl.UTF-8): Statyczne biblioteki Berkeley Database
94 Group: Development/Libraries
95 Requires: %{name}-devel = %{version}-%{release}
96 %if %{with default_db}
97 Provides: db-static = %{version}-%{release}
103 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
104 provides embedded database support for both traditional and
105 client/server applications. Berkeley DB includes B+tree, Extended
106 Linear Hashing, Fixed and Variable-length record access methods,
107 transactions, locking, logging, shared memory caching and database
108 recovery. DB supports C, C++, Java and Perl APIs.
110 This package contains the static libraries for building programs which
113 %description static -l pl.UTF-8
114 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
115 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
116 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
117 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
118 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
119 dla C, C++, Javy i Perla.
121 Ten pakiet zawiera statyczne biblioteki do budowania programów
122 używających Berkeley DB.
125 Summary: Berkeley database library for C++
126 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla C++
128 %if %{with default_db}
129 Provides: db-cxx = %{version}-%{release}
134 Berkeley database library for C++.
136 %description cxx -l pl.UTF-8
137 Biblioteka baz danych Berkeley dla C++.
140 Summary: Header files for db-cxx library
141 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki db-cxx
142 Group: Development/Libraries
143 Requires: %{name}-cxx = %{version}-%{release}
144 Requires: %{name}-devel = %{version}-%{release}
145 %if %{with default_db}
146 Provides: db-cxx-devel = %{version}-%{release}
148 Conflicts: db-devel < 4.1.25-3
150 %description cxx-devel
151 Header files for db-cxx library.
153 %description cxx-devel -l pl.UTF-8
154 Pliki nagłówkowe biblioteki db-cxx.
157 Summary: Static version of db-cxx library
158 Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
159 Group: Development/Libraries
160 Requires: %{name}-cxx-devel = %{version}-%{release}
161 %if %{with default_db}
162 Provides: db-cxx-static = %{version}-%{release}
164 Conflicts: db-static < 4.2.50-1
166 %description cxx-static
167 Static version of db-cxx library.
169 %description cxx-static -l pl.UTF-8
170 Statyczna wersja biblioteki db-cxx.
173 Summary: Berkeley database library for Java
174 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
176 Requires: jpackage-utils
177 %if %{with default_db}
178 Provides: db-java = %{version}-%{release}
182 Berkeley database library for Java.
184 %description java -l pl.UTF-8
185 Biblioteka baz danych Berkeley dla Javy.
188 Summary: Development files for db-java library
189 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
190 Group: Development/Languages/Java
191 Requires: %{name}-java = %{version}-%{release}
192 %if %{with default_db}
193 Provides: db-java-devel = %{version}-%{release}
195 Conflicts: db-devel < 4.1.25-3
197 %description java-devel
198 Development files for db-java library.
200 %description java-devel -l pl.UTF-8
201 Pliki programistyczne biblioteki db-java.
204 Summary: Berkeley database library for Tcl
205 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
206 Group: Development/Languages/Tcl
208 %if %{with default_db}
209 Provides: db-tcl = %{version}-%{release}
214 Berkeley database library for Tcl.
216 %description tcl -l pl.UTF-8
217 Biblioteka baz danych Berkeley dla Tcl.
220 Summary: Development files for db-tcl library
221 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
222 Group: Development/Languages/Tcl
223 Requires: %{name}-tcl = %{version}-%{release}
224 %if %{with default_db}
225 Provides: db-tcl-devel = %{version}-%{release}
227 Conflicts: db-devel < 4.1.25-3
229 %description tcl-devel
230 Development files for db-tcl library.
232 %description tcl-devel -l pl.UTF-8
233 Pliki programistyczne biblioteki db-tcl.
236 Summary: Command line tools for managing Berkeley DB databases
237 Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
238 Group: Applications/Databases
239 Requires: %{name} = %{version}-%{release}
240 %if %{with default_db}
241 Provides: db-utils = %{version}-%{release}
248 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
249 provides embedded database support for both traditional and
250 client/server applications. Berkeley DB includes B+tree, Extended
251 Linear Hashing, Fixed and Variable-length record access methods,
252 transactions, locking, logging, shared memory caching and database
253 recovery. DB supports C, C++, Java and Perl APIs.
255 This package contains command line tools for managing Berkeley DB
258 %description utils -l pl.UTF-8
259 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
260 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
261 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
262 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
263 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
264 dla C, C++, Javy i Perla.
266 Ten pakiet zawiera narzędzia do obsługi baz Berkeley DB z linii
270 %setup -q -n db-%{ver}
272 %patchset_patch 1 %{patchlevel}
278 sed -i -e 's,AM_PTHREADS_SHARED("POSIX/.*,:,' dist/aclocal/mutex.ac
281 sed -i -e '/AC_PROG_LIBTOOL/aLT_OUTPUT' dist/configure.ac
285 cp -f /usr/share/aclocal/libtool.m4 aclocal/libtool.ac
286 cp -f /usr/share/aclocal/ltoptions.m4 aclocal/ltoptions.ac
287 cp -f /usr/share/aclocal/ltsugar.m4 aclocal/ltsugar.ac
288 cp -f /usr/share/aclocal/ltversion.m4 aclocal/ltversion.ac
289 cp -f /usr/share/aclocal/lt~obsolete.m4 aclocal/lt~obsolete.ac
290 cp -f /usr/share/automake/config.sub .
291 cp -f /usr/share/libtool/config/ltmain.sh .
295 %if %{with static_libs}
296 cp -a build_unix build_unix.static
302 CFLAGS="%{rpmcflags}"
303 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
304 LDFLAGS="%{rpmcflags} %{rpmldflags}"
305 export CC CXX CFLAGS CXXFLAGS LDFLAGS
312 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
315 # (temporarily?) disabled because of compilation errors:
318 %{__make} library_build
325 --prefix=%{_prefix} \
326 --libdir=%{_libdir} \
329 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
331 %{?with_tcl:--enable-tcl} \
332 %{?with_tcl:--with-tcl=/usr/lib} \
333 %{?with_java:--enable-java} \
337 %{__make} library_build \
338 TCFLAGS='-I$(builddir) -I%{_includedir}' \
339 LIBSO_LIBS="\$(LIBS)" \
340 LIBTSO_LIBS="\$(LIBS) -ltcl"
343 rm -rf $RPM_BUILD_ROOT
344 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
346 install -d $RPM_BUILD_ROOT%{_javadir}
349 %if %{with static_libs}
350 %{__make} -C build_unix.static library_install \
351 DESTDIR=$RPM_BUILD_ROOT \
352 docdir=%{_docdir}/db-%{version}-docs \
353 includedir=%{_includedir}
356 %{__make} -C build_unix library_install \
357 DESTDIR=$RPM_BUILD_ROOT \
358 LIB_INSTALL_FILE_LIST="" \
359 docdir=%{_docdir}/db-%{version}-docs \
360 includedir=%{_includedir}
362 %if %{with default_db}
363 install -d $RPM_BUILD_ROOT/%{_lib}
364 mv $RPM_BUILD_ROOT%{_libdir}/libdb-4.2.so $RPM_BUILD_ROOT/%{_lib}
367 cd $RPM_BUILD_ROOT%{_libdir}
368 %if %{with static_libs}
369 mv -f libdb.a libdb-4.2.a
370 mv -f libdb_cxx.a libdb_cxx-4.2.a
373 mv -f $RPM_BUILD_ROOT%{_libdir}/db.jar $RPM_BUILD_ROOT%{_javadir}/db-4.2.jar
375 %if %{with default_db}
376 ln -sf /%{_lib}/libdb-4.2.so libdb.so
377 ln -sf /%{_lib}/libdb-4.2.so libdb4.so
378 ln -sf /%{_lib}/libdb-4.2.so libdb-4.2.so
379 ln -sf /%{_lib}/libdb-4.2.so libndbm.so
380 ln -sf libdb-4.2.la libdb.la
381 ln -sf libdb-4.2.la libdb4.la
382 ln -sf libdb-4.2.la libndbm.la
383 ln -sf libdb_cxx-4.2.so libdb_cxx.so
384 ln -sf libdb_cxx-4.2.la libdb_cxx.la
386 ln -sf libdb_java-4.2.la libdb_java.la
387 ln -sf db-4.2.jar $RPM_BUILD_ROOT%{_javadir}/db.jar
390 ln -sf libdb_tcl-4.2.so libdb_tcl.so
391 ln -sf libdb_tcl-4.2.la libdb_tcl.la
393 %if %{with static_libs}
394 ln -sf libdb-4.2.a libdb.a
395 ln -sf libdb-4.2.a libdb4.a
396 ln -sf libdb-4.2.a libndbm.a
397 ln -sf libdb_cxx-4.2.a libdb_cxx.a
401 sed -i "s/old_library=''/old_library='libdb-4.2.a'/" libdb-4.2.la
402 sed -i "s/old_library=''/old_library='libdb_cxx-4.2.a'/" libdb_cxx-4.2.la
406 cd $RPM_BUILD_ROOT%{_bindir}
407 mv -f berkeley_db_svc berkeley_db_svc-4.2
408 %{?with_default_db:ln -sf berkeley_db_svc-4.2 berkeley_db_svc}
410 Fver=$(echo $F|sed 's/db_/db4.2_/')
412 %{?with_default_db:ln -sf $Fver $F}
415 rm -f examples_c*/tags
416 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
417 cp -rf examples_c/* $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
419 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
420 cp -rf examples_cxx/* $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
423 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
424 cp -rf examples_java/* $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
426 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/java
430 rm -rf $RPM_BUILD_ROOT
432 %post -p /sbin/ldconfig
433 %postun -p /sbin/ldconfig
435 %post tcl -p /sbin/ldconfig
436 %postun tcl -p /sbin/ldconfig
438 %post cxx -p /sbin/ldconfig
439 %postun cxx -p /sbin/ldconfig
442 %defattr(644,root,root,755)
444 %if %{with default_db}
445 %attr(755,root,root) /%{_lib}/libdb-4.2.so
447 %attr(755,root,root) %{_libdir}/libdb-4.2.so
449 %dir %{_docdir}/db-%{version}-docs
450 %{_docdir}/db-%{version}-docs/sleepycat
451 %{_docdir}/db-%{version}-docs/index.html
454 %defattr(644,root,root,755)
455 %{_libdir}/libdb-4.2.la
456 %if %{with default_db}
457 %attr(755,root,root) %{_libdir}/libdb-4.2.so
458 %attr(755,root,root) %{_libdir}/libdb4.so
459 %attr(755,root,root) %{_libdir}/libdb.so
460 %attr(755,root,root) %{_libdir}/libndbm.so
463 %{_libdir}/libndbm.la
468 %{_includedir}/db_185.h
469 %{_docdir}/db-%{version}-docs/api_c
470 %{_docdir}/db-%{version}-docs/images
471 %{_docdir}/db-%{version}-docs/ref
472 %{_examplesdir}/db-%{version}
474 %if %{with static_libs}
476 %defattr(644,root,root,755)
477 %{_libdir}/libdb-4.2.a
478 %if %{with default_db}
486 %defattr(644,root,root,755)
487 %attr(755,root,root) %{_libdir}/libdb_cxx-4.2.so
490 %defattr(644,root,root,755)
491 %{_libdir}/libdb_cxx-4.2.la
492 %if %{with default_db}
493 %attr(755,root,root) %{_libdir}/libdb_cxx.so
494 %{_libdir}/libdb_cxx.la
496 %{_includedir}/db_cxx.h
497 %{_docdir}/db-%{version}-docs/api_cxx
498 %{_examplesdir}/db-cxx-%{version}
500 %if %{with static_libs}
502 %defattr(644,root,root,755)
503 %{_libdir}/libdb_cxx-4.2.a
504 %if %{with default_db}
505 %{_libdir}/libdb_cxx.a
511 %defattr(644,root,root,755)
512 %attr(755,root,root) %{_libdir}/libdb_java-4.2.so
513 %{_javadir}/db-4.2.jar
514 %if %{with default_db}
519 %defattr(644,root,root,755)
520 %{_libdir}/libdb_java-4.2.la
521 %if %{with default_db}
522 %attr(755,root,root) %{_libdir}/libdb_java.so
523 %{_libdir}/libdb_java.la
525 %{_docdir}/db-%{version}-docs/java
526 %{_examplesdir}/db-java-%{version}
531 %defattr(644,root,root,755)
532 %attr(755,root,root) %{_libdir}/libdb_tcl-4.2.so
535 %defattr(644,root,root,755)
536 %{_libdir}/libdb_tcl-4.2.la
537 %if %{with default_db}
538 %attr(755,root,root) %{_libdir}/libdb_tcl.so
539 %{_libdir}/libdb_tcl.la
541 %{_docdir}/db-%{version}-docs/api_tcl
545 %defattr(644,root,root,755)
546 %attr(755,root,root) %{_bindir}/berkeley_db_svc-4.2
547 %attr(755,root,root) %{_bindir}/db4.2_archive
548 %attr(755,root,root) %{_bindir}/db4.2_checkpoint
549 %attr(755,root,root) %{_bindir}/db4.2_deadlock
550 %attr(755,root,root) %{_bindir}/db4.2_dump
551 #%attr(755,root,root) %{_bindir}/db4.2_dump185
552 %attr(755,root,root) %{_bindir}/db4.2_load
553 %attr(755,root,root) %{_bindir}/db4.2_printlog
554 %attr(755,root,root) %{_bindir}/db4.2_recover
555 %attr(755,root,root) %{_bindir}/db4.2_stat
556 %attr(755,root,root) %{_bindir}/db4.2_upgrade
557 %attr(755,root,root) %{_bindir}/db4.2_verify
558 %if %{with default_db}
559 %attr(755,root,root) %{_bindir}/berkeley_db_svc
560 %attr(755,root,root) %{_bindir}/db_archive
561 %attr(755,root,root) %{_bindir}/db_checkpoint
562 %attr(755,root,root) %{_bindir}/db_deadlock
563 %attr(755,root,root) %{_bindir}/db_dump
564 #%attr(755,root,root) %{_bindir}/db_dump185
565 %attr(755,root,root) %{_bindir}/db_load
566 %attr(755,root,root) %{_bindir}/db_printlog
567 %attr(755,root,root) %{_bindir}/db_recover
568 %attr(755,root,root) %{_bindir}/db_stat
569 %attr(755,root,root) %{_bindir}/db_upgrade
570 %attr(755,root,root) %{_bindir}/db_verify
572 %{_docdir}/db-%{version}-docs/utility