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_without nptl # don't 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}
19 License: Sleepycat public license (GPL-like, see LICENSE)
21 #Source0Download: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
22 Source0: http://download.oracle.com/berkeley-db/db-%{ver}.tar.gz
23 # Source0-md5: 13585a20ce32f113b8e8cdb57f52e3bb
24 %patchset_source -f http://download.oracle.com/berkeley-db/patches/db/%{ver}/patch.%{ver}.%g 1 %{patchlevel}
25 URL: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html
26 BuildRequires: autoconf
27 BuildRequires: automake
30 %{?with_java:BuildRequires: jdk}
31 BuildRequires: libstdc++-devel
32 BuildRequires: libtool >= 2:2.2
33 BuildRequires: sed >= 4.0
34 %{?with_tcl:BuildRequires: tcl-devel >= 8.4.0}
35 %if %{with default_db}
36 Provides: db = %{version}-%{release}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %if %{without default_db}
42 %define _includedir %{_prefix}/include/db4.2
46 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
47 provides embedded database support for both traditional and
48 client/server applications. Berkeley DB is used by many applications,
49 including Python and Perl, so this should be installed on all systems.
51 %description -l pl.UTF-8
52 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
53 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
54 klient-serwer. Berkeley db jest używana w wielu aplikacjach, w tym w
58 Summary: Header files for Berkeley database library
59 Summary(pl.UTF-8): Pliki nagłówkowe do biblioteki Berkeley Database
60 Group: Development/Libraries
61 Requires: %{name} = %{epoch}:%{version}-%{release}
62 %if %{with default_db}
63 Provides: db-devel = %{version}-%{release}
69 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
70 provides embedded database support for both traditional and
71 client/server applications. Berkeley DB includes B+tree, Extended
72 Linear Hashing, Fixed and Variable-length record access methods,
73 transactions, locking, logging, shared memory caching and database
74 recovery. DB supports C, C++, Java and Perl APIs.
76 This package contains the header files, libraries, and documentation
77 for building programs which use Berkeley DB.
79 %description devel -l pl.UTF-8
80 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
81 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
82 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
83 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
84 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
85 dla C, C++, Javy i Perla.
87 Ten pakiet zawiera pliki nagłówkowe i dokumentację do budowania
88 programów używających Berkeley DB.
91 Summary: Static libraries for Berkeley database library
92 Summary(pl.UTF-8): Statyczne biblioteki Berkeley Database
93 Group: Development/Libraries
94 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
95 %if %{with default_db}
96 Provides: db-static = %{version}-%{release}
102 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
103 provides embedded database support for both traditional and
104 client/server applications. Berkeley DB includes B+tree, Extended
105 Linear Hashing, Fixed and Variable-length record access methods,
106 transactions, locking, logging, shared memory caching and database
107 recovery. DB supports C, C++, Java and Perl APIs.
109 This package contains the static libraries for building programs which
112 %description static -l pl.UTF-8
113 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
114 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
115 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
116 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
117 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
118 dla C, C++, Javy i Perla.
120 Ten pakiet zawiera statyczne biblioteki do budowania programów
121 używających Berkeley DB.
124 Summary: Berkeley database library for C++
125 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla C++
127 %if %{with default_db}
128 Provides: db-cxx = %{version}-%{release}
133 Berkeley database library for C++.
135 %description cxx -l pl.UTF-8
136 Biblioteka baz danych Berkeley dla C++.
139 Summary: Header files for db-cxx library
140 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki db-cxx
141 Group: Development/Libraries
142 Requires: %{name}-cxx = %{epoch}:%{version}-%{release}
143 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
144 %if %{with default_db}
145 Provides: db-cxx-devel = %{version}-%{release}
147 Conflicts: db-devel < 4.1.25-3
149 %description cxx-devel
150 Header files for db-cxx library.
152 %description cxx-devel -l pl.UTF-8
153 Pliki nagłówkowe biblioteki db-cxx.
156 Summary: Static version of db-cxx library
157 Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
158 Group: Development/Libraries
159 Requires: %{name}-cxx-devel = %{epoch}:%{version}-%{release}
160 %if %{with default_db}
161 Provides: db-cxx-static = %{version}-%{release}
163 Conflicts: db-static < 4.2.50-1
165 %description cxx-static
166 Static version of db-cxx library.
168 %description cxx-static -l pl.UTF-8
169 Statyczna wersja biblioteki db-cxx.
172 Summary: Berkeley database library for Java
173 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
175 Requires: jpackage-utils
176 %if %{with default_db}
177 Provides: db-java = %{version}-%{release}
181 Berkeley database library for Java.
183 %description java -l pl.UTF-8
184 Biblioteka baz danych Berkeley dla Javy.
187 Summary: Development files for db-java library
188 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
189 Group: Development/Languages/Java
190 Requires: %{name}-java = %{epoch}:%{version}-%{release}
191 %if %{with default_db}
192 Provides: db-java-devel = %{version}-%{release}
194 Conflicts: db-devel < 4.1.25-3
196 %description java-devel
197 Development files for db-java library.
199 %description java-devel -l pl.UTF-8
200 Pliki programistyczne biblioteki db-java.
203 Summary: Berkeley database library for Tcl
204 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
205 Group: Development/Languages/Tcl
207 %if %{with default_db}
208 Provides: db-tcl = %{version}-%{release}
213 Berkeley database library for Tcl.
215 %description tcl -l pl.UTF-8
216 Biblioteka baz danych Berkeley dla Tcl.
219 Summary: Development files for db-tcl library
220 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
221 Group: Development/Languages/Tcl
222 Requires: %{name}-tcl = %{epoch}:%{version}-%{release}
223 %if %{with default_db}
224 Provides: db-tcl-devel = %{version}-%{release}
226 Conflicts: db-devel < 4.1.25-3
228 %description tcl-devel
229 Development files for db-tcl library.
231 %description tcl-devel -l pl.UTF-8
232 Pliki programistyczne biblioteki db-tcl.
235 Summary: Command line tools for managing Berkeley DB databases
236 Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
237 Group: Applications/Databases
238 Requires: %{name} = %{epoch}:%{version}-%{release}
239 %if %{with default_db}
240 Provides: db-utils = %{version}-%{release}
245 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
246 provides embedded database support for both traditional and
247 client/server applications. Berkeley DB includes B+tree, Extended
248 Linear Hashing, Fixed and Variable-length record access methods,
249 transactions, locking, logging, shared memory caching and database
250 recovery. DB supports C, C++, Java and Perl APIs.
252 This package contains command line tools for managing Berkeley DB
255 %description utils -l pl.UTF-8
256 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
257 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
258 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
259 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
260 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
261 dla C, C++, Javy i Perla.
263 Ten pakiet zawiera narzędzia do obsługi baz Berkeley DB z linii
267 %setup -q -n db-%{ver}
269 %patchset_patch 1 %{patchlevel}
272 sed -i -e 's,AM_PTHREADS_SHARED("POSIX/.*,:,' dist/aclocal/mutex.ac
275 sed -i -e '/AC_PROG_LIBTOOL/aLT_OUTPUT' dist/configure.ac
279 cp -f /usr/share/aclocal/libtool.m4 aclocal/libtool.ac
280 cp -f /usr/share/aclocal/ltoptions.m4 aclocal/ltoptions.ac
281 cp -f /usr/share/aclocal/ltsugar.m4 aclocal/ltsugar.ac
282 cp -f /usr/share/aclocal/ltversion.m4 aclocal/ltversion.ac
283 cp -f /usr/share/automake/config.sub .
284 cp -f /usr/share/libtool/config/ltmain.sh .
288 %if %{with static_libs}
289 cp -a build_unix build_unix.static
295 CFLAGS="%{rpmcflags}"
296 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
297 LDFLAGS="%{rpmldflags}"
298 export CC CXX CFLAGS CXXFLAGS LDFLAGS
305 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
308 # (temporarily?) disabled because of compilation errors:
311 %{__make} library_build
318 --prefix=%{_prefix} \
319 --libdir=%{_libdir} \
322 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
324 %{?with_tcl:--enable-tcl} \
325 %{?with_tcl:--with-tcl=/usr/lib} \
326 %{?with_java:--enable-java} \
330 %{__make} library_build \
331 TCFLAGS='-I$(builddir) -I%{_includedir}' \
332 LIBSO_LIBS="\$(LIBS)" \
333 LIBTSO_LIBS="\$(LIBS) -ltcl"
336 rm -rf $RPM_BUILD_ROOT
337 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
339 install -d $RPM_BUILD_ROOT%{_javadir}
342 %if %{with static_libs}
343 %{__make} -C build_unix.static library_install \
344 DESTDIR=$RPM_BUILD_ROOT \
345 docdir=%{_docdir}/db-%{version}-docs \
346 includedir=%{_includedir}
349 %{__make} -C build_unix library_install \
350 DESTDIR=$RPM_BUILD_ROOT \
351 LIB_INSTALL_FILE_LIST="" \
352 docdir=%{_docdir}/db-%{version}-docs \
353 includedir=%{_includedir}
355 %if %{with default_db}
356 install -d $RPM_BUILD_ROOT/%{_lib}
357 mv $RPM_BUILD_ROOT%{_libdir}/libdb-4.3.so $RPM_BUILD_ROOT/%{_lib}
360 cd $RPM_BUILD_ROOT%{_libdir}
361 %if %{with static_libs}
362 mv -f libdb.a libdb-4.3.a
363 mv -f libdb_cxx.a libdb_cxx-4.3.a
366 mv -f $RPM_BUILD_ROOT%{_libdir}/*.jar $RPM_BUILD_ROOT%{_javadir}
368 %if %{with default_db}
369 ln -sf /%{_lib}/libdb-4.3.so libdb.so
370 ln -sf /%{_lib}/libdb-4.3.so libdb4.so
371 ln -sf /%{_lib}/libdb-4.3.so libdb-4.3.so
372 ln -sf /%{_lib}/libdb-4.3.so libndbm.so
373 ln -sf libdb-4.3.la libdb.la
374 ln -sf libdb-4.3.la libdb4.la
375 ln -sf libdb-4.3.la libndbm.la
376 ln -sf libdb_cxx-4.3.so libdb_cxx.so
377 ln -sf libdb_cxx-4.3.la libdb_cxx.la
379 ln -sf libdb_java-4.3.la libdb_java.la
382 ln -sf libdb_tcl-4.3.so libdb_tcl.so
383 ln -sf libdb_tcl-4.3.la libdb_tcl.la
385 %if %{with static_libs}
386 ln -sf libdb-4.3.a libdb.a
387 ln -sf libdb-4.3.a libdb4.a
388 ln -sf libdb-4.3.a libndbm.a
389 ln -sf libdb_cxx-4.3.a libdb_cxx.a
393 sed -i "s/old_library=''/old_library='libdb-4.3.a'/" libdb-4.3.la
394 sed -i "s/old_library=''/old_library='libdb_cxx-4.3.a'/" libdb_cxx-4.3.la
397 rm -f examples_c*/tags
398 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
399 cp -rf examples_c/* $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
401 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
402 cp -rf examples_cxx/* $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
405 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
406 cp -rf examples_java/* $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
408 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/java
412 rm -rf $RPM_BUILD_ROOT
414 %post -p /sbin/ldconfig
415 %postun -p /sbin/ldconfig
417 %post tcl -p /sbin/ldconfig
418 %postun tcl -p /sbin/ldconfig
420 %post cxx -p /sbin/ldconfig
421 %postun cxx -p /sbin/ldconfig
424 %defattr(644,root,root,755)
426 %if %{with default_db}
427 %attr(755,root,root) /%{_lib}/libdb-4.3.so
429 %attr(755,root,root) %{_libdir}/libdb-4.3.so
431 %dir %{_docdir}/db-%{version}-docs
432 %{_docdir}/db-%{version}-docs/sleepycat
433 %{_docdir}/db-%{version}-docs/index.html
436 %defattr(644,root,root,755)
437 %{_libdir}/libdb-4.3.la
438 %if %{with default_db}
439 %attr(755,root,root) %{_libdir}/libdb-4.3.so
440 %attr(755,root,root) %{_libdir}/libdb4.so
441 %attr(755,root,root) %{_libdir}/libdb.so
442 %attr(755,root,root) %{_libdir}/libndbm.so
445 %{_libdir}/libndbm.la
450 %{_includedir}/db_185.h
451 %{_docdir}/db-%{version}-docs/api_c
452 %dir %{_docdir}/db-%{version}-docs/gsg
453 %{_docdir}/db-%{version}-docs/gsg/C
454 %{_docdir}/db-%{version}-docs/images
455 %{_docdir}/db-%{version}-docs/ref
456 %{_examplesdir}/db-%{version}
458 %if %{with static_libs}
460 %defattr(644,root,root,755)
461 %{_libdir}/libdb-4.3.a
462 %if %{with default_db}
470 %defattr(644,root,root,755)
471 %attr(755,root,root) %{_libdir}/libdb_cxx-4.3.so
474 %defattr(644,root,root,755)
475 %{_libdir}/libdb_cxx-4.3.la
476 %if %{with default_db}
477 %attr(755,root,root) %{_libdir}/libdb_cxx.so
478 %{_libdir}/libdb_cxx.la
480 %{_includedir}/db_cxx.h
481 %{_docdir}/db-%{version}-docs/api_cxx
482 %{_docdir}/db-%{version}-docs/gsg/CXX
483 %{_examplesdir}/db-cxx-%{version}
485 %if %{with static_libs}
487 %defattr(644,root,root,755)
488 %{_libdir}/libdb_cxx-4.3.a
489 %if %{with default_db}
490 %{_libdir}/libdb_cxx.a
496 %defattr(644,root,root,755)
497 %attr(755,root,root) %{_libdir}/libdb_java-4.3.so
501 %defattr(644,root,root,755)
502 %{_libdir}/libdb_java-4.3.la
503 %if %{with default_db}
504 %attr(755,root,root) %{_libdir}/libdb_java.so
505 %{_libdir}/libdb_java.la
507 %{_docdir}/db-%{version}-docs/collections
508 %{_docdir}/db-%{version}-docs/gsg/JAVA
509 %{_docdir}/db-%{version}-docs/java
510 %{_examplesdir}/db-java-%{version}
515 %defattr(644,root,root,755)
516 %attr(755,root,root) %{_libdir}/libdb_tcl-4.3.so
519 %defattr(644,root,root,755)
520 %{_libdir}/libdb_tcl-4.3.la
521 %if %{with default_db}
522 %attr(755,root,root) %{_libdir}/libdb_tcl.so
523 %{_libdir}/libdb_tcl.la
525 %{_docdir}/db-%{version}-docs/api_tcl
529 %defattr(644,root,root,755)
530 %attr(755,root,root) %{_bindir}/berkeley_db_svc
531 %attr(755,root,root) %{_bindir}/db*_archive
532 %attr(755,root,root) %{_bindir}/db*_checkpoint
533 %attr(755,root,root) %{_bindir}/db*_deadlock
534 %attr(755,root,root) %{_bindir}/db*_dump
535 #%attr(755,root,root) %{_bindir}/db*_dump185
536 %attr(755,root,root) %{_bindir}/db*_load
537 %attr(755,root,root) %{_bindir}/db*_printlog
538 %attr(755,root,root) %{_bindir}/db*_recover
539 %attr(755,root,root) %{_bindir}/db*_stat
540 %attr(755,root,root) %{_bindir}/db*_upgrade
541 %attr(755,root,root) %{_bindir}/db*_verify
542 %{_docdir}/db-%{version}-docs/utility