1 %define __soversion_major 5
2 %define __soversion %{__soversion_major}.3
4 Summary: The Berkeley DB database library for C
8 Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
10 Patch24: db-4.5.20-jni-include-dir.patch
11 # License clarification patch
12 # http://devel.trisquel.info/gitweb/?p=package-helpers.git;a=blob;f=helpers/DATA/db4.8/007-mt19937db.c_license.patch;h=1036db4d337ce4c60984380b89afcaa63b2ef88f;hb=df48d40d3544088338759e8bea2e7f832a564d48
13 Patch25: 007-mt19937db.c_license.patch
14 URL: http://www.oracle.com/database/berkeley-db/
15 License: BSD-3-Clause and LGPL-2.0+
16 Group: System/Libraries
17 BuildRequires: perl libtool
18 BuildRequires: tcl-devel >= 8.5.2-3
19 BuildRequires: java-devel >= 1:1.6.0
20 BuildRequires: chrpath
21 Conflicts: filesystem < 3
24 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
25 provides embedded database support for both traditional and
26 client/server applications. The Berkeley DB includes B+tree, Extended
27 Linear Hashing, Fixed and Variable-length record access methods,
28 transactions, locking, logging, shared memory caching, and database
29 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
30 used by many applications, including Python and Perl, so this should
31 be installed on all systems.
34 Summary: Command line tools for managing Berkeley DB databases
35 Group: Applications/Core Applications
36 Requires: %{name}%{?_isa} = %{version}-%{release}
39 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
40 provides embedded database support for both traditional and
41 client/server applications. Berkeley DB includes B+tree, Extended
42 Linear Hashing, Fixed and Variable-length record access methods,
43 transactions, locking, logging, shared memory caching, and database
44 recovery. DB supports C, C++, Java and Perl APIs.
47 Summary: C development files for the Berkeley DB library
48 Group: Development/Libraries
49 Requires: %{name}%{?_isa} = %{version}-%{release}
52 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
53 provides embedded database support for both traditional and
54 client/server applications. This package contains the header files,
55 libraries, and documentation for building programs which use the
59 Summary: C development documentation files for the Berkeley DB library
61 Requires: %{name} = %{version}-%{release}
62 Requires: %{name}-devel = %{version}-%{release}
65 %description devel-doc
66 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
67 provides embedded database support for both traditional and
68 client/server applications. This package contains the header files,
69 libraries, and documentation for building programs which use the
73 Summary: Berkeley DB static libraries
74 Group: Development/Libraries
75 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
77 %description devel-static
78 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
79 provides embedded database support for both traditional and
80 client/server applications. This package contains static libraries
81 needed for applications that require static linking of
85 Summary: The Berkeley DB database library for C++
86 Group: System/Libraries
87 Requires: %{name}%{?_isa} = %{version}-%{release}
90 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
91 provides embedded database support for both traditional and
92 client/server applications. The Berkeley DB includes B+tree, Extended
93 Linear Hashing, Fixed and Variable-length record access methods,
94 transactions, locking, logging, shared memory caching, and database
95 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
96 used by many applications, including Python and Perl, so this should
97 be installed on all systems.
100 Summary: The Berkeley DB database library for C++
101 Group: System/Libraries
102 Requires: %{name}-cxx%{?_isa} = %{version}-%{release}
103 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
105 %description cxx-devel
106 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
107 provides embedded database support for both traditional and
108 client/server applications. The Berkeley DB includes B+tree, Extended
109 Linear Hashing, Fixed and Variable-length record access methods,
110 transactions, locking, logging, shared memory caching, and database
111 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
112 used by many applications, including Python and Perl, so this should
113 be installed on all systems.
116 Summary: Development files for using the Berkeley DB with tcl
117 Group: Development/Libraries
118 Requires: %{name}%{?_isa} = %{version}-%{release}
121 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
122 provides embedded database support for both traditional and
123 client/server applications. This package contains the libraries
124 for building programs which use the Berkeley DB in Tcl.
127 Summary: Development files for using the Berkeley DB with tcl
128 Group: Development/Libraries
129 Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
131 %description tcl-devel
132 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
133 provides embedded database support for both traditional and
134 client/server applications. This package contains the libraries
135 for building programs which use the Berkeley DB in Tcl.
138 Summary: Development files for using the Berkeley DB with sql
139 Group: Development/Libraries
140 Requires: %{name}%{?_isa} = %{version}-%{release}
143 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
144 provides embedded database support for both traditional and
145 client/server applications. This package contains the libraries
146 for building programs which use the Berkeley DB in SQL.
149 Summary: Development files for using the Berkeley DB with sql
150 Group: Development/Libraries
151 Requires: %{name}-sql%{?_isa} = %{version}-%{release}
153 %description sql-devel
154 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
155 provides embedded database support for both traditional and
156 client/server applications. This package contains the libraries
157 for building programs which use the Berkeley DB in SQL.
160 Summary: Development files for using the Berkeley DB with Java
161 Group: Development/Libraries
162 Requires: %{name}%{?_isa} = %{version}-%{release}
165 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
166 provides embedded database support for both traditional and
167 client/server applications. This package contains the libraries
168 for building programs which use the Berkeley DB in Java.
171 Summary: Development files for using the Berkeley DB with Java
172 Group: Development/Libraries
173 Requires: %{name}-java%{?_isa} = %{version}-%{release}
175 %description java-devel
176 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
177 provides embedded database support for both traditional and
178 client/server applications. This package contains the libraries
179 for building programs which use the Berkeley DB in Java.
182 %setup -q -n db-%{version}
184 %patch24 -p1 -b .4.5.20.jni
185 %patch25 -p1 -b .licensefix
191 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
192 CFLAGS="$CFLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -I../../../lang/sql/sqlite/ext/fts3/"
195 # Build the old db-185 libraries.
196 make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
198 test -d dist/dist-tls || mkdir dist/dist-tls
199 # Static link db_dump185 with old db-185 libraries.
200 /bin/sh libtool --tag=CC --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c util/db_dump185.c -o dist/dist-tls/db_dump185.lo
201 /bin/sh libtool --tag=LD --mode=link %{__cc} -o dist/dist-tls/db_dump185 dist/dist-tls/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
204 ln -sf ../configure .
206 --enable-compat185 --enable-dump185 \
207 --enable-shared --enable-static \
208 --enable-tcl --with-tcl=%{_libdir} \
209 --enable-cxx --enable-sql \
213 --with-tcl=%{_libdir}/tcl8.5
215 # Remove libtool predep_objects and postdep_objects wonkiness so that
216 # building without -nostdlib doesn't include them twice. Because we
217 # already link with g++, weird stuff happens if you don't let the
218 # compiler handle this.
219 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
220 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
221 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
225 # XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai
226 LDBJ=./.libs/libdb_java-%{__soversion}.la
227 if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
228 sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
233 rm -rf ${RPM_BUILD_ROOT}
234 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
235 mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
237 # Force off stripping of installed binaries
238 %makeinstall STRIP=/bin/true -C dist/dist-tls
240 # XXX Nuke non-versioned archives and symlinks
241 rm -f ${RPM_BUILD_ROOT}%{_libdir}/{libdb.a,libdb_cxx.a,libdb_tcl.a,libdb_sql.a}
243 chmod +x ${RPM_BUILD_ROOT}%{_libdir}/*.so*
245 # Move the header files to a subdirectory, in case we're deploying on a
246 # system with multiple versions of DB installed.
247 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
248 mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/
250 # Create symlinks to includes so that "use <db.h> and link with -ldb" works.
251 for i in db.h db_cxx.h db_185.h; do
252 ln -s %{name}/$i ${RPM_BUILD_ROOT}%{_includedir}
255 # Move java jar file to the correct place
256 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
257 mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
259 # Eliminate installed doco
260 rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
262 # XXX Avoid Permission denied. strip when building as non-root.
263 chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
265 # remove unneeded .la files (#225675)
266 rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
269 chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/*
271 # unify documentation and examples, remove stuff we don't need
273 rm -rf examples/csharp
274 rm -rf docs/installation
278 rm -rf ${RPM_BUILD_ROOT}
280 %post -p /sbin/ldconfig
282 %postun -p /sbin/ldconfig
284 %post -p /sbin/ldconfig cxx
286 %postun -p /sbin/ldconfig cxx
288 %post -p /sbin/ldconfig sql
290 %postun -p /sbin/ldconfig sql
292 %post -p /sbin/ldconfig tcl
294 %postun -p /sbin/ldconfig tcl
296 %post -p /sbin/ldconfig java
298 %postun -p /sbin/ldconfig java
301 %defattr(-,root,root,-)
303 %{_libdir}/libdb-%{__soversion}.so
304 %{_libdir}/libdb-%{__soversion_major}.so
307 %defattr(-,root,root,-)
309 %dir %{_includedir}/%{name}
310 %{_includedir}/%{name}/db.h
311 %{_includedir}/%{name}/db_185.h
313 %{_includedir}/db_185.h
316 %defattr(-,root,root,-)
320 %defattr(-,root,root,-)
321 %{_libdir}/libdb-%{__soversion}.a
322 %{_libdir}/libdb_cxx-%{__soversion}.a
323 %{_libdir}/libdb_tcl-%{__soversion}.a
324 %{_libdir}/libdb_sql-%{__soversion}.a
325 %{_libdir}/libdb_java-%{__soversion}.a
328 %defattr(-,root,root,-)
329 %{_bindir}/db*_archive
330 %{_bindir}/db*_checkpoint
331 %{_bindir}/db*_deadlock
333 %{_bindir}/db*_hotbackup
335 %{_bindir}/db*_printlog
336 %{_bindir}/db*_recover
337 %{_bindir}/db*_replicate
339 %{_bindir}/db*_upgrade
340 %{_bindir}/db*_verify
344 %defattr(-,root,root,-)
345 %{_libdir}/libdb_cxx-%{__soversion}.so
346 %{_libdir}/libdb_cxx-%{__soversion_major}.so
349 %defattr(-,root,root,-)
350 %{_includedir}/%{name}/db_cxx.h
351 %{_includedir}/db_cxx.h
352 %{_libdir}/libdb_cxx.so
355 %defattr(-,root,root,-)
356 %{_libdir}/libdb_tcl-%{__soversion}.so
357 %{_libdir}/libdb_tcl-%{__soversion_major}.so
360 %defattr(-,root,root,-)
361 %{_libdir}/libdb_tcl.so
364 %defattr(-,root,root,-)
365 %{_libdir}/libdb_sql-%{__soversion}.so
366 %{_libdir}/libdb_sql-%{__soversion_major}.so
369 %defattr(-,root,root,-)
371 %{_libdir}/libdb_sql.so
372 %{_includedir}/%{name}/dbsql.h
375 %defattr(-,root,root,-)
376 %{_libdir}/libdb_java-%{__soversion_major}*.so
377 %{_datadir}/java/*.jar
380 %defattr(-,root,root,-)
381 %{_libdir}/libdb_java.so