1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/db/db.spec Wed Apr 01 16:24:45 2009 +0200 1.3 @@ -0,0 +1,184 @@ 1.4 +## 1.5 +## db.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package version 1.28 +%define V_version 4.7.25 1.29 +%define V_revision 3 1.30 + 1.31 +# package information 1.32 +Name: db 1.33 +Summary: Berkeley-DB Library 1.34 +URL: http://www.oracle.com/database/berkeley-db.html 1.35 +Vendor: Keith Bostic 1.36 +Packager: OpenPKG Foundation e.V. 1.37 +Distribution: OpenPKG Community 1.38 +Class: BASE 1.39 +Group: Database 1.40 +License: BSD 1.41 +Version: %{V_version}.%{V_revision} 1.42 +Release: 20081221 1.43 + 1.44 +# package options 1.45 +%option with_pthreads no 1.46 +%option with_compat no 1.47 +%option with_cxx no 1.48 + 1.49 +# package options sanity check 1.50 +%if "%{with_pthreads}" == "yes" 1.51 + %{warn: WARNING: enabling Pthreads will potentially let other packages fail to build! } 1.52 +%endif 1.53 + 1.54 +# list of sources 1.55 +Source0: http://download-uk.oracle.com/berkeley-db/db-%{V_version}.tar.gz 1.56 +Source1: db.pc 1.57 +Patch0: db.patch 1.58 +Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.1 1.59 +Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.2 1.60 +Patch3: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.3 1.61 + 1.62 +# build information 1.63 +Prefix: %{l_prefix} 1.64 +BuildRoot: %{l_buildroot} 1.65 +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc 1.66 +PreReq: OpenPKG, openpkg >= 20040130 1.67 +%if "%{with_cxx}" == "yes" 1.68 +BuildPreReq: gcc::with_cxx = yes 1.69 +%endif 1.70 +AutoReq: no 1.71 +AutoReqProv: no 1.72 + 1.73 +%description 1.74 + Berkeley DB is a programmatic toolkit that provides high-performance 1.75 + built-in database support for desktop and server applications and 1.76 + for information appliances. The Berkeley DB access methods include 1.77 + B+tree, Extended Linear Hashing, Fixed and Variable-length records, 1.78 + and Queues. Berkeley DB provides full transactional support, 1.79 + database recovery, online backups, and separate access to locking, 1.80 + logging and shared memory caching subsystems. 1.81 + 1.82 +%track 1.83 + prog db = { 1.84 + version = %{V_version} 1.85 + url = http://www.oracle.com/technology/software/products/berkeley-db/index.html 1.86 + regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz 1.87 + } 1.88 + 1.89 +%prep 1.90 + %setup -q -n db-%{V_version} 1.91 + %patch -p0 -P 0 1.92 + %patch -p0 -P 1 1.93 + %patch -p0 -P 2 1.94 + %patch -p0 -P 3 1.95 + 1.96 + %{l_shtool} subst \ 1.97 + -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \ 1.98 + -e 's;install_utilities install_docs;install_utilities;' \ 1.99 + dist/Makefile.in 1.100 + 1.101 +%build 1.102 + # configure library 1.103 +%if "%{with_pthreads}" == "yes" 1.104 + mutex="POSIX/pthreads" 1.105 +%else 1.106 + mutex="no" 1.107 + case "%{l_platform -p}" in 1.108 + amd64-* ) mutex="x86_64/gcc-assembly";; 1.109 + ix86-* ) mutex="x86/gcc-assembly" ;; 1.110 + ia64-* ) mutex="ia64/gcc-assembly" ;; 1.111 + sparc*-* ) mutex="Sparc/gcc-assembly" ;; 1.112 + ppc*-* ) mutex="PPC/gcc-assembly" ;; 1.113 + alpha*-* ) mutex="ALPHA/gcc-assembly" ;; 1.114 + * ) mutex="UNIX/fcntl" ;; 1.115 + esac 1.116 +%endif 1.117 + cd build_unix 1.118 + CC="%{l_cc}" \ 1.119 + CFLAGS="%{l_cflags -O}" \ 1.120 +%if "%{with_cxx}" == "yes" 1.121 + CXX="%{l_cxx}" \ 1.122 + CXXFLAGS="%{l_cxxflags -O}" \ 1.123 +%endif 1.124 + GREP="grep" \ 1.125 + ../dist/configure \ 1.126 + --prefix=%{l_prefix} \ 1.127 +%if "%{with_compat}" == "yes" 1.128 + --enable-compat185 \ 1.129 +%else 1.130 + --disable-compat185 \ 1.131 +%endif 1.132 +%if "%{with_cxx}" == "yes" 1.133 + --enable-cxx \ 1.134 +%else 1.135 + --disable-cxx \ 1.136 +%endif 1.137 + --disable-java \ 1.138 + --with-mutex="$mutex" \ 1.139 +%if "%{with_pthreads}" == "yes" 1.140 + --enable-pthread_api \ 1.141 +%endif 1.142 + --disable-shared 1.143 + 1.144 + # build library 1.145 + ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o 1.146 + %{l_make} %{l_mflags -O} 1.147 + 1.148 +%install 1.149 + # install library 1.150 + rm -rf $RPM_BUILD_ROOT 1.151 + ( cd build_unix 1.152 + %{l_make} %{l_mflags} install \ 1.153 + prefix=$RPM_BUILD_ROOT%{l_prefix} 1.154 + ) || exit $? 1.155 + 1.156 + # strip down installation 1.157 + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a 1.158 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 1.159 +%if "%{with_compat}" == "no" 1.160 + rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h 1.161 +%endif 1.162 +%if "%{with_cxx}" == "no" 1.163 + rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h 1.164 + rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h 1.165 +%endif 1.166 + 1.167 + # install pkg-config configuration 1.168 + libs="-ldb" 1.169 + case "%{l_platform -t}" in 1.170 + *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;; 1.171 + esac 1.172 + %{l_shtool} mkdir -f -p -m 755 \ 1.173 + $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig 1.174 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.175 + -e "s;@version@;%{version};" \ 1.176 + -e "s;@libs@;$libs;" \ 1.177 + %{SOURCE db.pc} \ 1.178 + $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/ 1.179 + 1.180 + # determine installation files 1.181 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 1.182 + 1.183 +%files -f files 1.184 + 1.185 +%clean 1.186 + rm -rf $RPM_BUILD_ROOT 1.187 +