db/db.spec

Wed, 01 Apr 2009 16:24:45 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 01 Apr 2009 16:24:45 +0200
changeset 121
9c764307f9a3
child 122
d170463cc57b
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@121 1 ##
michael@121 2 ## db.spec -- OpenPKG RPM Package Specification
michael@121 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@121 4 ##
michael@121 5 ## Permission to use, copy, modify, and distribute this software for
michael@121 6 ## any purpose with or without fee is hereby granted, provided that
michael@121 7 ## the above copyright notice and this permission notice appear in all
michael@121 8 ## copies.
michael@121 9 ##
michael@121 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@121 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@121 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@121 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@121 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@121 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@121 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@121 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@121 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@121 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@121 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@121 21 ## SUCH DAMAGE.
michael@121 22 ##
michael@121 23
michael@121 24 # package version
michael@121 25 %define V_version 4.7.25
michael@121 26 %define V_revision 3
michael@121 27
michael@121 28 # package information
michael@121 29 Name: db
michael@121 30 Summary: Berkeley-DB Library
michael@121 31 URL: http://www.oracle.com/database/berkeley-db.html
michael@121 32 Vendor: Keith Bostic
michael@121 33 Packager: OpenPKG Foundation e.V.
michael@121 34 Distribution: OpenPKG Community
michael@121 35 Class: BASE
michael@121 36 Group: Database
michael@121 37 License: BSD
michael@121 38 Version: %{V_version}.%{V_revision}
michael@121 39 Release: 20081221
michael@121 40
michael@121 41 # package options
michael@121 42 %option with_pthreads no
michael@121 43 %option with_compat no
michael@121 44 %option with_cxx no
michael@121 45
michael@121 46 # package options sanity check
michael@121 47 %if "%{with_pthreads}" == "yes"
michael@121 48 %{warn: WARNING: enabling Pthreads will potentially let other packages fail to build! }
michael@121 49 %endif
michael@121 50
michael@121 51 # list of sources
michael@121 52 Source0: http://download-uk.oracle.com/berkeley-db/db-%{V_version}.tar.gz
michael@121 53 Source1: db.pc
michael@121 54 Patch0: db.patch
michael@121 55 Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.1
michael@121 56 Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.2
michael@121 57 Patch3: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.3
michael@121 58
michael@121 59 # build information
michael@121 60 Prefix: %{l_prefix}
michael@121 61 BuildRoot: %{l_buildroot}
michael@121 62 BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
michael@121 63 PreReq: OpenPKG, openpkg >= 20040130
michael@121 64 %if "%{with_cxx}" == "yes"
michael@121 65 BuildPreReq: gcc::with_cxx = yes
michael@121 66 %endif
michael@121 67 AutoReq: no
michael@121 68 AutoReqProv: no
michael@121 69
michael@121 70 %description
michael@121 71 Berkeley DB is a programmatic toolkit that provides high-performance
michael@121 72 built-in database support for desktop and server applications and
michael@121 73 for information appliances. The Berkeley DB access methods include
michael@121 74 B+tree, Extended Linear Hashing, Fixed and Variable-length records,
michael@121 75 and Queues. Berkeley DB provides full transactional support,
michael@121 76 database recovery, online backups, and separate access to locking,
michael@121 77 logging and shared memory caching subsystems.
michael@121 78
michael@121 79 %track
michael@121 80 prog db = {
michael@121 81 version = %{V_version}
michael@121 82 url = http://www.oracle.com/technology/software/products/berkeley-db/index.html
michael@121 83 regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz
michael@121 84 }
michael@121 85
michael@121 86 %prep
michael@121 87 %setup -q -n db-%{V_version}
michael@121 88 %patch -p0 -P 0
michael@121 89 %patch -p0 -P 1
michael@121 90 %patch -p0 -P 2
michael@121 91 %patch -p0 -P 3
michael@121 92
michael@121 93 %{l_shtool} subst \
michael@121 94 -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \
michael@121 95 -e 's;install_utilities install_docs;install_utilities;' \
michael@121 96 dist/Makefile.in
michael@121 97
michael@121 98 %build
michael@121 99 # configure library
michael@121 100 %if "%{with_pthreads}" == "yes"
michael@121 101 mutex="POSIX/pthreads"
michael@121 102 %else
michael@121 103 mutex="no"
michael@121 104 case "%{l_platform -p}" in
michael@121 105 amd64-* ) mutex="x86_64/gcc-assembly";;
michael@121 106 ix86-* ) mutex="x86/gcc-assembly" ;;
michael@121 107 ia64-* ) mutex="ia64/gcc-assembly" ;;
michael@121 108 sparc*-* ) mutex="Sparc/gcc-assembly" ;;
michael@121 109 ppc*-* ) mutex="PPC/gcc-assembly" ;;
michael@121 110 alpha*-* ) mutex="ALPHA/gcc-assembly" ;;
michael@121 111 * ) mutex="UNIX/fcntl" ;;
michael@121 112 esac
michael@121 113 %endif
michael@121 114 cd build_unix
michael@121 115 CC="%{l_cc}" \
michael@121 116 CFLAGS="%{l_cflags -O}" \
michael@121 117 %if "%{with_cxx}" == "yes"
michael@121 118 CXX="%{l_cxx}" \
michael@121 119 CXXFLAGS="%{l_cxxflags -O}" \
michael@121 120 %endif
michael@121 121 GREP="grep" \
michael@121 122 ../dist/configure \
michael@121 123 --prefix=%{l_prefix} \
michael@121 124 %if "%{with_compat}" == "yes"
michael@121 125 --enable-compat185 \
michael@121 126 %else
michael@121 127 --disable-compat185 \
michael@121 128 %endif
michael@121 129 %if "%{with_cxx}" == "yes"
michael@121 130 --enable-cxx \
michael@121 131 %else
michael@121 132 --disable-cxx \
michael@121 133 %endif
michael@121 134 --disable-java \
michael@121 135 --with-mutex="$mutex" \
michael@121 136 %if "%{with_pthreads}" == "yes"
michael@121 137 --enable-pthread_api \
michael@121 138 %endif
michael@121 139 --disable-shared
michael@121 140
michael@121 141 # build library
michael@121 142 ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o
michael@121 143 %{l_make} %{l_mflags -O}
michael@121 144
michael@121 145 %install
michael@121 146 # install library
michael@121 147 rm -rf $RPM_BUILD_ROOT
michael@121 148 ( cd build_unix
michael@121 149 %{l_make} %{l_mflags} install \
michael@121 150 prefix=$RPM_BUILD_ROOT%{l_prefix}
michael@121 151 ) || exit $?
michael@121 152
michael@121 153 # strip down installation
michael@121 154 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a
michael@121 155 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@121 156 %if "%{with_compat}" == "no"
michael@121 157 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h
michael@121 158 %endif
michael@121 159 %if "%{with_cxx}" == "no"
michael@121 160 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h
michael@121 161 rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h
michael@121 162 %endif
michael@121 163
michael@121 164 # install pkg-config configuration
michael@121 165 libs="-ldb"
michael@121 166 case "%{l_platform -t}" in
michael@121 167 *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;;
michael@121 168 esac
michael@121 169 %{l_shtool} mkdir -f -p -m 755 \
michael@121 170 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
michael@121 171 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@121 172 -e "s;@version@;%{version};" \
michael@121 173 -e "s;@libs@;$libs;" \
michael@121 174 %{SOURCE db.pc} \
michael@121 175 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
michael@121 176
michael@121 177 # determine installation files
michael@121 178 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@121 179
michael@121 180 %files -f files
michael@121 181
michael@121 182 %clean
michael@121 183 rm -rf $RPM_BUILD_ROOT
michael@121 184

mercurial