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 URL: http://www.oracle.com/database/berkeley-db/
10 License: BSD-3-Clause and LGPL-2.0+
11 Group: System/Libraries
12 BuildRequires: perl libtool
13 BuildRequires: chrpath
14 Conflicts: filesystem < 3
17 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
18 provides embedded database support for both traditional and
19 client/server applications. The Berkeley DB includes B+tree, Extended
20 Linear Hashing, Fixed and Variable-length record access methods,
21 transactions, locking, logging, shared memory caching, and database
22 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
23 used by many applications, including Python and Perl, so this should
24 be installed on all systems.
27 Summary: Command line tools for managing Berkeley DB databases
28 Group: Applications/Core Applications
29 Requires: %{name}%{?_isa} = %{version}-%{release}
32 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
33 provides embedded database support for both traditional and
34 client/server applications. 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. DB supports C, C++, Java and Perl APIs.
40 Summary: C development files for the Berkeley DB library
41 Group: Development/Libraries
42 Requires: %{name}%{?_isa} = %{version}-%{release}
45 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
46 provides embedded database support for both traditional and
47 client/server applications. This package contains the header files,
48 libraries, and documentation for building programs which use the
52 Summary: C development documentation files for the Berkeley DB library
54 Requires: %{name} = %{version}-%{release}
55 Requires: %{name}-devel = %{version}-%{release}
58 %description devel-doc
59 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
60 provides embedded database support for both traditional and
61 client/server applications. This package contains the header files,
62 libraries, and documentation for building programs which use the
66 Summary: Berkeley DB static libraries
67 Group: Development/Libraries
68 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
70 %description devel-static
71 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
72 provides embedded database support for both traditional and
73 client/server applications. This package contains static libraries
74 needed for applications that require static linking of
78 Summary: The Berkeley DB database library for C++
79 Group: System/Libraries
80 Requires: %{name}%{?_isa} = %{version}-%{release}
83 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
84 provides embedded database support for both traditional and
85 client/server applications. The Berkeley DB includes B+tree, Extended
86 Linear Hashing, Fixed and Variable-length record access methods,
87 transactions, locking, logging, shared memory caching, and database
88 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
89 used by many applications, including Python and Perl, so this should
90 be installed on all systems.
93 Summary: The Berkeley DB database library for C++
94 Group: System/Libraries
95 Requires: %{name}-cxx%{?_isa} = %{version}-%{release}
96 Requires: %{name}-devel%{?_isa} = %{version}-%{release}
98 %description cxx-devel
99 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
100 provides embedded database support for both traditional and
101 client/server applications. The Berkeley DB includes B+tree, Extended
102 Linear Hashing, Fixed and Variable-length record access methods,
103 transactions, locking, logging, shared memory caching, and database
104 recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
105 used by many applications, including Python and Perl, so this should
106 be installed on all systems.
109 Summary: Development files for using the Berkeley DB with sql
110 Group: Development/Libraries
111 Requires: %{name}%{?_isa} = %{version}-%{release}
114 The Berkeley Database (Berkeley DB) is a programmatic toolkit that
115 provides embedded database support for both traditional and
116 client/server applications. This package contains the libraries
117 for building programs which use the Berkeley DB in SQL.
120 Summary: Development files for using the Berkeley DB with sql
121 Group: Development/Libraries
122 Requires: %{name}-sql%{?_isa} = %{version}-%{release}
124 %description sql-devel
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 SQL.
131 %setup -q -n db-%{version}
137 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
138 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/"
141 # Build the old db-185 libraries.
142 make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
144 test -d dist/dist-tls || mkdir dist/dist-tls
145 # Static link db_dump185 with old db-185 libraries.
146 /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
147 /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
150 ln -sf ../configure .
152 --enable-compat185 --enable-dump185 \
153 --enable-shared --enable-static \
154 --enable-cxx --enable-sql \
160 # Remove libtool predep_objects and postdep_objects wonkiness so that
161 # building without -nostdlib doesn't include them twice. Because we
162 # already link with g++, weird stuff happens if you don't let the
163 # compiler handle this.
164 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
165 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
166 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
172 rm -rf ${RPM_BUILD_ROOT}
173 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
174 mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
176 # Force off stripping of installed binaries
177 %makeinstall STRIP=/bin/true -C dist/dist-tls
179 # XXX Nuke non-versioned archives and symlinks
180 rm -f ${RPM_BUILD_ROOT}%{_libdir}/{libdb.a,libdb_cxx.a,libdb_sql.a}
182 chmod +x ${RPM_BUILD_ROOT}%{_libdir}/*.so*
184 # Move the header files to a subdirectory, in case we're deploying on a
185 # system with multiple versions of DB installed.
186 mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
187 mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/
189 # Create symlinks to includes so that "use <db.h> and link with -ldb" works.
190 for i in db.h db_cxx.h db_185.h; do
191 ln -s %{name}/$i ${RPM_BUILD_ROOT}%{_includedir}
194 # Eliminate installed doco
195 rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
197 # XXX Avoid Permission denied. strip when building as non-root.
198 chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
200 # remove unneeded .la files (#225675)
201 rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
204 chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/*
206 # unify documentation and examples, remove stuff we don't need
208 rm -rf examples/csharp
209 rm -rf docs/installation
213 rm -rf ${RPM_BUILD_ROOT}
215 %post -p /sbin/ldconfig
217 %postun -p /sbin/ldconfig
219 %post -p /sbin/ldconfig cxx
221 %postun -p /sbin/ldconfig cxx
223 %post -p /sbin/ldconfig sql
225 %postun -p /sbin/ldconfig sql
228 %defattr(-,root,root,-)
230 %{_libdir}/libdb-%{__soversion}.so
231 %{_libdir}/libdb-%{__soversion_major}.so
234 %defattr(-,root,root,-)
236 %dir %{_includedir}/%{name}
237 %{_includedir}/%{name}/db.h
238 %{_includedir}/%{name}/db_185.h
240 %{_includedir}/db_185.h
243 %defattr(-,root,root,-)
247 %defattr(-,root,root,-)
248 %{_libdir}/libdb-%{__soversion}.a
249 %{_libdir}/libdb_cxx-%{__soversion}.a
250 %{_libdir}/libdb_sql-%{__soversion}.a
253 %defattr(-,root,root,-)
254 %{_bindir}/db*_archive
255 %{_bindir}/db*_checkpoint
256 %{_bindir}/db*_deadlock
258 %{_bindir}/db*_hotbackup
260 %{_bindir}/db*_printlog
261 %{_bindir}/db*_recover
262 %{_bindir}/db*_replicate
264 %{_bindir}/db*_upgrade
265 %{_bindir}/db*_verify
269 %defattr(-,root,root,-)
270 %{_libdir}/libdb_cxx-%{__soversion}.so
271 %{_libdir}/libdb_cxx-%{__soversion_major}.so
274 %defattr(-,root,root,-)
275 %{_includedir}/%{name}/db_cxx.h
276 %{_includedir}/db_cxx.h
277 %{_libdir}/libdb_cxx.so
280 %defattr(-,root,root,-)
281 %{_libdir}/libdb_sql-%{__soversion}.so
282 %{_libdir}/libdb_sql-%{__soversion_major}.so
285 %defattr(-,root,root,-)
287 %{_libdir}/libdb_sql.so
288 %{_includedir}/%{name}/dbsql.h