- rel 6; docdir also belongs to utils package so it doesn't require -devel
[packages/db4.7.git] / db4.7.spec
CommitLineData
e42fa043
AM
1#
2# Conditional build:
3%bcond_without java # don't build java bindings
4%bcond_without tcl # don't build Tcl bindings
e42fa043 5%bcond_without static_libs # don't build static libraries
d3c3fe80 6
be6de178 7%if "%{pld_release}" == "ti"
8%bcond_without java_sun # build with gcj
9%else
10%bcond_with java_sun # build with java-sun
11%endif
12
13%include /usr/lib/rpm/macros.java
14
d3c3fe80
ER
15%define libver 4.7
16%define ver %{libver}.25
9f42e124 17%define patchlevel 4
e42fa043
AM
18Summary: Berkeley DB database library for C
19Summary(pl.UTF-8): Biblioteka C do obsługi baz Berkeley DB
8cf606eb 20Name: db4.7
d3c3fe80 21Version: %{ver}.%{patchlevel}
01378bdd 22Release: 6
e42fa043 23Epoch: 0
d685cba6 24License: GPL-like (see LICENSE)
e42fa043 25Group: Libraries
d3c3fe80 26Source0: http://download.oracle.com/berkeley-db/db-%{ver}.tar.gz
8cf606eb 27# Source0-md5: ec2b87e833779681a0c3a814aa71359e
d3c3fe80 28%patchset_source -f http://www.oracle.com/technology/products/berkeley-db/db/update/%{ver}/patch.%{ver}.%g 1 %{patchlevel}
e42fa043 29URL: http://www.oracle.com/technology/products/berkeley-db/index.html
e42fa043
AM
30BuildRequires: automake
31BuildRequires: ed
be6de178 32%if %{with java}
33%{!?with_java_sun:BuildRequires: java-gcj-compat-devel}
34%{?with_java_sun:BuildRequires: java-sun}
35BuildRequires: rpm >= 4.4.9-56
36BuildRequires: rpm-javaprov
37%endif
e42fa043 38BuildRequires: libstdc++-devel
d3c3fe80 39BuildRequires: rpmbuild(macros) >= 1.426
e42fa043
AM
40BuildRequires: sed >= 4.0
41%{?with_tcl:BuildRequires: tcl-devel >= 8.4.0}
2a340a9d 42Requires: uname(release) >= 2.6.0
e42fa043 43Provides: db = %{version}-%{release}
7c49495e 44Provides: db = %{libver}
e42fa043
AM
45Obsoletes: db4
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49The Berkeley Database (Berkeley DB) is a programmatic toolkit that
50provides embedded database support for both traditional and
51client/server applications. Berkeley DB is used by many applications,
52including Python and Perl, so this should be installed on all systems.
53
54%description -l pl.UTF-8
55Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
56zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
57klient-serwer. Berkeley db jest używana w wielu aplikacjach, w tym w
58Pythonie i Perlu.
59
60%package devel
61Summary: Header files for Berkeley database library
62Summary(pl.UTF-8): Pliki nagłówkowe do biblioteki Berkeley Database
63Group: Development/Libraries
64Requires: %{name} = %{epoch}:%{version}-%{release}
65Provides: db-devel = %{version}-%{release}
66Obsoletes: db3-devel
67Obsoletes: db4-devel
6f7cfbea 68Obsoletes: db4.5-devel
9bbc618c 69Obsoletes: db4.6-devel
e42fa043
AM
70
71%description devel
72The Berkeley Database (Berkeley DB) is a programmatic toolkit that
73provides embedded database support for both traditional and
74client/server applications. Berkeley DB includes B+tree, Extended
75Linear Hashing, Fixed and Variable-length record access methods,
76transactions, locking, logging, shared memory caching and database
77recovery. DB supports C, C++, Java and Perl APIs.
78
79This package contains the header files, libraries, and documentation
80for building programs which use Berkeley DB.
81
82%description devel -l pl.UTF-8
83Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
84zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
85klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
86funkcje mieszające ze stałą lub zmienną wielkością rekordu,
87transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
88dla C, C++, Javy i Perla.
89
90Ten pakiet zawiera pliki nagłówkowe i dokumentację do budowania
91programów używających Berkeley DB.
92
93%package static
94Summary: Static libraries for Berkeley database library
95Summary(pl.UTF-8): Statyczne biblioteki Berkeley Database
96Group: Development/Libraries
97Requires: %{name}-devel = %{epoch}:%{version}-%{release}
98Provides: db-static = %{version}-%{release}
99Obsoletes: db3-static
100Obsoletes: db4-static
cb2e9750 101Obsoletes: db4.5-static
102Obsoletes: db4.6-static
e42fa043
AM
103
104%description static
105The Berkeley Database (Berkeley DB) is a programmatic toolkit that
106provides embedded database support for both traditional and
107client/server applications. Berkeley DB includes B+tree, Extended
108Linear Hashing, Fixed and Variable-length record access methods,
109transactions, locking, logging, shared memory caching and database
110recovery. DB supports C, C++, Java and Perl APIs.
111
112This package contains the static libraries for building programs which
113use Berkeley DB.
114
115%description static -l pl.UTF-8
116Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
117zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
118klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
119funkcje mieszające ze stałą lub zmienną wielkością rekordu,
120transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
121dla C, C++, Javy i Perla.
122
123Ten pakiet zawiera statyczne biblioteki do budowania programów
124używających Berkeley DB.
125
126%package cxx
127Summary: Berkeley database library for C++
128Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla C++
129Group: Libraries
130Provides: db-cxx = %{version}-%{release}
131Obsoletes: db4-cxx
132
133%description cxx
134Berkeley database library for C++.
135
136%description cxx -l pl.UTF-8
137Biblioteka baz danych Berkeley dla C++.
138
139%package cxx-devel
140Summary: Header files for db-cxx library
141Summary(pl.UTF-8): Pliki nagłówkowe biblioteki db-cxx
142Group: Development/Libraries
143Requires: %{name}-cxx = %{epoch}:%{version}-%{release}
144Requires: %{name}-devel = %{epoch}:%{version}-%{release}
145Provides: db-cxx-devel = %{version}-%{release}
146Conflicts: db-devel < 4.1.25-3
147
148%description cxx-devel
149Header files for db-cxx library.
150
151%description cxx-devel -l pl.UTF-8
152Pliki nagłówkowe biblioteki db-cxx.
153
154%package cxx-static
155Summary: Static version of db-cxx library
156Summary(pl.UTF-8): Statyczna wersja biblioteki db-cxx
157Group: Development/Libraries
158Requires: %{name}-cxx-devel = %{epoch}:%{version}-%{release}
159Provides: db-cxx-static = %{version}-%{release}
160Conflicts: db-static < 4.2.50-1
161
162%description cxx-static
163Static version of db-cxx library.
164
165%description cxx-static -l pl.UTF-8
166Statyczna wersja biblioteki db-cxx.
167
168%package java
169Summary: Berkeley database library for Java
170Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Javy
171Group: Libraries
fc4b1ff1 172Requires: jpackage-utils
e42fa043
AM
173Provides: db-java = %{version}-%{release}
174
175%description java
176Berkeley database library for Java.
177
178%description java -l pl.UTF-8
179Biblioteka baz danych Berkeley dla Javy.
180
181%package java-devel
182Summary: Development files for db-java library
183Summary(pl.UTF-8): Pliki programistyczne biblioteki db-java
184Group: Development/Languages/Java
185Requires: %{name}-java = %{epoch}:%{version}-%{release}
186Provides: db-java-devel = %{version}-%{release}
187Conflicts: db-devel < 4.1.25-3
188
189%description java-devel
190Development files for db-java library.
191
192%description java-devel -l pl.UTF-8
193Pliki programistyczne biblioteki db-java.
194
195%package tcl
196Summary: Berkeley database library for Tcl
197Summary(pl.UTF-8): Biblioteka baz danych Berkeley dla Tcl
198Group: Development/Languages/Tcl
199Requires: tcl
200Provides: db-tcl = %{version}-%{release}
201Obsoletes: db4-tcl
202
203%description tcl
204Berkeley database library for Tcl.
205
206%description tcl -l pl.UTF-8
207Biblioteka baz danych Berkeley dla Tcl.
208
209%package tcl-devel
210Summary: Development files for db-tcl library
211Summary(pl.UTF-8): Pliki programistyczne biblioteki db-tcl
212Group: Development/Languages/Tcl
213Requires: %{name}-tcl = %{epoch}:%{version}-%{release}
214Provides: db-tcl-devel = %{version}-%{release}
215Conflicts: db-devel < 4.1.25-3
216
217%description tcl-devel
218Development files for db-tcl library.
219
220%description tcl-devel -l pl.UTF-8
221Pliki programistyczne biblioteki db-tcl.
222
223%package utils
224Summary: Command line tools for managing Berkeley DB databases
225Summary(pl.UTF-8): Narzędzia do obsługi baz Berkeley DB z linii poleceń
226Group: Applications/Databases
227Requires: %{name} = %{epoch}:%{version}-%{release}
228Provides: db-utils = %{version}-%{release}
e42fa043 229Obsoletes: db3-utils
d3c3fe80 230Obsoletes: db4-utils
e42fa043
AM
231
232%description utils
233The Berkeley Database (Berkeley DB) is a programmatic toolkit that
234provides embedded database support for both traditional and
235client/server applications. Berkeley DB includes B+tree, Extended
236Linear Hashing, Fixed and Variable-length record access methods,
237transactions, locking, logging, shared memory caching and database
238recovery. DB supports C, C++, Java and Perl APIs.
239
240This package contains command line tools for managing Berkeley DB
241databases.
242
243%description utils -l pl.UTF-8
244Berkeley Database (Berkeley DB) to zestaw narzędzi programistycznych
245zapewniających obsługę baz danych w aplikacjach tradycyjnych jak i
246klient-serwer. Berkeley DB obsługuje dostęp do bazy przez B-drzewa i
247funkcje mieszające ze stałą lub zmienną wielkością rekordu,
248transakcje, kroniki, pamięć dzieloną i odtwarzanie baz. Ma wsparcie
249dla C, C++, Javy i Perla.
250
251Ten pakiet zawiera narzędzia do obsługi baz Berkeley DB z linii
252poleceń.
253
254%prep
d3c3fe80
ER
255%setup -q -n db-%{ver}
256
257# official patches
258%patchset_patch 1 %{patchlevel}
e42fa043
AM
259
260%build
d685cba6 261cp -f /usr/share/automake/config.sub dist
e42fa043 262
be6de178 263JAVACFLAGS="-source 1.5 -target 1.5"
264export JAVACFLAGS
265
e42fa043
AM
266%if %{with static_libs}
267cp -a build_unix build_unix.static
268
269cd build_unix.static
270
271CC="%{__cc}"
272CXX="%{__cxx}"
273CFLAGS="%{rpmcflags}"
274CXXFLAGS="%{rpmcflags} -fno-implicit-templates"
275LDFLAGS="%{rpmcflags} %{rpmldflags}"
be6de178 276
e42fa043
AM
277export CC CXX CFLAGS CXXFLAGS LDFLAGS
278
279../dist/%configure \
280 --enable-compat185 \
281 --disable-shared \
282 --enable-static \
283 --enable-rpc \
8cf606eb 284 --enable-posixmutexes \
e42fa043
AM
285 --enable-cxx
286
287# (temporarily?) disabled because of compilation errors:
288# --enable-dump185 \
289
290%{__make} library_build
291cd ..
292%endif
293
294cd build_unix
295
296../dist/%configure \
297 --prefix=%{_prefix} \
298 --libdir=%{_libdir} \
299 --enable-compat185 \
300 --enable-rpc \
8cf606eb 301 --enable-posixmutexes \
e42fa043
AM
302 --enable-cxx \
303 %{?with_tcl:--enable-tcl} \
304 %{?with_tcl:--with-tcl=/usr/lib} \
305 %{?with_java:--enable-java} \
306 --disable-static \
307 --enable-shared
308
309%{__make} library_build \
310 TCFLAGS='-I$(builddir) -I%{_includedir}' \
311 LIBSO_LIBS="\$(LIBS)" \
312 LIBTSO_LIBS="\$(LIBS) -ltcl"
313
314%install
315rm -rf $RPM_BUILD_ROOT
316install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir},/%{_lib}}
317%if %{with java}
318install -d $RPM_BUILD_ROOT%{_javadir}
319%endif
320
321%if %{with static_libs}
322%{__make} -C build_unix.static library_install \
323 docdir=%{_docdir}/db-%{version}-docs \
324 DESTDIR=$RPM_BUILD_ROOT
325%endif
326
327%{__make} -C build_unix library_install \
328 docdir=%{_docdir}/db-%{version}-docs \
329 DESTDIR=$RPM_BUILD_ROOT \
330 LIB_INSTALL_FILE_LIST=""
331
d3c3fe80 332mv $RPM_BUILD_ROOT%{_libdir}/libdb-%{libver}.so $RPM_BUILD_ROOT/%{_lib}
e42fa043
AM
333
334cd $RPM_BUILD_ROOT%{_libdir}
d3c3fe80
ER
335ln -sf /%{_lib}/libdb-%{libver}.so libdb.so
336ln -sf /%{_lib}/libdb-%{libver}.so libdb4.so
337ln -sf /%{_lib}/libdb-%{libver}.so libdb-%{libver}.so
338ln -sf /%{_lib}/libdb-%{libver}.so libndbm.so
339ln -sf libdb-%{libver}.la libdb.la
340ln -sf libdb-%{libver}.la libdb4.la
341ln -sf libdb-%{libver}.la libndbm.la
e42fa043 342%if %{with java}
d3c3fe80 343ln -sf libdb_java-%{libver}.la libdb_java.la
e42fa043
AM
344mv -f $RPM_BUILD_ROOT%{_libdir}/*.jar $RPM_BUILD_ROOT%{_javadir}
345%endif
346%if %{with tcl}
d3c3fe80
ER
347ln -sf libdb_tcl-%{libver}.so libdb_tcl.so
348ln -sf libdb_tcl-%{libver}.la libdb_tcl.la
e42fa043 349%endif
d3c3fe80 350ln -sf libdb_cxx-%{libver}.la libdb_cxx.la
e42fa043 351%if %{with static_libs}
d3c3fe80
ER
352mv -f libdb.a libdb-%{libver}.a
353ln -sf libdb-%{libver}.a libdb.a
354ln -sf libdb-%{libver}.a libdb4.a
355ln -sf libdb-%{libver}.a libndbm.a
356mv -f libdb_cxx.a libdb_cxx-%{libver}.a
357ln -sf libdb_cxx-%{libver}.a libdb_cxx.a
e42fa043 358%endif
d3c3fe80 359ln -sf libdb_cxx-%{libver}.so libdb_cxx.so
e42fa043 360
d3c3fe80
ER
361sed -i "s/old_library=''/old_library='libdb-%{libver}.a'/" libdb-%{libver}.la
362sed -i "s/old_library=''/old_library='libdb_cxx-%{libver}.a'/" libdb_cxx-%{libver}.la
e42fa043
AM
363
364cd -
365rm -f examples_c*/tags
366install -d $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
367cp -rf examples_c/* $RPM_BUILD_ROOT%{_examplesdir}/db-%{version}
368
369install -d $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
370cp -rf examples_cxx/* $RPM_BUILD_ROOT%{_examplesdir}/db-cxx-%{version}
371
372%if %{with java}
373install -d $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
374cp -rf examples_java/* $RPM_BUILD_ROOT%{_examplesdir}/db-java-%{version}
375%endif
376
14bb5365
ER
377# in %doc
378rm -f $RPM_BUILD_ROOT%{_docdir}/db-%{version}-docs/{index.html,license/license_db.html}
379
e42fa043
AM
380%clean
381rm -rf $RPM_BUILD_ROOT
382
383%post -p /sbin/ldconfig
384%postun -p /sbin/ldconfig
385
386%post tcl -p /sbin/ldconfig
387%postun tcl -p /sbin/ldconfig
388
389%post cxx -p /sbin/ldconfig
390%postun cxx -p /sbin/ldconfig
391
392%files
393%defattr(644,root,root,755)
14bb5365 394%doc LICENSE README docs/index.html docs/license
d3c3fe80 395%attr(755,root,root) /%{_lib}/libdb-%{libver}.so
e42fa043
AM
396
397%files devel
398%defattr(644,root,root,755)
d3c3fe80 399%attr(755,root,root) %{_libdir}/libdb-%{libver}.so
e42fa043
AM
400%attr(755,root,root) %{_libdir}/libdb4.so
401%attr(755,root,root) %{_libdir}/libdb.so
402%attr(755,root,root) %{_libdir}/libndbm.so
d3c3fe80 403%{_libdir}/libdb-%{libver}.la
e42fa043
AM
404%{_libdir}/libdb4.la
405%{_libdir}/libdb.la
406%{_libdir}/libndbm.la
407%{_includedir}/db.h
408%{_includedir}/db_185.h
14bb5365 409%dir %{_docdir}/db-%{version}-docs
e42fa043 410%{_docdir}/db-%{version}-docs/api_c
c5e6f1b4 411%{_docdir}/db-%{version}-docs/articles
e42fa043
AM
412%dir %{_docdir}/db-%{version}-docs/gsg
413%{_docdir}/db-%{version}-docs/gsg/C
414%dir %{_docdir}/db-%{version}-docs/gsg_txn
415%{_docdir}/db-%{version}-docs/gsg_txn/C
416%dir %{_docdir}/db-%{version}-docs/gsg_db_rep
417%{_docdir}/db-%{version}-docs/gsg_db_rep/C
418%{_docdir}/db-%{version}-docs/images
14bb5365 419%{_docdir}/db-%{version}-docs/porting
e42fa043
AM
420%{_docdir}/db-%{version}-docs/ref
421%{_examplesdir}/db-%{version}
422
423%if %{with static_libs}
424%files static
425%defattr(644,root,root,755)
d3c3fe80 426%{_libdir}/libdb-%{libver}.a
e42fa043
AM
427%{_libdir}/libdb4.a
428%{_libdir}/libdb.a
429%{_libdir}/libndbm.a
430%endif
431
432%files cxx
433%defattr(644,root,root,755)
d3c3fe80 434%attr(755,root,root) %{_libdir}/libdb_cxx-%{libver}.so
e42fa043
AM
435
436%files cxx-devel
437%defattr(644,root,root,755)
438%attr(755,root,root) %{_libdir}/libdb_cxx.so
d3c3fe80 439%{_libdir}/libdb_cxx-%{libver}.la
e42fa043
AM
440%{_libdir}/libdb_cxx.la
441%{_includedir}/db_cxx.h
442%{_docdir}/db-%{version}-docs/api_cxx
443%{_docdir}/db-%{version}-docs/gsg/CXX
444%{_docdir}/db-%{version}-docs/gsg_txn/CXX
445%{_docdir}/db-%{version}-docs/gsg_db_rep/CXX
446%{_examplesdir}/db-cxx-%{version}
447
448%if %{with static_libs}
449%files cxx-static
450%defattr(644,root,root,755)
d3c3fe80 451%{_libdir}/libdb_cxx-%{libver}.a
e42fa043
AM
452%{_libdir}/libdb_cxx.a
453%endif
454
455%if %{with java}
456%files java
457%defattr(644,root,root,755)
d3c3fe80 458%attr(755,root,root) %{_libdir}/libdb_java-%{libver}.so
e42fa043
AM
459%{_javadir}/db.jar
460
461%files java-devel
462%defattr(644,root,root,755)
463%attr(755,root,root) %{_libdir}/libdb_java.so
d3c3fe80 464%{_libdir}/libdb_java-%{libver}.la
e42fa043
AM
465%{_libdir}/libdb_java.la
466%{_docdir}/db-%{version}-docs/collections
467%{_docdir}/db-%{version}-docs/gsg/JAVA
468%{_docdir}/db-%{version}-docs/gsg_txn/JAVA
469%{_docdir}/db-%{version}-docs/gsg_db_rep/JAVA
470%{_docdir}/db-%{version}-docs/java
471%{_examplesdir}/db-java-%{version}
472%endif
473
474%if %{with tcl}
475%files tcl
476%defattr(644,root,root,755)
d3c3fe80 477%attr(755,root,root) %{_libdir}/libdb_tcl-%{libver}.so
e42fa043
AM
478
479%files tcl-devel
480%defattr(644,root,root,755)
481%attr(755,root,root) %{_libdir}/libdb_tcl.so
d3c3fe80 482%{_libdir}/libdb_tcl-%{libver}.la
e42fa043
AM
483%{_libdir}/libdb_tcl.la
484%{_docdir}/db-%{version}-docs/api_tcl
485%endif
486
487%files utils
488%defattr(644,root,root,755)
489%attr(755,root,root) %{_bindir}/berkeley_db_svc
490%attr(755,root,root) %{_bindir}/db*_archive
491%attr(755,root,root) %{_bindir}/db*_checkpoint
492%attr(755,root,root) %{_bindir}/db*_codegen
493%attr(755,root,root) %{_bindir}/db*_deadlock
494%attr(755,root,root) %{_bindir}/db*_dump
495#%attr(755,root,root) %{_bindir}/db*_dump185
496%attr(755,root,root) %{_bindir}/db*_hotbackup
497%attr(755,root,root) %{_bindir}/db*_load
498%attr(755,root,root) %{_bindir}/db*_printlog
499%attr(755,root,root) %{_bindir}/db*_recover
500%attr(755,root,root) %{_bindir}/db*_stat
501%attr(755,root,root) %{_bindir}/db*_upgrade
502%attr(755,root,root) %{_bindir}/db*_verify
01378bdd 503%dir %{_docdir}/db-%{version}-docs
e42fa043 504%{_docdir}/db-%{version}-docs/utility
This page took 0.189432 seconds and 4 git commands to generate.