| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- ##
- ## db.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_version 4.5.20
- %define V_revision 2
- # package information
- Name: db
- Summary: Berkeley-DB Library
- URL: http://www.oracle.com/database/berkeley-db.html
- Vendor: Keith Bostic
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: BASE
- Group: Database
- License: BSD
- Version: %{V_version}.%{V_revision}
- Release: 20070505
- # package options
- %option with_compat no
- %option with_cxx no
- # list of sources
- Source0: http://download-uk.oracle.com/berkeley-db/db-%{V_version}.tar.gz
- Source1: db.pc
- Patch0: db.patch
- Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.1
- Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.2
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
- PreReq: OpenPKG, openpkg >= 20040130
- %if "%{with_cxx}" == "yes"
- BuildPreReq: gcc::with_cxx = yes
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- Berkeley DB is a programmatic toolkit that provides high-performance
- built-in database support for desktop and server applications and
- for information appliances. The Berkeley DB access methods include
- B+tree, Extended Linear Hashing, Fixed and Variable-length records,
- and Queues. Berkeley DB provides full transactional support,
- database recovery, online backups, and separate access to locking,
- logging and shared memory caching subsystems.
- %track
- prog db = {
- version = %{V_version}
- url = http://www.oracle.com/technology/software/products/berkeley-db/index.html
- regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz
- }
- %prep
- %setup -q -n db-%{V_version}
- %patch -p0 -P 0 1 2
- %{l_shtool} subst \
- -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \
- -e 's;install_utilities install_docs;install_utilities;' \
- dist/Makefile.in
- %build
- # configure library
- cppflags=""
- case "%{l_platform -t}" in
- sparc64-freebsd* ) cppflags="-fPIC" ;;
- esac
- mutex="no"
- case "%{l_platform -p}" in
- ix86-* ) mutex="x86/gcc-assembly" ;;
- ia64-* ) mutex="ia64/gcc-assembly" ;;
- sparc*-* ) mutex="Sparc/gcc-assembly" ;;
- ppc*-* ) mutex="PPC/gcc-assembly" ;;
- alpha*-* ) mutex="ALPHA/gcc-assembly" ;;
- * ) mutex="UNIX/fcntl" ;;
- esac
- cd build_unix
- CC="%{l_cc}" \
- CPPFLAGS="%{l_cppflags} $cppflags" \
- CFLAGS="%{l_cflags -O}" \
- %if "%{with_cxx}" == "yes"
- CXX="%{l_cxx}" \
- CXXFLAGS="%{l_cxxflags -O}" \
- %endif
- GREP="grep" \
- ../dist/configure \
- --prefix=%{l_prefix} \
- %if "%{with_compat}" == "yes"
- --enable-compat185 \
- %else
- --disable-compat185 \
- %endif
- %if "%{with_cxx}" == "yes"
- --enable-cxx \
- %else
- --disable-cxx \
- %endif
- --with-mutex="$mutex" \
- --disable-shared
- # build library
- ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o
- %{l_make} %{l_mflags -O}
- %install
- # install library
- rm -rf $RPM_BUILD_ROOT
- ( cd build_unix
- %{l_make} %{l_mflags} install \
- prefix=$RPM_BUILD_ROOT%{l_prefix} \
- ) || exit $?
- # strip down installation
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- %if "%{with_compat}" == "no"
- rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h
- %endif
- %if "%{with_cxx}" == "no"
- rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h
- rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h
- %endif
- # install pkg-config configuration
- libs="-ldb"
- case "%{l_platform -t}" in
- *-sunos* ) libs="$libs -lrt" ;;
- esac
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@version@;%{version};" \
- -e "s;@libs@;$libs;" \
- %{SOURCE db.pc} \
- $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
|