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
9 # db-1.85 upstream patches
10 Patch13: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4
12 Patch20: db-1.85-errno.patch
13 Patch22: db-4.6.21-1.85-compat.patch
14 Patch24: db-4.5.20-jni-include-dir.patch
15 # License clarification patch
16 # 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
17 Patch25: 007-mt19937db.c_license.patch
18 URL: http://www.oracle.com/database/berkeley-db/
19 License: BSD-3-Clause and LGPL-2.0+
20 Group: System/Libraries
21 BuildRequires: perl libtool
22 BuildRequires: tcl-devel >= 8.5.2-3
23 BuildRequires: java-devel >= 1:1.6.0
24 BuildRequires: chrpath
25 Conflicts: filesystem < 3
28 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
29 provides embedded database support for both traditional and
30 client/server applications. The Berkeley DB includes B+tree, Extended
31 Linear Hashing, Fixed and Variable-length record access methods,
32 transactions, locking, logging, shared memory caching, and database
33 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
34 used by many applications, including Python and Perl, so this should
35 be installed on all systems.
38 Summary: Command line tools for managing Berkeley DB databases
39 Group: Applications/Core Applications
40 Requires: %{name}%{?_isa} = %{version}-%{release}
43 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
44 provides embedded database support for both traditional and
45 client/server applications. Berkeley DB includes B+tree, Extended
46 Linear Hashing, Fixed and Variable-length record access methods,
47 transactions, locking, logging, shared memory caching, and database
48 recovery. DB supports C, C++, Java and Perl APIs.
51 Summary: C development files for the Berkeley DB library
52 Group: Development/Libraries
53 Requires: %{name}%{?_isa} = %{version}-%{release}
56 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
57 provides embedded database support for both traditional and
58 client/server applications. This package contains the header files,
59 libraries, and documentation for building programs which use the
63 Summary: C development documentation files for the Berkeley DB library
65 Requires: %{name} = %{version}-%{release}
66 Requires: %{name}-devel = %{version}-%{release}
69 %description devel-doc
70 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
71 provides embedded database support for both traditional and
72 client/server applications. This package contains the header files,
73 libraries, and documentation for building programs which use the
77 Summary: Berkeley DB static libraries
78 Group: Development/Libraries
79 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
81 %description devel-static
82 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
83 provides embedded database support for both traditional and
84 client/server applications. This package contains static libraries
85 needed for applications that require static linking of
89 Summary: The Berkeley DB database library for C++
90 Group: System/Libraries
91 Requires: %{name}%{?_isa} = %{version}-%{release}
94 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
95 provides embedded database support for both traditional and
96 client/server applications. The Berkeley DB includes B+tree, Extended
97 Linear Hashing, Fixed and Variable-length record access methods,
98 transactions, locking, logging, shared memory caching, and database
99 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
100 used by many applications, including Python and Perl, so this should
101 be installed on all systems.
104 Summary: The Berkeley DB database library for C++
105 Group: System/Libraries
106 Requires: %{name}-cxx%{?_isa} = %{version}-%{release}
107 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
109 %description cxx-devel
110 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
111 provides embedded database support for both traditional and
112 client/server applications. The Berkeley DB includes B+tree, Extended
113 Linear Hashing, Fixed and Variable-length record access methods,
114 transactions, locking, logging, shared memory caching, and database
115 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
116 used by many applications, including Python and Perl, so this should
117 be installed on all systems.
120 Summary: Development files for using the Berkeley DB with tcl
121 Group: Development/Libraries
122 Requires: %{name}%{?_isa} = %{version}-%{release}
125 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
126 provides embedded database support for both traditional and
127 client/server applications. This package contains the libraries
128 for building programs which use the Berkeley DB in Tcl.
131 Summary: Development files for using the Berkeley DB with tcl
132 Group: Development/Libraries
133 Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
135 %description tcl-devel
136 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
137 provides embedded database support for both traditional and
138 client/server applications. This package contains the libraries
139 for building programs which use the Berkeley DB in Tcl.
142 Summary: Development files for using the Berkeley DB with sql
143 Group: Development/Libraries
144 Requires: %{name}%{?_isa} = %{version}-%{release}
147 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
148 provides embedded database support for both traditional and
149 client/server applications. This package contains the libraries
150 for building programs which use the Berkeley DB in SQL.
153 Summary: Development files for using the Berkeley DB with sql
154 Group: Development/Libraries
155 Requires: %{name}-sql%{?_isa} = %{version}-%{release}
157 %description sql-devel
158 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
159 provides embedded database support for both traditional and
160 client/server applications. This package contains the libraries
161 for building programs which use the Berkeley DB in SQL.
164 Summary: Development files for using the Berkeley DB with Java
165 Group: Development/Libraries
166 Requires: %{name}%{?_isa} = %{version}-%{release}
169 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
170 provides embedded database support for both traditional and
171 client/server applications. This package contains the libraries
172 for building programs which use the Berkeley DB in Java.
175 Summary: Development files for using the Berkeley DB with Java
176 Group: Development/Libraries
177 Requires: %{name}-java%{?_isa} = %{version}-%{release}
179 %description java-devel
180 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
181 provides embedded database support for both traditional and
182 client/server applications. This package contains the libraries
183 for building programs which use the Berkeley DB in Java.
186 %setup -q -n db-%{version}
190 %patch20 -p1 -b .errno
193 %patch22 -p1 -b .185compat
194 %patch24 -p1 -b .4.5.20.jni
195 %patch25 -p1 -b .licensefix
201 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
202 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/"
205 # Build the old db-185 libraries.
206 make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
208 test -d dist/dist-tls || mkdir dist/dist-tls
209 # Static link db_dump185 with old db-185 libraries.
210 /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
211 /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
214 ln -sf ../configure .
216 --enable-compat185 --enable-dump185 \
217 --enable-shared --enable-static \
218 --enable-tcl --with-tcl=%{_libdir} \
219 --enable-cxx --enable-sql \
223 --with-tcl=%{_libdir}/tcl8.5
225 # Remove libtool predep_objects and postdep_objects wonkiness so that
226 # building without -nostdlib doesn't include them twice. Because we
227 # already link with g++, weird stuff happens if you don't let the
228 # compiler handle this.
229 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
230 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
231 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
235 # XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai
236 LDBJ=./.libs/libdb_java-%{__soversion}.la
237 if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
238 sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
243 rm -rf ${RPM_BUILD_ROOT}
244 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
245 mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
247 # Force off stripping of installed binaries
248 %makeinstall STRIP=/bin/true -C dist/dist-tls
250 # XXX Nuke non-versioned archives and symlinks
251 rm -f ${RPM_BUILD_ROOT}%{_libdir}/{libdb.a,libdb_cxx.a,libdb_tcl.a,libdb_sql.a}
253 chmod +x ${RPM_BUILD_ROOT}%{_libdir}/*.so*
255 # Move the header files to a subdirectory, in case we're deploying on a
256 # system with multiple versions of DB installed.
257 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
258 mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/
260 # Create symlinks to includes so that "use <db.h> and link with -ldb" works.
261 for i in db.h db_cxx.h db_185.h; do
262 ln -s %{name}/$i ${RPM_BUILD_ROOT}%{_includedir}
265 # Move java jar file to the correct place
266 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
267 mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
269 # Eliminate installed doco
270 rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
272 # XXX Avoid Permission denied. strip when building as non-root.
273 chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
275 # remove unneeded .la files (#225675)
276 rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
279 chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/*
281 # unify documentation and examples, remove stuff we don't need
283 rm -rf examples/csharp
284 rm -rf docs/installation
288 rm -rf ${RPM_BUILD_ROOT}
290 %post -p /sbin/ldconfig
292 %postun -p /sbin/ldconfig
294 %post -p /sbin/ldconfig cxx
296 %postun -p /sbin/ldconfig cxx
298 %post -p /sbin/ldconfig sql
300 %postun -p /sbin/ldconfig sql
302 %post -p /sbin/ldconfig tcl
304 %postun -p /sbin/ldconfig tcl
306 %post -p /sbin/ldconfig java
308 %postun -p /sbin/ldconfig java
311 %defattr(-,root,root,-)
313 %{_libdir}/libdb-%{__soversion}.so
314 %{_libdir}/libdb-%{__soversion_major}.so
317 %defattr(-,root,root,-)
319 %dir %{_includedir}/%{name}
320 %{_includedir}/%{name}/db.h
321 %{_includedir}/%{name}/db_185.h
323 %{_includedir}/db_185.h
326 %defattr(-,root,root,-)
330 %defattr(-,root,root,-)
331 %{_libdir}/libdb-%{__soversion}.a
332 %{_libdir}/libdb_cxx-%{__soversion}.a
333 %{_libdir}/libdb_tcl-%{__soversion}.a
334 %{_libdir}/libdb_sql-%{__soversion}.a
335 %{_libdir}/libdb_java-%{__soversion}.a
338 %defattr(-,root,root,-)
339 %{_bindir}/db*_archive
340 %{_bindir}/db*_checkpoint
341 %{_bindir}/db*_deadlock
343 %{_bindir}/db*_hotbackup
345 %{_bindir}/db*_printlog
346 %{_bindir}/db*_recover
347 %{_bindir}/db*_replicate
349 %{_bindir}/db*_upgrade
350 %{_bindir}/db*_verify
354 %defattr(-,root,root,-)
355 %{_libdir}/libdb_cxx-%{__soversion}.so
356 %{_libdir}/libdb_cxx-%{__soversion_major}.so
359 %defattr(-,root,root,-)
360 %{_includedir}/%{name}/db_cxx.h
361 %{_includedir}/db_cxx.h
362 %{_libdir}/libdb_cxx.so
365 %defattr(-,root,root,-)
366 %{_libdir}/libdb_tcl-%{__soversion}.so
367 %{_libdir}/libdb_tcl-%{__soversion_major}.so
370 %defattr(-,root,root,-)
371 %{_libdir}/libdb_tcl.so
374 %defattr(-,root,root,-)
375 %{_libdir}/libdb_sql-%{__soversion}.so
376 %{_libdir}/libdb_sql-%{__soversion_major}.so
379 %defattr(-,root,root,-)
381 %{_libdir}/libdb_sql.so
382 %{_includedir}/%{name}/dbsql.h
385 %defattr(-,root,root,-)
386 %{_libdir}/libdb_java-%{__soversion_major}*.so
387 %{_datadir}/java/*.jar
390 %defattr(-,root,root,-)
391 %{_libdir}/libdb_java.so