source: spec/trunk/SPECS/db4.spec@ 201

Last change on this file since 201 was 168, checked in by Yuri Dario, 14 years ago

spec: massive rebuild due to new rpm lx parser updates (see changeset:167).

File size: 11.1 KB
Line 
1# the set of arches on which libgcj provides gcj and libgcj-javac-placeholder.sh
2#%define java_arches __%{ix86} alpha ia64 ppc sparc sparcv9 x86_64 s390 s390x
3%define java_arches 0
4%define __soversion 4.8
5%define __dllversion 48
6
7# switch back to md5 file digests (due to rpm) until the dust settles a bit
8%define _source_filedigest_algorithm 0
9%define _binary_filedigest_algorithm 0
10
11Summary: The Berkeley DB database library (version 4) for C
12Name: db4
13Version: 4.8.30
14Release: 4%{?dist}
15Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
16
17Patch0: db-os2.diff
18
19URL: http://www.oracle.com/database/berkeley-db/
20License: BSD
21Group: System Environment/Libraries
22# unversioned obsoletes are OK here as these BDB versions never occur again
23Obsoletes: db1, db2, db3
24
25Requires: mmap >= 20110102
26
27#BuildRequires: perl, libtool, ed, util-linux-ng
28BuildRequires: tcl-devel >= 8.5.2-3
29%ifarch %{java_arches}
30BuildRequires: gcc-java
31BuildRequires: java-1.6.0-openjdk-devel
32%endif
33BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
34
35%description
36The Berkeley Database (Berkeley DB) is a programmatic toolkit that
37provides embedded database support for both traditional and
38client/server applications. The Berkeley DB includes B+tree, Extended
39Linear Hashing, Fixed and Variable-length record access methods,
40transactions, locking, logging, shared memory caching, and database
41recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
42used by many applications, including Python and Perl, so this should
43be installed on all systems.
44
45%package cxx
46Summary: The Berkeley DB database library (version 4) for C++
47Group: System Environment/Libraries
48
49%description cxx
50The Berkeley Database (Berkeley DB) is a programmatic toolkit that
51provides embedded database support for both traditional and
52client/server applications. The Berkeley DB includes B+tree, Extended
53Linear Hashing, Fixed and Variable-length record access methods,
54transactions, locking, logging, shared memory caching, and database
55recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
56used by many applications, including Python and Perl, so this should
57be installed on all systems.
58
59%package utils
60Summary: Command line tools for managing Berkeley DB (version 4) databases
61Group: Applications/Databases
62Requires: db4 = %{version}-%{release}
63Obsoletes: db1-utils, db2-utils, db3-utils
64
65%description utils
66The Berkeley Database (Berkeley DB) is a programmatic toolkit that
67provides embedded database support for both traditional and
68client/server applications. Berkeley DB includes B+tree, Extended
69Linear Hashing, Fixed and Variable-length record access methods,
70transactions, locking, logging, shared memory caching, and database
71recovery. DB supports C, C++, Java and Perl APIs.
72
73%package devel
74Summary: C development files for the Berkeley DB (version 4) library
75Group: Development/Libraries
76Requires: db4 = %{version}-%{release}
77Obsoletes: db1-devel, db2-devel, db3-devel
78
79%description devel
80The Berkeley Database (Berkeley DB) is a programmatic toolkit that
81provides embedded database support for both traditional and
82client/server applications. This package contains the header files,
83libraries, and documentation for building programs which use the
84Berkeley DB.
85
86%package devel-static
87Summary: Berkeley DB (version 4) static libraries
88Group: Development/Libraries
89
90%description devel-static
91The Berkeley Database (Berkeley DB) is a programmatic toolkit that
92provides embedded database support for both traditional and
93client/server applications. This package contains static libraries
94needed for applications that require statical linking of
95Berkeley DB.
96
97#%package tcl
98#Summary: Development files for using the Berkeley DB (version 4) with tcl
99#Group: Development/Libraries
100#Requires: %{name} = %{version}-%{release}
101
102#%description tcl
103#The Berkeley Database (Berkeley DB) is a programmatic toolkit that
104#provides embedded database support for both traditional and
105#client/server applications. This package contains the libraries
106#for building programs which use the Berkeley DB in Tcl.
107
108#%package java
109#Summary: Development files for using the Berkeley DB (version 4) with Java
110#Group: Development/Libraries
111#Requires: %{name} = %{version}-%{release}
112
113#%description java
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 Java.
118
119%prep
120%setup -q -n db-%{version}
121
122%patch0 -p1 -b .os2~
123
124# Remove tags files which we don't need.
125find . -name tags | xargs rm -f
126# Define a shell function for fixing HREF references in the docs, which
127# would otherwise break when we split the docs up into subpackages.
128fixup_href() {
129 for doc in $@ ; do
130 chmod u+w ${doc}
131 sed -e 's,="../api_c/,="../../%{name}-devel-%{version}/api_c/,g' \
132 -e 's,="api_c/,="../%{name}-devel-%{version}/api_c/,g' \
133 -e 's,="../api_cxx/,="../../%{name}-devel-%{version}/api_cxx/,g' \
134 -e 's,="api_cxx/,="../%{name}-devel-%{version}/api_cxx/,g' \
135 -e 's,="../api_tcl/,="../../%{name}-devel-%{version}/api_tcl/,g' \
136 -e 's,="api_tcl/,="../%{name}-devel-%{version}/api_tcl/,g' \
137 -e 's,="../java/,="../../%{name}-devel-%{version}/java/,g' \
138 -e 's,="java/,="../%{name}-devel-%{version}/java/,g' \
139 -e 's,="../examples_c/,="../../%{name}-devel-%{version}/examples_c/,g' \
140 -e 's,="examples_c/,="../%{name}-devel-%{version}/examples_c/,g' \
141 -e 's,="../examples_cxx/,="../../%{name}-devel-%{version}/examples_cxx/,g' \
142 -e 's,="examples_cxx/,="../%{name}-devel-%{version}/examples_cxx/,g' \
143 -e 's,="../ref/,="../../%{name}-devel-%{version}/ref/,g' \
144 -e 's,="ref/,="../%{name}-devel-%{version}/ref/,g' \
145 -e 's,="../images/,="../../%{name}-devel-%{version}/images/,g' \
146 -e 's,="images/,="../%{name}-devel-%{version}/images/,g' \
147 -e 's,="../utility/,="../../%{name}-utils-%{version}/utility/,g' \
148 -e 's,="utility/,="../%{name}-utils-%{version}/utility/,g' ${doc} > ${doc}.new
149 touch -r ${doc} ${doc}.new
150 cat ${doc}.new > ${doc}
151 touch -r ${doc}.new ${doc}
152 rm -f ${doc}.new
153 done
154}
155
156set +x
157# Fix all of the HTML files.
158fixup_href `find . -name "*.html"`
159set -x
160
161#cd dist
162#./s_config
163
164mkdir dist/os2
165
166%build
167export CONFIG_SHELL="/bin/sh"
168export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
169export LIBS="-lurpo -lmmap -lpthread"
170export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
171
172# Build the old db-185 libraries.
173#make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
174
175cd dist/os2
176ln -sf ../configure .
177
178 # XXX --enable-diagnostic should be disabled for production (but is
179 # useful).
180 # XXX --enable-debug_{r,w}op should be disabled for production.
181 %configure -C \
182 --enable-tcl --with-tcl=/@unixroot/usr/lib \
183 --disable-shared --enable-static \
184 --disable-cxx \
185 --disable-java \
186%ifarch %{java_arches}
187 --enable-java \
188%else
189 --disable-java \
190%endif
191 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache" \
192 # --enable-diagnostic \
193 # --enable-debug --enable-debug_rop --enable-debug_wop \
194
195 # Remove libtool predep_objects and postdep_objects wonkiness so that
196 # building without -nostdlib doesn't include them twice. Because we
197 # already link with g++, weird stuff happens if you don't let the
198 # compiler handle this.
199# perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
200# perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
201# perl -pi -e 's/-shared -nostdlib/-shared/' libtool
202
203 make %{?_smp_mflags}
204
205# # XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai
206# LDBJ=./.libs/libdb_java-%{__soversion}.la
207# if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
208# sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
209# fi
210
211
212%install
213rm -rf ${RPM_BUILD_ROOT}
214mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
215mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
216
217%makeinstall -C dist/os2
218
219cp dist/os2/libdb-%{__soversion}_s.a ${RPM_BUILD_ROOT}%{_libdir}
220
221# XXX Nuke non-versioned archives and symlinks
222rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdb.a
223rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdb_cxx.a
224
225# Move the main shared library from /usr/lib* to /lib* directory.
226#if [ "%{_libdir}" != "/%{_lib}" ]; then
227# mkdir -p $RPM_BUILD_ROOT/%{_lib}/
228# mv $RPM_BUILD_ROOT/%{_libdir}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_lib}/
229# Leave relative symlinks in %{_libdir}.
230# touch $RPM_BUILD_ROOT/rootfile
231# root=..
232# while [ ! -e $RPM_BUILD_ROOT/%{_libdir}/${root}/rootfile ] ; do
233# root=${root}/..
234# done
235# rm $RPM_BUILD_ROOT/rootfile
236#
237# ln -sf ${root}/%{_lib}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/libdb.so
238# ln -sf ${root}/%{_lib}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/
239# ln -sf libdb_cxx-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/libdb_cxx.so
240#fi
241
242# add symlink without version number
243ln -s libdb-%{__soversion}.a $RPM_BUILD_ROOT/%{_libdir}/libdb.a
244
245# Move the header files to a subdirectory, in case we're deploying on a
246# system with multiple versions of DB installed.
247mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/db4
248mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/db4/
249
250# Create symlinks to includes so that "use <db.h> and link with -ldb" works.
251# db_185.h
252for i in db.h db_cxx.h; do
253 ln -s db4/$i ${RPM_BUILD_ROOT}%{_includedir}
254done
255
256%ifarch %{java_arches}
257# Move java jar file to the correct place
258mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
259mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
260%endif
261
262# Eliminate installed doco
263rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
264
265# XXX Avoid Permission denied. strip when building as non-root.
266#chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
267
268# remove unneeded .la files (#225675)
269rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
270
271%clean
272rm -rf ${RPM_BUILD_ROOT}
273
274#%post -p /sbin/ldconfig
275
276#%postun -p /sbin/ldconfig
277
278#%post -p /sbin/ldconfig tcl
279
280#%postun -p /sbin/ldconfig tcl
281
282#%post -p /sbin/ldconfig java
283
284#%postun -p /sbin/ldconfig java
285
286%files
287%defattr(-,root,root)
288%doc LICENSE README
289%{_libdir}/db%{__dllversion}.dll
290
291#%files cxx
292#%defattr(-,root,root)
293#%{_libdir}/libdb_cxx-%{__soversion}.so
294
295%files utils
296%defattr(-,root,root)
297%{_bindir}/db*_archive.exe
298%{_bindir}/db*_checkpoint.exe
299%{_bindir}/db*_deadlock.exe
300%{_bindir}/db*_dump*.exe
301%{_bindir}/db*_hotbackup.exe
302%{_bindir}/db*_load.exe
303%{_bindir}/db*_printlog.exe
304%{_bindir}/db*_recover.exe
305%{_bindir}/db*_sql.exe
306%{_bindir}/db*_stat.exe
307%{_bindir}/db*_upgrade.exe
308%{_bindir}/db*_verify.exe
309
310%files devel
311%defattr(-,root,root)
312#%doc docs/*
313#%doc examples_c examples_cxx
314%{_libdir}/db*.dll
315#%{_libdir}/libdb_cxx.so
316%{_libdir}/libdb-%{__soversion}.a
317%{_libdir}/libdb.a
318%dir %{_includedir}/%{name}
319%{_includedir}/%{name}/db.h
320#%{_includedir}/%{name}/db_185.h
321%{_includedir}/%{name}/db_cxx.h
322%{_includedir}/db.h
323#%{_includedir}/db_185.h
324%{_includedir}/db_cxx.h
325
326%files devel-static
327%defattr(-,root,root)
328%{_libdir}/libdb-%{__soversion}_s.a
329#%{_libdir}/libdb_cxx-%{__soversion}.a
330#%{_libdir}/libdb_tcl-%{__soversion}.a
331%ifarch %{java_arches}
332%{_libdir}/libdb_java-%{__soversion}.a
333%endif
334
335#%files tcl
336#%defattr(-,root,root)
337#%{_libdir}/libdb_tcl-%{__soversion}.so
338
339#%ifarch %{java_arches}
340#%files java
341#%defattr(-,root,root)
342#%doc docs/java
343#%doc examples_java
344#%{_libdir}/libdb_java*.so
345#%{_datadir}/java/*.jar
346#%endif
347
348%changelog
Note: See TracBrowser for help on using the repository browser.