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