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_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: d84dff288a19186b136b0daf7067ade3
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
29 %{?with_java:BuildRequires: jdk}
30 BuildRequires: libstdc++-devel
31 BuildRequires: libtool >= 2:2.2
32 BuildRequires: sed >= 4.0
33 %{?with_tcl:BuildRequires: tcl-devel >= 8.4.0}
34 %if %{with default_db}
35 Provides: db = %{version}-%{release}
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %if %{without default_db}
41 %define _includedir %{_prefix}/include/db4.4
45 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
46 provides embedded database support for both traditional and
47 client/server applications. Berkeley DB is used by many applications,
48 including Python and Perl, so this should be installed on all systems.
50 %description -l pl.UTF-8
51 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
52 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
53 klient-serwer. Berkeley db jest używana w wielu aplikacjach, w tym w
57 Summary: Header files for Berkeley database library
58 Summary(pl.UTF-8): Pliki nagłówkowe do biblioteki Berkeley Database
59 Group: Development/Libraries
60 Requires: %{name} = %{epoch}:%{version}-%{release}
61 %if %{with default_db}
62 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}
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 = %{epoch}:%{version}-%{release}
144 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
145 %if %{with default_db}
146 Provides: db-cxx-devel = %{version}-%{release}
147 Obsoletes: db-cxx-devel
149 Conflicts: db-devel < 4.1.25-3
151 %description cxx-devel
152 Header files for db-cxx library.
154 %description cxx-devel -l pl.UTF-8
155 Pliki nagłówkowe biblioteki db-cxx.
158 Summary: Static version of db-cxx library
159 Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
160 Group: Development/Libraries
161 Requires: %{name}-cxx-devel = %{epoch}:%{version}-%{release}
162 %if %{with default_db}
163 Provides: db-cxx-static = %{version}-%{release}
164 Obsoletes: db-cxx-static
166 Conflicts: db-static < 4.2.50-1
168 %description cxx-static
169 Static version of db-cxx library.
171 %description cxx-static -l pl.UTF-8
172 Statyczna wersja biblioteki db-cxx.
175 Summary: Berkeley database library for Java
176 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
178 Requires: jpackage-utils
179 %if %{with default_db}
180 Provides: db-java = %{version}-%{release}
185 Berkeley database library for Java.
187 %description java -l pl.UTF-8
188 Biblioteka baz danych Berkeley dla Javy.
191 Summary: Development files for db-java library
192 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
193 Group: Development/Languages/Java
194 Requires: %{name}-java = %{epoch}:%{version}-%{release}
195 %if %{with default_db}
196 Provides: db-java-devel = %{version}-%{release}
197 Obsoletes: db-java-devel
199 Conflicts: db-devel < 4.1.25-3
201 %description java-devel
202 Development files for db-java library.
204 %description java-devel -l pl.UTF-8
205 Pliki programistyczne biblioteki db-java.
208 Summary: Berkeley database library for Tcl
209 Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
210 Group: Development/Languages/Tcl
212 %if %{with default_db}
213 Provides: db-tcl = %{version}-%{release}
218 Berkeley database library for Tcl.
220 %description tcl -l pl.UTF-8
221 Biblioteka baz danych Berkeley dla Tcl.
224 Summary: Development files for db-tcl library
225 Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
226 Group: Development/Languages/Tcl
227 Requires: %{name}-tcl = %{epoch}:%{version}-%{release}
228 %if %{with default_db}
229 Provides: db-tcl-devel = %{version}-%{release}
230 Obsoletes: db-tcl-devel
232 Conflicts: db-devel < 4.1.25-3
234 %description tcl-devel
235 Development files for db-tcl library.
237 %description tcl-devel -l pl.UTF-8
238 Pliki programistyczne biblioteki db-tcl.
241 Summary: Command line tools for managing Berkeley DB databases
242 Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
243 Group: Applications/Databases
244 Requires: %{name} = %{epoch}:%{version}-%{release}
245 %if %{with default_db}
246 Provides: db-utils = %{version}-%{release}
253 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
254 provides embedded database support for both traditional and
255 client/server applications. Berkeley DB includes B+tree, Extended
256 Linear Hashing, Fixed and Variable-length record access methods,
257 transactions, locking, logging, shared memory caching and database
258 recovery. DB supports C, C++, Java and Perl APIs.
260 This package contains command line tools for managing Berkeley DB
263 %description utils -l pl.UTF-8
264 Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
265 zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
266 klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
267 funkcje mieszające ze stałą lub zmienną wielkością rekordu,
268 transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
269 dla C, C++, Javy i Perla.
271 Ten pakiet zawiera narzędzia do obsługi baz Berkeley DB z linii
275 %setup -q -n db-%{ver}
277 %patchset_patch 1 %{patchlevel}
280 sed -i -e 's,AM_PTHREADS_SHARED("POSIX/.*,:,' dist/aclocal/mutex.ac
283 sed -i -e '/AC_PROG_LIBTOOL/aLT_OUTPUT' dist/configure.ac
287 cp -f /usr/share/aclocal/libtool.m4 aclocal/libtool.ac
288 cp -f /usr/share/aclocal/ltoptions.m4 aclocal/ltoptions.ac
289 cp -f /usr/share/aclocal/ltsugar.m4 aclocal/ltsugar.ac
290 cp -f /usr/share/aclocal/ltversion.m4 aclocal/ltversion.ac
291 cp -f /usr/share/aclocal/lt~obsolete.m4 aclocal/lt~obsolete.ac
292 cp -f /usr/share/automake/config.sub .
293 cp -f /usr/share/libtool/config/ltmain.sh .
297 %if %{with static_libs}
298 cp -a build_unix build_unix.static
304 CFLAGS="%{rpmcflags}"
305 CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
306 LDFLAGS="%{rpmcflags} %{rpmldflags}"
307 export CC CXX CFLAGS CXXFLAGS LDFLAGS
314 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
317 # (temporarily?) disabled because of compilation errors:
320 %{__make} library_build
327 --prefix=%{_prefix} \
328 --libdir=%{_libdir} \
333 --%{?with_pmutex:en}%{!?with_pmutex:dis}able-posixmutexes \
335 %{?with_java:--enable-java} \
336 %{?with_tcl:--enable-tcl --with-tcl=/usr/lib}
338 %{__make} library_build \
339 TCFLAGS='-I$(builddir) -I%{_includedir}' \
340 LIBSO_LIBS="\$(LIBS)" \
341 LIBTSO_LIBS="\$(LIBS) -ltcl"
344 rm -rf $RPM_BUILD_ROOT
345 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
347 install -d $RPM_BUILD_ROOT%{_javadir}
350 %if %{with static_libs}
351 %{__make} -C build_unix.static library_install \
352 DESTDIR=$RPM_BUILD_ROOT \
353 docdir=%{_docdir}/db-%{version}-docs \
354 includedir=%{_includedir}
357 %{__make} -C build_unix library_install \
358 DESTDIR=$RPM_BUILD_ROOT \
359 LIB_INSTALL_FILE_LIST="" \
360 docdir=%{_docdir}/db-%{version}-docs \
361 includedir=%{_includedir}
363 %if %{with default_db}
364 install -d $RPM_BUILD_ROOT/%{_lib}
365 mv $RPM_BUILD_ROOT%{_libdir}/libdb-4.4.so $RPM_BUILD_ROOT/%{_lib}
368 cd $RPM_BUILD_ROOT%{_libdir}
369 %if %{with static_libs}
370 mv -f libdb.a libdb-4.4.a
371 mv -f libdb_cxx.a libdb_cxx-4.4.a
374 mv -f $RPM_BUILD_ROOT%{_libdir}/db.jar $RPM_BUILD_ROOT%{_javadir}/db-4.4.jar
376 %if %{with default_db}
377 ln -sf /%{_lib}/libdb-4.4.so libdb.so
378 ln -sf /%{_lib}/libdb-4.4.so libdb4.so
379 ln -sf /%{_lib}/libdb-4.4.so libdb-4.4.so
380 ln -sf /%{_lib}/libdb-4.4.so libndbm.so
381 ln -sf libdb-4.4.la libdb.la
382 ln -sf libdb-4.4.la libdb4.la
383 ln -sf libdb-4.4.la libndbm.la
384 ln -sf libdb_cxx-4.4.so libdb_cxx.so
385 ln -sf libdb_cxx-4.4.la libdb_cxx.la
387 ln -sf libdb_java-4.4.la libdb_java.la
388 ln -sf db-4.4.jar $RPM_BUILD_ROOT%{_javadir}/db.jar
391 ln -sf libdb_tcl-4.4.so libdb_tcl.so
392 ln -sf libdb_tcl-4.4.la libdb_tcl.la
394 %if %{with static_libs}
395 ln -sf libdb-4.4.a libdb.a
396 ln -sf libdb-4.4.a libdb4.a
397 ln -sf libdb-4.4.a libndbm.a
398 ln -sf libdb_cxx-4.4.a libdb_cxx.a
402 sed -i "s/old_library=''/old_library='libdb-4.4.a'/" libdb-4.4.la
403 sed -i "s/old_library=''/old_library='libdb_cxx-4.4.a'/" libdb_cxx-4.4.la
407 cd $RPM_BUILD_ROOT%{_bindir}
408 mv -f berkeley_db_svc berkeley_db_svc-4.4
409 %{?with_default_db:ln -sf berkeley_db_svc-4.4 berkeley_db_svc}
411 Fver=$(echo $F|sed 's/db_/db4.4_/')
413 %{?with_default_db:ln -sf $Fver $F}
416 rm -f examples_c*/tags
417 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
418 cp -rf examples_c/* $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
420 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
421 cp -rf examples_cxx/* $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
424 install -d $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
425 cp -rf examples_java/* $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
427 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/java
431 rm -rf $RPM_BUILD_ROOT
433 %post -p /sbin/ldconfig
434 %postun -p /sbin/ldconfig
436 %post tcl -p /sbin/ldconfig
437 %postun tcl -p /sbin/ldconfig
439 %post cxx -p /sbin/ldconfig
440 %postun cxx -p /sbin/ldconfig
443 %defattr(644,root,root,755)
445 %if %{with default_db}
446 %attr(755,root,root) /%{_lib}/libdb-4.4.so
448 %attr(755,root,root) %{_libdir}/libdb-4.4.so
450 %dir %{_docdir}/db-%{version}-docs
451 %{_docdir}/db-%{version}-docs/sleepycat
452 %{_docdir}/db-%{version}-docs/index.html
455 %defattr(644,root,root,755)
456 %{_libdir}/libdb-4.4.la
457 %if %{with default_db}
458 %attr(755,root,root) %{_libdir}/libdb-4.4.so
459 %attr(755,root,root) %{_libdir}/libdb4.so
460 %attr(755,root,root) %{_libdir}/libdb.so
461 %attr(755,root,root) %{_libdir}/libndbm.so
464 %{_libdir}/libndbm.la
469 %{_includedir}/db_185.h
470 %{_docdir}/db-%{version}-docs/api_c
471 %dir %{_docdir}/db-%{version}-docs/gsg
472 %{_docdir}/db-%{version}-docs/gsg/C
473 %dir %{_docdir}/db-%{version}-docs/gsg_txn
474 %{_docdir}/db-%{version}-docs/gsg_txn/C
475 %{_docdir}/db-%{version}-docs/images
476 %{_docdir}/db-%{version}-docs/ref
477 %{_examplesdir}/db-%{version}
479 %if %{with static_libs}
481 %defattr(644,root,root,755)
482 %{_libdir}/libdb-4.4.a
483 %if %{with default_db}
491 %defattr(644,root,root,755)
492 %attr(755,root,root) %{_libdir}/libdb_cxx-4.4.so
495 %defattr(644,root,root,755)
496 %{_libdir}/libdb_cxx-4.4.la
497 %if %{with default_db}
498 %attr(755,root,root) %{_libdir}/libdb_cxx.so
499 %{_libdir}/libdb_cxx.la
501 %{_includedir}/db_cxx.h
502 %{_docdir}/db-%{version}-docs/api_cxx
503 %{_docdir}/db-%{version}-docs/gsg/CXX
504 %{_docdir}/db-%{version}-docs/gsg_txn/CXX
505 %{_examplesdir}/db-cxx-%{version}
507 %if %{with static_libs}
509 %defattr(644,root,root,755)
510 %{_libdir}/libdb_cxx-4.4.a
511 %if %{with default_db}
512 %{_libdir}/libdb_cxx.a
518 %defattr(644,root,root,755)
519 %attr(755,root,root) %{_libdir}/libdb_java-4.4.so
520 %{_javadir}/db-4.4.jar
521 %if %{with default_db}
526 %defattr(644,root,root,755)
527 %{_libdir}/libdb_java-4.4.la
528 %if %{with default_db}
529 %attr(755,root,root) %{_libdir}/libdb_java.so
530 %{_libdir}/libdb_java.la
532 %{_docdir}/db-%{version}-docs/collections
533 %{_docdir}/db-%{version}-docs/gsg/JAVA
534 %{_docdir}/db-%{version}-docs/gsg_txn/JAVA
535 %{_docdir}/db-%{version}-docs/java
536 %{_examplesdir}/db-java-%{version}
541 %defattr(644,root,root,755)
542 %attr(755,root,root) %{_libdir}/libdb_tcl-4.4.so
545 %defattr(644,root,root,755)
546 %{_libdir}/libdb_tcl-4.4.la
547 %if %{with default_db}
548 %attr(755,root,root) %{_libdir}/libdb_tcl.so
549 %{_libdir}/libdb_tcl.la
551 %{_docdir}/db-%{version}-docs/api_tcl
555 %defattr(644,root,root,755)
556 %attr(755,root,root) %{_bindir}/berkeley_db_svc-4.4
557 %attr(755,root,root) %{_bindir}/db4.4_archive
558 %attr(755,root,root) %{_bindir}/db4.4_checkpoint
559 %attr(755,root,root) %{_bindir}/db4.4_deadlock
560 %attr(755,root,root) %{_bindir}/db4.4_dump
561 #%attr(755,root,root) %{_bindir}/db4.4_dump185
562 %attr(755,root,root) %{_bindir}/db4.4_hotbackup
563 %attr(755,root,root) %{_bindir}/db4.4_load
564 %attr(755,root,root) %{_bindir}/db4.4_printlog
565 %attr(755,root,root) %{_bindir}/db4.4_recover
566 %attr(755,root,root) %{_bindir}/db4.4_stat
567 %attr(755,root,root) %{_bindir}/db4.4_upgrade
568 %attr(755,root,root) %{_bindir}/db4.4_verify
569 %if %{with default_db}
570 %attr(755,root,root) %{_bindir}/berkeley_db_svc
571 %attr(755,root,root) %{_bindir}/db_archive
572 %attr(755,root,root) %{_bindir}/db_checkpoint
573 %attr(755,root,root) %{_bindir}/db_deadlock
574 %attr(755,root,root) %{_bindir}/db_dump
575 #%attr(755,root,root) %{_bindir}/db_dump185
576 %attr(755,root,root) %{_bindir}/db_hotbackup
577 %attr(755,root,root) %{_bindir}/db_load
578 %attr(755,root,root) %{_bindir}/db_printlog
579 %attr(755,root,root) %{_bindir}/db_recover
580 %attr(755,root,root) %{_bindir}/db_stat
581 %attr(755,root,root) %{_bindir}/db_upgrade
582 %attr(755,root,root) %{_bindir}/db_verify
584 %{_docdir}/db-%{version}-docs/utility