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 Patch0: libdb-multiarch.patch
10 # db-1.85 upstream patches
11 Patch10: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
12 Patch11: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.2
13 Patch12: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3
14 Patch13: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4
16 Patch20: db-1.85-errno.patch
17 Patch22: db-4.6.21-1.85-compat.patch
18 Patch24: db-4.5.20-jni-include-dir.patch
19 # License clarification patch
20 # 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
21 Patch25: 007-mt19937db.c_license.patch
22 URL: http://www.oracle.com/database/berkeley-db/
23 License: BSD-3-Clause and LGPL-2.0+
24 Group: System/Libraries
25 BuildRequires: perl libtool
26 BuildRequires: tcl-devel >= 8.5.2-3
27 BuildRequires: java-devel >= 1:1.6.0
28 BuildRequires: chrpath
29 Conflicts: filesystem < 3
32 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
33 provides embedded database support for both traditional and
34 client/server applications. The Berkeley DB includes B+tree, Extended
35 Linear Hashing, Fixed and Variable-length record access methods,
36 transactions, locking, logging, shared memory caching, and database
37 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
38 used by many applications, including Python and Perl, so this should
39 be installed on all systems.
42 Summary: Command line tools for managing Berkeley DB databases
43 Group: Applications/Core Applications
44 Requires: %{name}%{?_isa} = %{version}-%{release}
47 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
48 provides embedded database support for both traditional and
49 client/server applications. Berkeley DB includes B+tree, Extended
50 Linear Hashing, Fixed and Variable-length record access methods,
51 transactions, locking, logging, shared memory caching, and database
52 recovery. DB supports C, C++, Java and Perl APIs.
55 Summary: C development files for the Berkeley DB library
56 Group: Development/Libraries
57 Requires: %{name}%{?_isa} = %{version}-%{release}
60 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
61 provides embedded database support for both traditional and
62 client/server applications. This package contains the header files,
63 libraries, and documentation for building programs which use the
67 Summary: C development documentation files for the Berkeley DB library
69 Requires: %{name} = %{version}-%{release}
70 Requires: %{name}-devel = %{version}-%{release}
73 %description devel-doc
74 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
75 provides embedded database support for both traditional and
76 client/server applications. This package contains the header files,
77 libraries, and documentation for building programs which use the
81 Summary: Berkeley DB static libraries
82 Group: Development/Libraries
83 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
85 %description devel-static
86 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
87 provides embedded database support for both traditional and
88 client/server applications. This package contains static libraries
89 needed for applications that require static linking of
93 Summary: The Berkeley DB database library for C++
94 Group: System/Libraries
95 Requires: %{name}%{?_isa} = %{version}-%{release}
98 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
99 provides embedded database support for both traditional and
100 client/server applications. The Berkeley DB includes B+tree, Extended
101 Linear Hashing, Fixed and Variable-length record access methods,
102 transactions, locking, logging, shared memory caching, and database
103 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
104 used by many applications, including Python and Perl, so this should
105 be installed on all systems.
108 Summary: The Berkeley DB database library for C++
109 Group: System/Libraries
110 Requires: %{name}-cxx%{?_isa} = %{version}-%{release}
111 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
113 %description cxx-devel
114 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
115 provides embedded database support for both traditional and
116 client/server applications. The Berkeley DB includes B+tree, Extended
117 Linear Hashing, Fixed and Variable-length record access methods,
118 transactions, locking, logging, shared memory caching, and database
119 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
120 used by many applications, including Python and Perl, so this should
121 be installed on all systems.
124 Summary: Development files for using the Berkeley DB with tcl
125 Group: Development/Libraries
126 Requires: %{name}%{?_isa} = %{version}-%{release}
129 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
130 provides embedded database support for both traditional and
131 client/server applications. This package contains the libraries
132 for building programs which use the Berkeley DB in Tcl.
135 Summary: Development files for using the Berkeley DB with tcl
136 Group: Development/Libraries
137 Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
139 %description tcl-devel
140 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
141 provides embedded database support for both traditional and
142 client/server applications. This package contains the libraries
143 for building programs which use the Berkeley DB in Tcl.
146 Summary: Development files for using the Berkeley DB with sql
147 Group: Development/Libraries
148 Requires: %{name}%{?_isa} = %{version}-%{release}
151 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
152 provides embedded database support for both traditional and
153 client/server applications. This package contains the libraries
154 for building programs which use the Berkeley DB in SQL.
157 Summary: Development files for using the Berkeley DB with sql
158 Group: Development/Libraries
159 Requires: %{name}-sql%{?_isa} = %{version}-%{release}
161 %description sql-devel
162 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
163 provides embedded database support for both traditional and
164 client/server applications. This package contains the libraries
165 for building programs which use the Berkeley DB in SQL.
168 Summary: Development files for using the Berkeley DB with Java
169 Group: Development/Libraries
170 Requires: %{name}%{?_isa} = %{version}-%{release}
173 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
174 provides embedded database support for both traditional and
175 client/server applications. This package contains the libraries
176 for building programs which use the Berkeley DB in Java.
179 Summary: Development files for using the Berkeley DB with Java
180 Group: Development/Libraries
181 Requires: %{name}-java%{?_isa} = %{version}-%{release}
183 %description java-devel
184 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
185 provides embedded database support for both traditional and
186 client/server applications. This package contains the libraries
187 for building programs which use the Berkeley DB in Java.
190 %setup -q -n db-%{version}
192 %patch0 -p1 -b .multiarch
193 pushd db.1.85/PORT/linux
200 %patch20 -p1 -b .errno
203 %patch22 -p1 -b .185compat
204 %patch24 -p1 -b .4.5.20.jni
205 %patch25 -p1 -b .licensefix
211 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
212 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/"
215 # Build the old db-185 libraries.
216 make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
218 test -d dist/dist-tls || mkdir dist/dist-tls
219 # Static link db_dump185 with old db-185 libraries.
220 /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
221 /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
224 ln -sf ../configure .
226 --enable-compat185 --enable-dump185 \
227 --enable-shared --enable-static \
228 --enable-tcl --with-tcl=%{_libdir} \
229 --enable-cxx --enable-sql \
233 --with-tcl=%{_libdir}/tcl8.5
235 # Remove libtool predep_objects and postdep_objects wonkiness so that
236 # building without -nostdlib doesn't include them twice. Because we
237 # already link with g++, weird stuff happens if you don't let the
238 # compiler handle this.
239 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
240 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
241 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
245 # XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai
246 LDBJ=./.libs/libdb_java-%{__soversion}.la
247 if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
248 sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
253 rm -rf ${RPM_BUILD_ROOT}
254 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
255 mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
257 # Force off stripping of installed binaries
258 %makeinstall STRIP=/bin/true -C dist/dist-tls
260 # XXX Nuke non-versioned archives and symlinks
261 rm -f ${RPM_BUILD_ROOT}%{_libdir}/{libdb.a,libdb_cxx.a,libdb_tcl.a,libdb_sql.a}
263 chmod +x ${RPM_BUILD_ROOT}%{_libdir}/*.so*
265 # Move the header files to a subdirectory, in case we're deploying on a
266 # system with multiple versions of DB installed.
267 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
268 mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/
270 # Create symlinks to includes so that "use <db.h> and link with -ldb" works.
271 for i in db.h db_cxx.h db_185.h; do
272 ln -s %{name}/$i ${RPM_BUILD_ROOT}%{_includedir}
275 # Move java jar file to the correct place
276 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
277 mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
279 # Eliminate installed doco
280 rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
282 # XXX Avoid Permission denied. strip when building as non-root.
283 chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
285 # remove unneeded .la files (#225675)
286 rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
289 chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/*
291 # unify documentation and examples, remove stuff we don't need
293 rm -rf examples/csharp
294 rm -rf docs/installation
298 rm -rf ${RPM_BUILD_ROOT}
300 %post -p /sbin/ldconfig
302 %postun -p /sbin/ldconfig
304 %post -p /sbin/ldconfig cxx
306 %postun -p /sbin/ldconfig cxx
308 %post -p /sbin/ldconfig sql
310 %postun -p /sbin/ldconfig sql
312 %post -p /sbin/ldconfig tcl
314 %postun -p /sbin/ldconfig tcl
316 %post -p /sbin/ldconfig java
318 %postun -p /sbin/ldconfig java
321 %defattr(-,root,root,-)
323 %{_libdir}/libdb-%{__soversion}.so
324 %{_libdir}/libdb-%{__soversion_major}.so
327 %defattr(-,root,root,-)
329 %dir %{_includedir}/%{name}
330 %{_includedir}/%{name}/db.h
331 %{_includedir}/%{name}/db_185.h
333 %{_includedir}/db_185.h
336 %defattr(-,root,root,-)
340 %defattr(-,root,root,-)
341 %{_libdir}/libdb-%{__soversion}.a
342 %{_libdir}/libdb_cxx-%{__soversion}.a
343 %{_libdir}/libdb_tcl-%{__soversion}.a
344 %{_libdir}/libdb_sql-%{__soversion}.a
345 %{_libdir}/libdb_java-%{__soversion}.a
348 %defattr(-,root,root,-)
349 %{_bindir}/db*_archive
350 %{_bindir}/db*_checkpoint
351 %{_bindir}/db*_deadlock
353 %{_bindir}/db*_hotbackup
355 %{_bindir}/db*_printlog
356 %{_bindir}/db*_recover
357 %{_bindir}/db*_replicate
359 %{_bindir}/db*_upgrade
360 %{_bindir}/db*_verify
364 %defattr(-,root,root,-)
365 %{_libdir}/libdb_cxx-%{__soversion}.so
366 %{_libdir}/libdb_cxx-%{__soversion_major}.so
369 %defattr(-,root,root,-)
370 %{_includedir}/%{name}/db_cxx.h
371 %{_includedir}/db_cxx.h
372 %{_libdir}/libdb_cxx.so
375 %defattr(-,root,root,-)
376 %{_libdir}/libdb_tcl-%{__soversion}.so
377 %{_libdir}/libdb_tcl-%{__soversion_major}.so
380 %defattr(-,root,root,-)
381 %{_libdir}/libdb_tcl.so
384 %defattr(-,root,root,-)
385 %{_libdir}/libdb_sql-%{__soversion}.so
386 %{_libdir}/libdb_sql-%{__soversion_major}.so
389 %defattr(-,root,root,-)
391 %{_libdir}/libdb_sql.so
392 %{_includedir}/%{name}/dbsql.h
395 %defattr(-,root,root,-)
396 %{_libdir}/libdb_java-%{__soversion_major}*.so
397 %{_datadir}/java/*.jar
400 %defattr(-,root,root,-)
401 %{_libdir}/libdb_java.so