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

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

spec: db4, avoid hpfs386 unpacking issues.

File size: 11.5 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: 6%{?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%patch0 -p1 -b .os2~
122
123# avoid hpfs386 unpacking issues (see http://svn.netlabs.org/libc/ticket/230)
124chmod +w LICENSE README
125
126# Remove tags files which we don't need.
127find . -name tags | xargs rm -f
128# Define a shell function for fixing HREF references in the docs, which
129# would otherwise break when we split the docs up into subpackages.
130fixup_href() {
131 for doc in $@ ; do
132 chmod u+w ${doc}
133 sed -e 's,="../api_c/,="../../%{name}-devel-%{version}/api_c/,g' \
134 -e 's,="api_c/,="../%{name}-devel-%{version}/api_c/,g' \
135 -e 's,="../api_cxx/,="../../%{name}-devel-%{version}/api_cxx/,g' \
136 -e 's,="api_cxx/,="../%{name}-devel-%{version}/api_cxx/,g' \
137 -e 's,="../api_tcl/,="../../%{name}-devel-%{version}/api_tcl/,g' \
138 -e 's,="api_tcl/,="../%{name}-devel-%{version}/api_tcl/,g' \
139 -e 's,="../java/,="../../%{name}-devel-%{version}/java/,g' \
140 -e 's,="java/,="../%{name}-devel-%{version}/java/,g' \
141 -e 's,="../examples_c/,="../../%{name}-devel-%{version}/examples_c/,g' \
142 -e 's,="examples_c/,="../%{name}-devel-%{version}/examples_c/,g' \
143 -e 's,="../examples_cxx/,="../../%{name}-devel-%{version}/examples_cxx/,g' \
144 -e 's,="examples_cxx/,="../%{name}-devel-%{version}/examples_cxx/,g' \
145 -e 's,="../ref/,="../../%{name}-devel-%{version}/ref/,g' \
146 -e 's,="ref/,="../%{name}-devel-%{version}/ref/,g' \
147 -e 's,="../images/,="../../%{name}-devel-%{version}/images/,g' \
148 -e 's,="images/,="../%{name}-devel-%{version}/images/,g' \
149 -e 's,="../utility/,="../../%{name}-utils-%{version}/utility/,g' \
150 -e 's,="utility/,="../%{name}-utils-%{version}/utility/,g' ${doc} > ${doc}.new
151 touch -r ${doc} ${doc}.new
152 cat ${doc}.new > ${doc}
153 touch -r ${doc}.new ${doc}
154 rm -f ${doc}.new
155 done
156}
157
158set +x
159# Fix all of the HTML files.
160fixup_href `find . -name "*.html"`
161set -x
162
163#cd dist
164#./s_config
165
166mkdir dist/os2
167
168%build
169export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
170export LDFLAGS="-Zexe -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
171export LIBS="-lurpo -lmmap -lpthread"
172export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
173
174# Build the old db-185 libraries.
175#make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
176
177cd dist/os2
178ln -sf ../configure .
179
180 # XXX --enable-diagnostic should be disabled for production (but is
181 # useful).
182 # XXX --enable-debug_{r,w}op should be disabled for production.
183%configure -C \
184 --enable-tcl --with-tcl=/@unixroot/usr/lib \
185 --disable-shared --enable-static \
186 --enable-cxx \
187 --disable-java \
188%ifarch %{java_arches}
189 --enable-java \
190%else
191 --disable-java \
192%endif
193 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache" \
194 # --enable-diagnostic \
195 # --enable-debug --enable-debug_rop --enable-debug_wop \
196
197 # Remove libtool predep_objects and postdep_objects wonkiness so that
198 # building without -nostdlib doesn't include them twice. Because we
199 # already link with g++, weird stuff happens if you don't let the
200 # compiler handle this.
201# perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
202# perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
203# perl -pi -e 's/-shared -nostdlib/-shared/' libtool
204
205 make %{?_smp_mflags}
206
207# # XXX hack around libtool not creating ./libs/libdb_java-X.Y.lai
208# LDBJ=./.libs/libdb_java-%{__soversion}.la
209# if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
210# sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
211# fi
212
213
214%install
215rm -rf ${RPM_BUILD_ROOT}
216mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
217mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
218
219%makeinstall -C dist/os2
220
221cp dist/os2/libdb-%{__soversion}_s.a ${RPM_BUILD_ROOT}%{_libdir}
222cp dist/os2/libdb_cxx-%{__soversion}_s.a ${RPM_BUILD_ROOT}%{_libdir}
223
224# XXX Nuke non-versioned archives and symlinks
225rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdb.a
226rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdb_cxx.a
227
228# Move the main shared library from /usr/lib* to /lib* directory.
229#if [ "%{_libdir}" != "/%{_lib}" ]; then
230# mkdir -p $RPM_BUILD_ROOT/%{_lib}/
231# mv $RPM_BUILD_ROOT/%{_libdir}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_lib}/
232# Leave relative symlinks in %{_libdir}.
233# touch $RPM_BUILD_ROOT/rootfile
234# root=..
235# while [ ! -e $RPM_BUILD_ROOT/%{_libdir}/${root}/rootfile ] ; do
236# root=${root}/..
237# done
238# rm $RPM_BUILD_ROOT/rootfile
239#
240# ln -sf ${root}/%{_lib}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/libdb.so
241# ln -sf ${root}/%{_lib}/libdb-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/
242# ln -sf libdb_cxx-%{__soversion}.so $RPM_BUILD_ROOT/%{_libdir}/libdb_cxx.so
243#fi
244
245# add symlink without version number
246ln -s libdb-%{__soversion}.a $RPM_BUILD_ROOT/%{_libdir}/libdb.a
247ln -s libcxx-%{__soversion}.a $RPM_BUILD_ROOT/%{_libdir}/libdb_cxx.a
248
249# Move the header files to a subdirectory, in case we're deploying on a
250# system with multiple versions of DB installed.
251mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/db4
252mv ${RPM_BUILD_ROOT}%{_includedir}/*.h ${RPM_BUILD_ROOT}%{_includedir}/db4/
253
254# Create symlinks to includes so that "use <db.h> and link with -ldb" works.
255# db_185.h
256for i in db.h db_cxx.h; do
257 ln -s db4/$i ${RPM_BUILD_ROOT}%{_includedir}
258done
259
260%ifarch %{java_arches}
261# Move java jar file to the correct place
262mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
263mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
264%endif
265
266# Eliminate installed doco
267rm -rf ${RPM_BUILD_ROOT}%{_prefix}/docs
268
269# XXX Avoid Permission denied. strip when building as non-root.
270#chmod u+w ${RPM_BUILD_ROOT}%{_bindir} ${RPM_BUILD_ROOT}%{_bindir}/*
271
272# remove unneeded .la files (#225675)
273rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
274
275# avoid hpfs386 unpacking issues (see http://svn.netlabs.org/libc/ticket/230)
276chmod +w ${RPM_BUILD_ROOT}%{_bindir}/*.exe
277chmod +w ${RPM_BUILD_ROOT}%{_libdir}/*.dll
278
279%clean
280rm -rf ${RPM_BUILD_ROOT}
281
282%files
283%defattr(-,root,root)
284%doc LICENSE README
285%{_libdir}/db%{__dllversion}.dll
286
287%files cxx
288%defattr(-,root,root)
289%{_libdir}/db%{__dllversion}cxx.dll
290
291%files utils
292%defattr(-,root,root)
293%{_bindir}/db*_archive.exe
294%{_bindir}/db*_checkpoint.exe
295%{_bindir}/db*_deadlock.exe
296%{_bindir}/db*_dump*.exe
297%{_bindir}/db*_hotbackup.exe
298%{_bindir}/db*_load.exe
299%{_bindir}/db*_printlog.exe
300%{_bindir}/db*_recover.exe
301%{_bindir}/db*_sql.exe
302%{_bindir}/db*_stat.exe
303%{_bindir}/db*_upgrade.exe
304%{_bindir}/db*_verify.exe
305
306%files devel
307%defattr(-,root,root)
308%doc docs/*
309%doc examples_c examples_cxx
310%{_libdir}/db*.dll
311%{_libdir}/libdb-%{__soversion}.a
312%{_libdir}/libdb.a
313%{_libdir}/libdb_cxx-%{__soversion}.a
314%{_libdir}/libdb_cxx.a
315%dir %{_includedir}/%{name}
316%{_includedir}/%{name}/db.h
317#%{_includedir}/%{name}/db_185.h
318%{_includedir}/%{name}/db_cxx.h
319%{_includedir}/db.h
320#%{_includedir}/db_185.h
321%{_includedir}/db_cxx.h
322
323%files devel-static
324%defattr(-,root,root)
325%{_libdir}/libdb-%{__soversion}_s.a
326%{_libdir}/libdb_cxx-%{__soversion}_s.a
327#%{_libdir}/libdb_tcl-%{__soversion}.a
328%ifarch %{java_arches}
329%{_libdir}/libdb_java-%{__soversion}.a
330%endif
331
332#%files tcl
333#%defattr(-,root,root)
334#%{_libdir}/libdb_tcl-%{__soversion}.so
335
336#%ifarch %{java_arches}
337#%files java
338#%defattr(-,root,root)
339#%doc docs/java
340#%doc examples_java
341#%{_libdir}/libdb_java*.so
342#%{_datadir}/java/*.jar
343#%endif
344
345%changelog
346* Wed Jan 11 2012 yd
347- avoid hpfs386 unpacking issues.
348
349* Mon Jan 09 2012 yd
350- build also c++ dll.
351- include docs in developer package.
352
Note: See TracBrowser for help on using the repository browser.