Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
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@689 | 26 | %define V_revision 4 |
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@689 | 39 | Release: 20120800 |
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@689 | 58 | Patch4: http://www.oracle.com/technology/products/berkeley-db/db/update/%{V_version}/patch.%{V_version}.4 |
michael@121 | 59 | |
michael@121 | 60 | # build information |
michael@121 | 61 | Prefix: %{l_prefix} |
michael@121 | 62 | BuildRoot: %{l_buildroot} |
michael@121 | 63 | BuildPreReq: OpenPKG, openpkg >= 20040130, gcc |
michael@121 | 64 | PreReq: OpenPKG, openpkg >= 20040130 |
michael@121 | 65 | %if "%{with_cxx}" == "yes" |
michael@121 | 66 | BuildPreReq: gcc::with_cxx = yes |
michael@121 | 67 | %endif |
michael@121 | 68 | AutoReq: no |
michael@121 | 69 | AutoReqProv: no |
michael@121 | 70 | |
michael@121 | 71 | %description |
michael@121 | 72 | Berkeley DB is a programmatic toolkit that provides high-performance |
michael@121 | 73 | built-in database support for desktop and server applications and |
michael@121 | 74 | for information appliances. The Berkeley DB access methods include |
michael@121 | 75 | B+tree, Extended Linear Hashing, Fixed and Variable-length records, |
michael@121 | 76 | and Queues. Berkeley DB provides full transactional support, |
michael@121 | 77 | database recovery, online backups, and separate access to locking, |
michael@121 | 78 | logging and shared memory caching subsystems. |
michael@121 | 79 | |
michael@121 | 80 | %track |
michael@121 | 81 | prog db = { |
michael@121 | 82 | version = %{V_version} |
michael@121 | 83 | url = http://www.oracle.com/technology/software/products/berkeley-db/index.html |
michael@121 | 84 | regex = Berkeley\s+DB\s+(__VER__)\s+\.tar\.gz |
michael@121 | 85 | } |
michael@121 | 86 | |
michael@121 | 87 | %prep |
michael@121 | 88 | %setup -q -n db-%{V_version} |
michael@121 | 89 | %patch -p0 -P 0 |
michael@121 | 90 | %patch -p0 -P 1 |
michael@121 | 91 | %patch -p0 -P 2 |
michael@121 | 92 | %patch -p0 -P 3 |
michael@689 | 93 | %patch -p0 -P 4 |
michael@121 | 94 | |
michael@121 | 95 | %{l_shtool} subst \ |
michael@121 | 96 | -e 's;\($(ar) cr .*\);\1 _udivdi3.o _muldi3.o _clz.o;' \ |
michael@121 | 97 | -e 's;install_utilities install_docs;install_utilities;' \ |
michael@121 | 98 | dist/Makefile.in |
michael@122 | 99 | %{l_shtool} subst \ |
michael@122 | 100 | -e 's;u_int\([0-9][0-9]*_t\);uint\1;g' \ |
michael@122 | 101 | build_brew/db_int.h dist/aclocal/types.m4 \ |
michael@122 | 102 | dist/configure dbinc_auto/* dbinc/* \ |
michael@122 | 103 | btree/* common/* crypto/* db_archive/* db_checkpoint/* \ |
michael@122 | 104 | db_codegen/* db_deadlock/* db_dump/* db_hotbackup/* \ |
michael@122 | 105 | db_load/* db_printlog/* db_recover/* db_stat/* \ |
michael@122 | 106 | db_upgrade/* db_verify/* db/* db185/* dbreg/* env/* \ |
michael@122 | 107 | fileops/* hash/* hmac/* hsearch/* lock/* log/* \ |
michael@122 | 108 | crypto/mersenne/* mp/* mutex/* os/* qam/* rep/* \ |
michael@122 | 109 | repmgr/* crypto/rijndael/* sequence/* txn/* xa/* |
michael@121 | 110 | |
michael@121 | 111 | %build |
michael@121 | 112 | # configure library |
michael@121 | 113 | %if "%{with_pthreads}" == "yes" |
michael@121 | 114 | mutex="POSIX/pthreads" |
michael@121 | 115 | %else |
michael@121 | 116 | mutex="no" |
michael@121 | 117 | case "%{l_platform -p}" in |
michael@121 | 118 | amd64-* ) mutex="x86_64/gcc-assembly";; |
michael@121 | 119 | ix86-* ) mutex="x86/gcc-assembly" ;; |
michael@121 | 120 | ia64-* ) mutex="ia64/gcc-assembly" ;; |
michael@121 | 121 | sparc*-* ) mutex="Sparc/gcc-assembly" ;; |
michael@121 | 122 | ppc*-* ) mutex="PPC/gcc-assembly" ;; |
michael@121 | 123 | alpha*-* ) mutex="ALPHA/gcc-assembly" ;; |
michael@121 | 124 | * ) mutex="UNIX/fcntl" ;; |
michael@121 | 125 | esac |
michael@121 | 126 | %endif |
michael@121 | 127 | cd build_unix |
michael@121 | 128 | CC="%{l_cc}" \ |
michael@121 | 129 | CFLAGS="%{l_cflags -O}" \ |
michael@121 | 130 | %if "%{with_cxx}" == "yes" |
michael@121 | 131 | CXX="%{l_cxx}" \ |
michael@121 | 132 | CXXFLAGS="%{l_cxxflags -O}" \ |
michael@121 | 133 | %endif |
michael@121 | 134 | GREP="grep" \ |
michael@121 | 135 | ../dist/configure \ |
michael@121 | 136 | --prefix=%{l_prefix} \ |
michael@121 | 137 | %if "%{with_compat}" == "yes" |
michael@121 | 138 | --enable-compat185 \ |
michael@121 | 139 | %else |
michael@121 | 140 | --disable-compat185 \ |
michael@121 | 141 | %endif |
michael@121 | 142 | %if "%{with_cxx}" == "yes" |
michael@121 | 143 | --enable-cxx \ |
michael@121 | 144 | %else |
michael@121 | 145 | --disable-cxx \ |
michael@121 | 146 | %endif |
michael@121 | 147 | --disable-java \ |
michael@121 | 148 | --with-mutex="$mutex" \ |
michael@121 | 149 | %if "%{with_pthreads}" == "yes" |
michael@121 | 150 | --enable-pthread_api \ |
michael@121 | 151 | %endif |
michael@121 | 152 | --disable-shared |
michael@121 | 153 | |
michael@121 | 154 | # build library |
michael@121 | 155 | ar -vx `%{l_cc} -print-libgcc-file-name` _udivdi3.o _muldi3.o _clz.o |
michael@121 | 156 | %{l_make} %{l_mflags -O} |
michael@121 | 157 | |
michael@121 | 158 | %install |
michael@121 | 159 | # install library |
michael@121 | 160 | rm -rf $RPM_BUILD_ROOT |
michael@121 | 161 | ( cd build_unix |
michael@121 | 162 | %{l_make} %{l_mflags} install \ |
michael@121 | 163 | prefix=$RPM_BUILD_ROOT%{l_prefix} |
michael@121 | 164 | ) || exit $? |
michael@121 | 165 | |
michael@121 | 166 | # strip down installation |
michael@121 | 167 | rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libdb-[0-9]*.a |
michael@121 | 168 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
michael@121 | 169 | %if "%{with_compat}" == "no" |
michael@121 | 170 | rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_185.h |
michael@121 | 171 | %endif |
michael@121 | 172 | %if "%{with_cxx}" == "no" |
michael@121 | 173 | rm -f $RPM_BUILD_ROOT%{l_prefix}/include/db_cxx.h |
michael@121 | 174 | rm -f $RPM_BUILD_ROOT%{l_prefix}/include/cxx_*.h |
michael@121 | 175 | %endif |
michael@121 | 176 | |
michael@121 | 177 | # install pkg-config configuration |
michael@121 | 178 | libs="-ldb" |
michael@121 | 179 | case "%{l_platform -t}" in |
michael@121 | 180 | *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;; |
michael@121 | 181 | esac |
michael@121 | 182 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@121 | 183 | $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig |
michael@121 | 184 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@121 | 185 | -e "s;@version@;%{version};" \ |
michael@121 | 186 | -e "s;@libs@;$libs;" \ |
michael@121 | 187 | %{SOURCE db.pc} \ |
michael@121 | 188 | $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/ |
michael@121 | 189 | |
michael@121 | 190 | # determine installation files |
michael@121 | 191 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
michael@121 | 192 | |
michael@121 | 193 | %files -f files |
michael@121 | 194 | |
michael@121 | 195 | %clean |
michael@121 | 196 | rm -rf $RPM_BUILD_ROOT |
michael@121 | 197 |