michael@121: ## michael@121: ## db.spec -- OpenPKG RPM Package Specification michael@121: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@121: ## michael@121: ## Permission to use, copy, modify, and distribute this software for michael@121: ## any purpose with or without fee is hereby granted, provided that michael@121: ## the above copyright notice and this permission notice appear in all michael@121: ## copies. michael@121: ## michael@121: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@121: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@121: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@121: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@121: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@121: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@121: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@121: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@121: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@121: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@121: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@121: ## SUCH DAMAGE. michael@121: ## michael@121: michael@121: # package version michael@121: %define V_version 4.7.25 michael@689: %define V_revision 4 michael@121: michael@121: # package information michael@121: Name: db michael@121: Summary: Berkeley-DB Library michael@121: URL: http://www.oracle.com/database/berkeley-db.html michael@121: Vendor: Keith Bostic michael@121: Packager: OpenPKG Foundation e.V. michael@121: Distribution: OpenPKG Community michael@121: Class: BASE michael@121: Group: Database michael@121: License: BSD michael@121: Version: %{V_version}.%{V_revision} michael@689: Release: 20120800 michael@121: michael@121: # package options michael@121: %option with_pthreads no michael@121: %option with_compat no michael@121: %option with_cxx no michael@121: michael@121: # package options sanity check michael@121: %if "%{with_pthreads}" == "yes" michael@121: %{warn: WARNING: enabling Pthreads will potentially let other packages fail to build! } michael@121: %endif michael@121: michael@121: # list of sources michael@121: Source0: http://download-uk.oracle.com/berkeley-db/db-%{V_version}.tar.gz michael@121: Source1: db.pc michael@121: Patch0: db.patch michael@121: Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.1 michael@121: Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.2 michael@121: Patch3: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.3 michael@689: Patch4: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.4 michael@121: michael@121: # build information michael@121: Prefix: %{l_prefix} michael@121: BuildRoot: %{l_buildroot} michael@121: BuildPreReq: OpenPKG, openpkg >= 20040130, gcc michael@121: PreReq: OpenPKG, openpkg >= 20040130 michael@121: %if "%{with_cxx}" == "yes" michael@121: BuildPreReq: gcc::with_cxx = yes michael@121: %endif michael@121: AutoReq: no michael@121: AutoReqProv: no michael@121: michael@121: %description michael@121: Berkeley DB is a programmatic toolkit that provides high-performance michael@121: built-in database support for desktop and server applications and michael@121: for information appliances. The Berkeley DB access methods include michael@121: B+tree, Extended Linear Hashing, Fixed and Variable-length records, michael@121: and Queues. Berkeley DB provides full transactional support, michael@121: database recovery, online backups, and separate access to locking, michael@121: logging and shared memory caching subsystems. michael@121: michael@121: %track michael@121: prog db = { michael@121: version = %{V_version} michael@121: url = http://www.oracle.com/technology/software/products/berkeley-db/index.html michael@121: regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz michael@121: } michael@121: michael@121: %prep michael@121: %setup -q -n db-%{V_version} michael@121: %patch -p0 -P 0 michael@121: %patch -p0 -P 1 michael@121: %patch -p0 -P 2 michael@121: %patch -p0 -P 3 michael@689: %patch -p0 -P 4 michael@121: michael@121: %{l_shtool} subst \ michael@121: -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \ michael@121: -e 's;install_utilities install_docs;install_utilities;' \ michael@121: dist/Makefile.in michael@122: %{l_shtool} subst \ michael@122: -e 's;u_int\([0-9][0-9]*_t\);uint\1;g' \ michael@122: build_brew/db_int.h dist/aclocal/types.m4 \ michael@122: dist/configure dbinc_auto/* dbinc/* \ michael@122: btree/* common/* crypto/* db_archive/* db_checkpoint/* \ michael@122: db_codegen/* db_deadlock/* db_dump/* db_hotbackup/* \ michael@122: db_load/* db_printlog/* db_recover/* db_stat/* \ michael@122: db_upgrade/* db_verify/* db/* db185/* dbreg/* env/* \ michael@122: fileops/* hash/* hmac/* hsearch/* lock/* log/* \ michael@122: crypto/mersenne/* mp/* mutex/* os/* qam/* rep/* \ michael@122: repmgr/* crypto/rijndael/* sequence/* txn/* xa/* michael@121: michael@121: %build michael@121: # configure library michael@121: %if "%{with_pthreads}" == "yes" michael@121: mutex="POSIX/pthreads" michael@121: %else michael@121: mutex="no" michael@121: case "%{l_platform -p}" in michael@121: amd64-* ) mutex="x86_64/gcc-assembly";; michael@121: ix86-* ) mutex="x86/gcc-assembly" ;; michael@121: ia64-* ) mutex="ia64/gcc-assembly" ;; michael@121: sparc*-* ) mutex="Sparc/gcc-assembly" ;; michael@121: ppc*-* ) mutex="PPC/gcc-assembly" ;; michael@121: alpha*-* ) mutex="ALPHA/gcc-assembly" ;; michael@121: * ) mutex="UNIX/fcntl" ;; michael@121: esac michael@121: %endif michael@121: cd build_unix michael@121: CC="%{l_cc}" \ michael@121: CFLAGS="%{l_cflags -O}" \ michael@121: %if "%{with_cxx}" == "yes" michael@121: CXX="%{l_cxx}" \ michael@121: CXXFLAGS="%{l_cxxflags -O}" \ michael@121: %endif michael@121: GREP="grep" \ michael@121: ../dist/configure \ michael@121: --prefix=%{l_prefix} \ michael@121: %if "%{with_compat}" == "yes" michael@121: --enable-compat185 \ michael@121: %else michael@121: --disable-compat185 \ michael@121: %endif michael@121: %if "%{with_cxx}" == "yes" michael@121: --enable-cxx \ michael@121: %else michael@121: --disable-cxx \ michael@121: %endif michael@121: --disable-java \ michael@121: --with-mutex="$mutex" \ michael@121: %if "%{with_pthreads}" == "yes" michael@121: --enable-pthread_api \ michael@121: %endif michael@121: --disable-shared michael@121: michael@121: # build library michael@121: ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o michael@121: %{l_make} %{l_mflags -O} michael@121: michael@121: %install michael@121: # install library michael@121: rm -rf $RPM_BUILD_ROOT michael@121: ( cd build_unix michael@121: %{l_make} %{l_mflags} install \ michael@121: prefix=$RPM_BUILD_ROOT%{l_prefix} michael@121: ) || exit $? michael@121: michael@121: # strip down installation michael@121: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a michael@121: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@121: %if "%{with_compat}" == "no" michael@121: rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h michael@121: %endif michael@121: %if "%{with_cxx}" == "no" michael@121: rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h michael@121: rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h michael@121: %endif michael@121: michael@121: # install pkg-config configuration michael@121: libs="-ldb" michael@121: case "%{l_platform -t}" in michael@121: *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;; michael@121: esac michael@121: %{l_shtool} mkdir -f -p -m 755 \ michael@121: $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig michael@121: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@121: -e "s;@version@;%{version};" \ michael@121: -e "s;@libs@;$libs;" \ michael@121: %{SOURCE db.pc} \ michael@121: $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/ michael@121: michael@121: # determine installation files michael@121: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@121: michael@121: %files -f files michael@121: michael@121: %clean michael@121: rm -rf $RPM_BUILD_ROOT michael@121: