| 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 |
|
|---|
| 11 | Summary: The Berkeley DB database library (version 4) for C
|
|---|
| 12 | Name: db4
|
|---|
| 13 | Version: 4.8.30
|
|---|
| 14 | Release: 4%{?dist}
|
|---|
| 15 | Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
|
|---|
| 16 |
|
|---|
| 17 | Patch0: db-os2.diff
|
|---|
| 18 |
|
|---|
| 19 | URL: http://www.oracle.com/database/berkeley-db/
|
|---|
| 20 | License: BSD
|
|---|
| 21 | Group: System Environment/Libraries
|
|---|
| 22 | # unversioned obsoletes are OK here as these BDB versions never occur again
|
|---|
| 23 | Obsoletes: db1, db2, db3
|
|---|
| 24 |
|
|---|
| 25 | Requires: mmap >= 20110102
|
|---|
| 26 |
|
|---|
| 27 | #BuildRequires: perl, libtool, ed, util-linux-ng
|
|---|
| 28 | BuildRequires: tcl-devel >= 8.5.2-3
|
|---|
| 29 | %ifarch %{java_arches}
|
|---|
| 30 | BuildRequires: gcc-java
|
|---|
| 31 | BuildRequires: java-1.6.0-openjdk-devel
|
|---|
| 32 | %endif
|
|---|
| 33 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|---|
| 34 |
|
|---|
| 35 | %description
|
|---|
| 36 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that
|
|---|
| 37 | provides embedded database support for both traditional and
|
|---|
| 38 | client/server applications. The Berkeley DB includes B+tree, Extended
|
|---|
| 39 | Linear Hashing, Fixed and Variable-length record access methods,
|
|---|
| 40 | transactions, locking, logging, shared memory caching, and database
|
|---|
| 41 | recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
|
|---|
| 42 | used by many applications, including Python and Perl, so this should
|
|---|
| 43 | be installed on all systems.
|
|---|
| 44 |
|
|---|
| 45 | %package cxx
|
|---|
| 46 | Summary: The Berkeley DB database library (version 4) for C++
|
|---|
| 47 | Group: System Environment/Libraries
|
|---|
| 48 |
|
|---|
| 49 | %description cxx
|
|---|
| 50 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that
|
|---|
| 51 | provides embedded database support for both traditional and
|
|---|
| 52 | client/server applications. The Berkeley DB includes B+tree, Extended
|
|---|
| 53 | Linear Hashing, Fixed and Variable-length record access methods,
|
|---|
| 54 | transactions, locking, logging, shared memory caching, and database
|
|---|
| 55 | recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
|
|---|
| 56 | used by many applications, including Python and Perl, so this should
|
|---|
| 57 | be installed on all systems.
|
|---|
| 58 |
|
|---|
| 59 | %package utils
|
|---|
| 60 | Summary: Command line tools for managing Berkeley DB (version 4) databases
|
|---|
| 61 | Group: Applications/Databases
|
|---|
| 62 | Requires: db4 = %{version}-%{release}
|
|---|
| 63 | Obsoletes: db1-utils, db2-utils, db3-utils
|
|---|
| 64 |
|
|---|
| 65 | %description utils
|
|---|
| 66 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that
|
|---|
| 67 | provides embedded database support for both traditional and
|
|---|
| 68 | client/server applications. Berkeley DB includes B+tree, Extended
|
|---|
| 69 | Linear Hashing, Fixed and Variable-length record access methods,
|
|---|
| 70 | transactions, locking, logging, shared memory caching, and database
|
|---|
| 71 | recovery. DB supports C, C++, Java and Perl APIs.
|
|---|
| 72 |
|
|---|
| 73 | %package devel
|
|---|
| 74 | Summary: C development files for the Berkeley DB (version 4) library
|
|---|
| 75 | Group: Development/Libraries
|
|---|
| 76 | Requires: db4 = %{version}-%{release}
|
|---|
| 77 | Obsoletes: db1-devel, db2-devel, db3-devel
|
|---|
| 78 |
|
|---|
| 79 | %description devel
|
|---|
| 80 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that
|
|---|
| 81 | provides embedded database support for both traditional and
|
|---|
| 82 | client/server applications. This package contains the header files,
|
|---|
| 83 | libraries, and documentation for building programs which use the
|
|---|
| 84 | Berkeley DB.
|
|---|
| 85 |
|
|---|
| 86 | %package devel-static
|
|---|
| 87 | Summary: Berkeley DB (version 4) static libraries
|
|---|
| 88 | Group: Development/Libraries
|
|---|
| 89 |
|
|---|
| 90 | %description devel-static
|
|---|
| 91 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that
|
|---|
| 92 | provides embedded database support for both traditional and
|
|---|
| 93 | client/server applications. This package contains static libraries
|
|---|
| 94 | needed for applications that require statical linking of
|
|---|
| 95 | Berkeley 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.
|
|---|
| 125 | find . -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.
|
|---|
| 128 | fixup_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 |
|
|---|
| 156 | set +x
|
|---|
| 157 | # Fix all of the HTML files.
|
|---|
| 158 | fixup_href `find . -name "*.html"`
|
|---|
| 159 | set -x
|
|---|
| 160 |
|
|---|
| 161 | #cd dist
|
|---|
| 162 | #./s_config
|
|---|
| 163 |
|
|---|
| 164 | mkdir dist/os2
|
|---|
| 165 |
|
|---|
| 166 | %build
|
|---|
| 167 | export CONFIG_SHELL="/bin/sh"
|
|---|
| 168 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 169 | export LIBS="-lurpo -lmmap -lpthread"
|
|---|
| 170 | export 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 |
|
|---|
| 175 | cd dist/os2
|
|---|
| 176 | ln -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
|
|---|
| 213 | rm -rf ${RPM_BUILD_ROOT}
|
|---|
| 214 | mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
|
|---|
| 215 | mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
|
|---|
| 216 |
|
|---|
| 217 | %makeinstall -C dist/os2
|
|---|
| 218 |
|
|---|
| 219 | cp dist/os2/libdb-%{__soversion}_s.a ${RPM_BUILD_ROOT}%{_libdir}
|
|---|
| 220 |
|
|---|
| 221 | # XXX Nuke non-versioned archives and symlinks
|
|---|
| 222 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdb.a
|
|---|
| 223 | rm -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
|
|---|
| 243 | ln -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.
|
|---|
| 247 | mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/db4
|
|---|
| 248 | mv ${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
|
|---|
| 252 | for i in db.h db_cxx.h; do
|
|---|
| 253 | ln -s db4/$i ${RPM_BUILD_ROOT}%{_includedir}
|
|---|
| 254 | done
|
|---|
| 255 |
|
|---|
| 256 | %ifarch %{java_arches}
|
|---|
| 257 | # Move java jar file to the correct place
|
|---|
| 258 | mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/java
|
|---|
| 259 | mv ${RPM_BUILD_ROOT}%{_libdir}/*.jar ${RPM_BUILD_ROOT}%{_datadir}/java
|
|---|
| 260 | %endif
|
|---|
| 261 |
|
|---|
| 262 | # Eliminate installed doco
|
|---|
| 263 | rm -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)
|
|---|
| 269 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
|
|---|
| 270 |
|
|---|
| 271 | %clean
|
|---|
| 272 | rm -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
|
|---|