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