3 %bcond_without java # don't build Java library
4 %bcond_without tcl # don't build Tcl bindings
5 %bcond_with pmutex # use process-shared POSIX mutexes (not available 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}
71 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
72 provides embedded database support for both traditional and
73 client/server applications. Berkeley DB includes B+tree, Extended
74 Linear Hashing, Fixed and Variable-length record access methods,
75 transactions, locking, logging, shared memory caching and database
76 recovery. DB supports C, C++, Java and Perl APIs.
78 This package contains the header files, libraries, and documentation
79 for building programs which use Berkeley DB.
81 %description devel -l pl.UTF-8
82 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
83 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
84 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
85 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
86 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
87 dla C, C++, Javy i Perla.
89 Ten pakiet zawiera pliki nagłówkowe i dokumentację do budowania
90 programów używających Berkeley DB.
93 Summary: Static libraries for Berkeley database library
94 Summary(pl.UTF-8): Statyczne biblioteki Berkeley Database
95 Group: Development/Libraries
96 Requires: %{name}-devel = %{version}-%{release}
97 %if %{with default_db}
98 Provides: db-static = %{version}-%{release}
100 Obsoletes: db3-static
101 Obsoletes: db4-static
105 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
106 provides embedded database support for both traditional and
107 client/server applications. Berkeley DB includes B+tree, Extended
108 Linear Hashing, Fixed and Variable-length record access methods,
109 transactions, locking, logging, shared memory caching and database
110 recovery. DB supports C, C++, Java and Perl APIs.
112 This package contains the static libraries for building programs which
115 %description static -l pl.UTF-8
116 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
117 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
118 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
119 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
120 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
121 dla C, C++, Javy i Perla.
123 Ten pakiet zawiera statyczne biblioteki do budowania programów
124 używających Berkeley DB.
127 Summary: Berkeley database library for C++
128 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla C++
130 %if %{with default_db}
131 Provides: db-cxx = %{version}-%{release}
136 Berkeley database library for C++.
138 %description cxx -l pl.UTF-8
139 Biblioteka baz danych Berkeley dla C++.
142 Summary: Header files for db-cxx library
143 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki db-cxx
144 Group: Development/Libraries
145 Requires: %{name}-cxx = %{version}-%{release}
146 Requires: %{name}-devel = %{version}-%{release}
147 %if %{with default_db}
148 Provides: db-cxx-devel = %{version}-%{release}
149 Obsoletes: db-cxx-devel
151 Conflicts: db-devel < 4.1.25-3
153 %description cxx-devel
154 Header files for db-cxx library.
156 %description cxx-devel -l pl.UTF-8
157 Pliki nagłówkowe biblioteki db-cxx.
160 Summary: Static version of db-cxx library
161 Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
162 Group: Development/Libraries
163 Requires: %{name}-cxx-devel = %{version}-%{release}
164 %if %{with default_db}
165 Provides: db-cxx-static = %{version}-%{release}
166 Obsoletes: db-cxx-static
168 Conflicts: db-static < 4.2.50-1
170 %description cxx-static
171 Static version of db-cxx library.
173 %description cxx-static -l pl.UTF-8
174 Statyczna wersja biblioteki db-cxx.
177 Summary: Berkeley database library for Java
178 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
180 Requires: jpackage-utils
181 %if %{with default_db}
182 Provides: db-java = %{version}-%{release}
187 Berkeley database library for Java.
189 %description java -l pl.UTF-8
190 Biblioteka baz danych Berkeley dla Javy.
193 Summary: Development files for db-java library
194 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
195 Group: Development/Languages/Java
196 Requires: %{name}-java = %{version}-%{release}
197 %if %{with default_db}
198 Provides: db-java-devel = %{version}-%{release}
199 Obsoletes: db-java-devel
201 Conflicts: db-devel < 4.1.25-3
203 %description java-devel
204 Development files for db-java library.
206 %description java-devel -l pl.UTF-8
207 Pliki programistyczne biblioteki db-java.
210 Summary: Berkeley database library for Tcl
211 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
212 Group: Development/Languages/Tcl
214 %if %{with default_db}
215 Provides: db-tcl = %{version}-%{release}
220 Berkeley database library for Tcl.
222 %description tcl -l pl.UTF-8
223 Biblioteka baz danych Berkeley dla Tcl.
226 Summary: Development files for db-tcl library
227 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
228 Group: Development/Languages/Tcl
229 Requires: %{name}-tcl = %{version}-%{release}
230 %if %{with default_db}
231 Provides: db-tcl-devel = %{version}-%{release}
232 Obsoletes: db-tcl-devel
234 Conflicts: db-devel < 4.1.25-3
236 %description tcl-devel
237 Development files for db-tcl library.
239 %description tcl-devel -l pl.UTF-8
240 Pliki programistyczne biblioteki db-tcl.
243 Summary: Command line tools for managing Berkeley DB databases
244 Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
245 Group: Applications/Databases
246 Requires: %{name} = %{version}-%{release}
247 %if %{with default_db}
248 Provides: db-utils = %{version}-%{release}
255 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
256 provides embedded database support for both traditional and
257 client/server applications. Berkeley DB includes B+tree, Extended
258 Linear Hashing, Fixed and Variable-length record access methods,
259 transactions, locking, logging, shared memory caching and database
260 recovery. DB supports C, C++, Java and Perl APIs.
262 This package contains command line tools for managing Berkeley DB
265 %description utils -l pl.UTF-8
266 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
267 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
268 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
269 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
270 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
271 dla C, C++, Javy i Perla.
273 Ten pakiet zawiera narzędzia do obsługi baz Berkeley DB z linii
277 %setup -q -n db-%{ver}
279 %patchset_patch 1 %{patchlevel}
285 sed -i -e 's,AM_PTHREADS_SHARED("POSIX/.*,:,' dist/aclocal/mutex.ac
288 sed -i -e '/AC_PROG_LIBTOOL/aLT_OUTPUT' dist/configure.ac
292 cp -f /usr/share/aclocal/libtool.m4 aclocal/libtool.ac
293 cp -f /usr/share/aclocal/ltoptions.m4 aclocal/ltoptions.ac
294 cp -f /usr/share/aclocal/ltsugar.m4 aclocal/ltsugar.ac
295 cp -f /usr/share/aclocal/ltversion.m4 aclocal/ltversion.ac
296 cp -f /usr/share/aclocal/lt~obsolete.m4 aclocal/lt~obsolete.ac
297 cp -f /usr/share/automake/config.sub .
298 cp -f /usr/share/libtool/config/ltmain.sh .
302 %if %{with static_libs}
303 cp -a build_unix build_unix.static
309 CFLAGS="%{rpmcflags}"
310 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
311 LDFLAGS="%{rpmcflags} %{rpmldflags}"
312 export CC CXX CFLAGS CXXFLAGS LDFLAGS
319 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
322 # (temporarily?) disabled because of compilation errors:
325 %{__make} library_build
332 --prefix=%{_prefix} \
333 --libdir=%{_libdir} \
338 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
340 %{?with_java:--enable-java} \
341 %{?with_tcl:--enable-tcl --with-tcl=/usr/lib}
343 %{__make} library_build \
344 TCFLAGS='-I$(builddir) -I%{_includedir}' \
345 LIBSO_LIBS="\$(LIBS)" \
346 LIBTSO_LIBS="\$(LIBS) -ltcl"
349 rm -rf $RPM_BUILD_ROOT
350 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
352 install -d $RPM_BUILD_ROOT%{_javadir}
355 %if %{with static_libs}
356 %{__make} -C build_unix.static library_install \
357 DESTDIR=$RPM_BUILD_ROOT \
358 docdir=%{_docdir}/db-%{version}-docs \
359 includedir=%{_includedir}
362 %{__make} -C build_unix library_install \
363 DESTDIR=$RPM_BUILD_ROOT \
364 LIB_INSTALL_FILE_LIST="" \
365 docdir=%{_docdir}/db-%{version}-docs \
366 includedir=%{_includedir}
368 %if %{with default_db}
369 install -d $RPM_BUILD_ROOT/%{_lib}
370 mv $RPM_BUILD_ROOT%{_libdir}/libdb-4.2.so $RPM_BUILD_ROOT/%{_lib}
373 cd $RPM_BUILD_ROOT%{_libdir}
374 %if %{with static_libs}
375 mv -f libdb.a libdb-4.2.a
376 mv -f libdb_cxx.a libdb_cxx-4.2.a
379 mv -f $RPM_BUILD_ROOT%{_libdir}/db.jar $RPM_BUILD_ROOT%{_javadir}/db-4.2.jar
381 %if %{with default_db}
382 ln -sf /%{_lib}/libdb-4.2.so libdb.so
383 ln -sf /%{_lib}/libdb-4.2.so libdb4.so
384 ln -sf /%{_lib}/libdb-4.2.so libdb-4.2.so
385 ln -sf /%{_lib}/libdb-4.2.so libndbm.so
386 ln -sf libdb-4.2.la libdb.la
387 ln -sf libdb-4.2.la libdb4.la
388 ln -sf libdb-4.2.la libndbm.la
389 ln -sf libdb_cxx-4.2.so libdb_cxx.so
390 ln -sf libdb_cxx-4.2.la libdb_cxx.la
392 ln -sf libdb_java-4.2.la libdb_java.la
393 ln -sf db-4.2.jar $RPM_BUILD_ROOT%{_javadir}/db.jar
396 ln -sf libdb_tcl-4.2.so libdb_tcl.so
397 ln -sf libdb_tcl-4.2.la libdb_tcl.la
399 %if %{with static_libs}
400 ln -sf libdb-4.2.a libdb.a
401 ln -sf libdb-4.2.a libdb4.a
402 ln -sf libdb-4.2.a libndbm.a
403 ln -sf libdb_cxx-4.2.a libdb_cxx.a
407 sed -i "s/old_library=''/old_library='libdb-4.2.a'/" libdb-4.2.la
408 sed -i "s/old_library=''/old_library='libdb_cxx-4.2.a'/" libdb_cxx-4.2.la
412 cd $RPM_BUILD_ROOT%{_bindir}
413 mv -f berkeley_db_svc berkeley_db_svc-4.2
414 %{?with_default_db:ln -sf berkeley_db_svc-4.2 berkeley_db_svc}
416 Fver=$(echo $F|sed 's/db_/db4.2_/')
418 %{?with_default_db:ln -sf $Fver $F}
421 rm -f examples_c*/tags
422 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
423 cp -rf examples_c/* $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
425 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
426 cp -rf examples_cxx/* $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
429 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
430 cp -rf examples_java/* $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
432 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/java
436 rm -rf $RPM_BUILD_ROOT
438 %post -p /sbin/ldconfig
439 %postun -p /sbin/ldconfig
441 %post tcl -p /sbin/ldconfig
442 %postun tcl -p /sbin/ldconfig
444 %post cxx -p /sbin/ldconfig
445 %postun cxx -p /sbin/ldconfig
448 %defattr(644,root,root,755)
450 %if %{with default_db}
451 %attr(755,root,root) /%{_lib}/libdb-4.2.so
453 %attr(755,root,root) %{_libdir}/libdb-4.2.so
455 %dir %{_docdir}/db-%{version}-docs
456 %{_docdir}/db-%{version}-docs/sleepycat
457 %{_docdir}/db-%{version}-docs/index.html
460 %defattr(644,root,root,755)
461 %{_libdir}/libdb-4.2.la
462 %if %{with default_db}
463 %attr(755,root,root) %{_libdir}/libdb-4.2.so
464 %attr(755,root,root) %{_libdir}/libdb4.so
465 %attr(755,root,root) %{_libdir}/libdb.so
466 %attr(755,root,root) %{_libdir}/libndbm.so
469 %{_libdir}/libndbm.la
474 %{_includedir}/db_185.h
475 %{_docdir}/db-%{version}-docs/api_c
476 %{_docdir}/db-%{version}-docs/images
477 %{_docdir}/db-%{version}-docs/ref
478 %{_examplesdir}/db-%{version}
480 %if %{with static_libs}
482 %defattr(644,root,root,755)
483 %{_libdir}/libdb-4.2.a
484 %if %{with default_db}
492 %defattr(644,root,root,755)
493 %attr(755,root,root) %{_libdir}/libdb_cxx-4.2.so
496 %defattr(644,root,root,755)
497 %{_libdir}/libdb_cxx-4.2.la
498 %if %{with default_db}
499 %attr(755,root,root) %{_libdir}/libdb_cxx.so
500 %{_libdir}/libdb_cxx.la
502 %{_includedir}/db_cxx.h
503 %{_docdir}/db-%{version}-docs/api_cxx
504 %{_examplesdir}/db-cxx-%{version}
506 %if %{with static_libs}
508 %defattr(644,root,root,755)
509 %{_libdir}/libdb_cxx-4.2.a
510 %if %{with default_db}
511 %{_libdir}/libdb_cxx.a
517 %defattr(644,root,root,755)
518 %attr(755,root,root) %{_libdir}/libdb_java-4.2.so
519 %{_javadir}/db-4.2.jar
520 %if %{with default_db}
525 %defattr(644,root,root,755)
526 %{_libdir}/libdb_java-4.2.la
527 %if %{with default_db}
528 %attr(755,root,root) %{_libdir}/libdb_java.so
529 %{_libdir}/libdb_java.la
531 %{_docdir}/db-%{version}-docs/java
532 %{_examplesdir}/db-java-%{version}
537 %defattr(644,root,root,755)
538 %attr(755,root,root) %{_libdir}/libdb_tcl-4.2.so
541 %defattr(644,root,root,755)
542 %{_libdir}/libdb_tcl-4.2.la
543 %if %{with default_db}
544 %attr(755,root,root) %{_libdir}/libdb_tcl.so
545 %{_libdir}/libdb_tcl.la
547 %{_docdir}/db-%{version}-docs/api_tcl
551 %defattr(644,root,root,755)
552 %attr(755,root,root) %{_bindir}/berkeley_db_svc-4.2
553 %attr(755,root,root) %{_bindir}/db4.2_archive
554 %attr(755,root,root) %{_bindir}/db4.2_checkpoint
555 %attr(755,root,root) %{_bindir}/db4.2_deadlock
556 %attr(755,root,root) %{_bindir}/db4.2_dump
557 #%attr(755,root,root) %{_bindir}/db4.2_dump185
558 %attr(755,root,root) %{_bindir}/db4.2_load
559 %attr(755,root,root) %{_bindir}/db4.2_printlog
560 %attr(755,root,root) %{_bindir}/db4.2_recover
561 %attr(755,root,root) %{_bindir}/db4.2_stat
562 %attr(755,root,root) %{_bindir}/db4.2_upgrade
563 %attr(755,root,root) %{_bindir}/db4.2_verify
564 %if %{with default_db}
565 %attr(755,root,root) %{_bindir}/berkeley_db_svc
566 %attr(755,root,root) %{_bindir}/db_archive
567 %attr(755,root,root) %{_bindir}/db_checkpoint
568 %attr(755,root,root) %{_bindir}/db_deadlock
569 %attr(755,root,root) %{_bindir}/db_dump
570 #%attr(755,root,root) %{_bindir}/db_dump185
571 %attr(755,root,root) %{_bindir}/db_load
572 %attr(755,root,root) %{_bindir}/db_printlog
573 %attr(755,root,root) %{_bindir}/db_recover
574 %attr(755,root,root) %{_bindir}/db_stat
575 %attr(755,root,root) %{_bindir}/db_upgrade
576 %attr(755,root,root) %{_bindir}/db_verify
578 %{_docdir}/db-%{version}-docs/utility