]>
Commit | Line | Data |
---|---|---|
fd88317a JR |
1 | %define __soversion 3.1 |
2 | %define _libdb_a libdb-%{__soversion}.a | |
3 | ||
4 | Summary: BSD database library for C | |
5 | Name: db3 | |
6 | Version: 3.1.14 | |
08bc0c20 | 7 | Release: 1 |
4c8f2663 | 8 | Group: Libraries |
fd88317a JR |
9 | License: GPL |
10 | URL: http://www.sleepycat.com | |
11 | Source0: http://www.sleepycat.com/update/%{version}/db-%{version}.tar.gz | |
12 | #Patch0: http://www.sleepycat.com/update/%{version}/patch.3.0.55.1 | |
13 | Patch0: db3-align.patch | |
14 | Patch1: db3-linux-threads.patch | |
15 | Patch2: db3-shmget.patch | |
16 | PreReq: /sbin/ldconfig | |
08bc0c20 | 17 | |
fd88317a JR |
18 | # XXX written as a file prereq in order to build with glibc-2.1.3 |
19 | %ifos linux | |
20 | BuildPrereq: /usr/lib/libdb1.a | |
21 | %endif | |
22 | ||
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
08bc0c20 AF |
24 | |
25 | %description | |
fd88317a JR |
26 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that |
27 | provides embedded database support for both traditional and | |
28 | client/server applications. Berkeley DB is used by many applications, | |
29 | including Python and Perl, so this should be installed on all systems. | |
30 | ||
31 | %package utils | |
32 | Summary: Command line tools for managing Berkeley DB databases. | |
33 | Group: Applications/Databases | |
34 | Group(pl): Aplikacje/Bazy danych | |
35 | Requires: %{name} = %{version} | |
36 | ||
37 | %description utils | |
38 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that | |
39 | provides embedded database support for both traditional and | |
40 | client/server applications. Berkeley DB includes B+tree, Extended | |
41 | Linear Hashing, Fixed and Variable-length record access methods, | |
42 | transactions, locking, logging, shared memory caching and database | |
43 | recovery. DB supports C, C++, Java and Perl APIs. | |
44 | ||
45 | This package contains command line tools for managing Berkeley DB | |
46 | databases. | |
08bc0c20 AF |
47 | |
48 | %package devel | |
fd88317a | 49 | Summary: Development libraries and header files for Berkeley database library |
4c8f2663 | 50 | Group: Development/Libraries |
51 | Group(fr): Development/Librairies | |
52 | Group(pl): Programowanie/Biblioteki | |
53 | Requires: %{name} = %{version} | |
08bc0c20 AF |
54 | |
55 | %description devel | |
fd88317a JR |
56 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that |
57 | provides embedded database support for both traditional and | |
58 | client/server applications. Berkeley DB includes B+tree, Extended | |
59 | Linear Hashing, Fixed and Variable-length record access methods, | |
60 | transactions, locking, logging, shared memory caching and database | |
61 | recovery. DB supports C, C++, Java and Perl APIs. | |
62 | ||
63 | This package contains the header files, libraries, and documentation | |
64 | for building programs which use Berkeley DB. | |
65 | ||
66 | %package static | |
67 | Summary: Static libraries for Berkeley database library | |
68 | Group: Development/Libraries | |
69 | Group(fr): Development/Librairies | |
70 | Group(pl): Programowanie/Biblioteki | |
71 | Requires: %{name}-devel = %{version} | |
08bc0c20 | 72 | |
fd88317a JR |
73 | %description static |
74 | The Berkeley Database (Berkeley DB) is a programmatic toolkit that | |
75 | provides embedded database support for both traditional and | |
76 | client/server applications. Berkeley DB includes B+tree, Extended | |
77 | Linear Hashing, Fixed and Variable-length record access methods, | |
78 | transactions, locking, logging, shared memory caching and database | |
79 | recovery. DB supports C, C++, Java and Perl APIs. | |
80 | ||
81 | This package contains the static libraries for building programs which use | |
82 | Berkeley DB. | |
08bc0c20 AF |
83 | |
84 | %prep | |
fd88317a JR |
85 | %setup -q -n db-%{version} |
86 | #%patch0 -p0 | |
87 | #%patch1 -p1 | |
88 | # XXX not applied | |
89 | #%patch1 -p1 | |
08bc0c20 AF |
90 | |
91 | %build | |
fd88317a JR |
92 | |
93 | cd build_unix | |
94 | ||
95 | # XXX --enable-tcl can't add without picking up dependency on libtcl.so | |
96 | # XXX --enable-posixmutexes (missing pthread_{cond,mutex}attr_setpshared) | |
97 | # XXX --enable-cxx (barfs on clone proto in %{_includedir}/bits/sched.h) | |
98 | # XXX --enable-debug_{r,w}op should be disabled for production. | |
99 | CFLAGS="$RPM_OPT_FLAGS" ../dist/configure --prefix=%{_prefix} --enable-debug --enable-compat185 --enable-diagnostic --enable-dump185 --enable-shared --enable-static --enable-rpc --enable-tcl # --enable-test --enable-debug --enable-debug_rop --enable-debug_wop # --enable-posixmutexes | |
100 | ||
101 | %{__make} libdb=%{_libdb_a} %{_libdb_a} | |
102 | ||
103 | # Static link with old db-185 libraries. | |
104 | /bin/sh ./libtool --mode=compile cc -c -O2 -g -g -I%{_includedir}/db1 -I../dist/../include -D_REENTRANT ../dist/../db_dump185/db_dump185.c | |
105 | cc -s -static -o db_dump185 db_dump185.lo -L%{_libdir} -ldb1 | |
106 | ||
107 | # Compile rest normally. | |
108 | %{__make} libdb=%{_libdb_a} TCFLAGS='-I$(builddir) -I%{_includedir}' LDFLAGS="-s" | |
08bc0c20 AF |
109 | |
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
fd88317a JR |
112 | install -d ${RPM_BUILD_ROOT}%{_includedir} |
113 | install -d ${RPM_BUILD_ROOT}%{_libdir} | |
114 | ||
115 | cd build_unix | |
08bc0c20 | 116 | |
fd88317a JR |
117 | # XXX install_tcl |
118 | # XXX install_static_cxx | |
119 | # XXX install_dynamic_cxx | |
120 | # XXX install_java | |
121 | # XXX install_docs (handled by %docs) | |
122 | %{__make} libdb=%{_libdb_a} LDFLAGS="-s" prefix=${RPM_BUILD_ROOT}%{_prefix} install_include install_dynamic install_static install_tcl install_utilities | |
08bc0c20 | 123 | |
fd88317a JR |
124 | # XXX annoying |
125 | set -x | |
126 | ( cd ${RPM_BUILD_ROOT} | |
127 | ||
128 | %ifos linux | |
129 | install -d ./lib | |
130 | mv -f .%{_libdir}/libdb[-.]*so* ./lib | |
131 | if [ "%{_libdir}" != "%{_libdir}" ]; then | |
132 | install -d .%{_libdir} | |
133 | mv -f .%{_libdir}/libdb* .%{_libdir} | |
134 | fi | |
135 | %endif | |
136 | ||
137 | mkdir -p .%{_includedir}/db3 | |
138 | mv -f .%{_prefix}/include/*.h .%{_includedir}/db3 | |
139 | ln -sf db3/db.h .%{_includedir}/db.h | |
140 | # for F in .%{_prefix}/bin/db_* ; do | |
141 | # mv $F `echo $F | sed -e 's,/db_,/db3_,'` | |
142 | # done | |
143 | ) | |
144 | set +x | |
08bc0c20 AF |
145 | |
146 | %clean | |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
fd88317a JR |
149 | %post -p /sbin/ldconfig |
150 | %postun -p /sbin/ldconfig | |
151 | ||
08bc0c20 AF |
152 | %files |
153 | %defattr(644,root,root,755) | |
fd88317a JR |
154 | %doc LICENSE README docs/images |
155 | %ifos linux | |
156 | /lib/libdb-%{__soversion}.so | |
157 | %else | |
158 | %{_libdir}/libdb-%{__soversion}.so | |
159 | %endif | |
160 | ||
161 | %files utils | |
162 | %defattr(644,root,root,755) | |
163 | %doc docs/utility | |
164 | %{_libdir}/libdb_tcl-%{__soversion}.so | |
165 | %attr(755,root,root) %{_bindir}/berkeley_db_svc | |
166 | %attr(755,root,root) %{_bindir}/db*_archive | |
167 | %attr(755,root,root) %{_bindir}/db*_checkpoint | |
168 | %attr(755,root,root) %{_bindir}/db*_deadlock | |
169 | %attr(755,root,root) %{_bindir}/db*_dump | |
170 | %attr(755,root,root) %{_bindir}/db*_dump185 | |
171 | %attr(755,root,root) %{_bindir}/db*_load | |
172 | %attr(755,root,root) %{_bindir}/db*_printlog | |
173 | %attr(755,root,root) %{_bindir}/db*_recover | |
174 | %attr(755,root,root) %{_bindir}/db*_stat | |
175 | %attr(755,root,root) %{_bindir}/db*_upgrade | |
176 | %attr(755,root,root) %{_bindir}/db*_verify | |
08bc0c20 AF |
177 | |
178 | %files devel | |
179 | %defattr(644,root,root,755) | |
fd88317a JR |
180 | %doc docs/api_c docs/api_cxx docs/api_java docs/api_tcl docs/index.html |
181 | %doc docs/ref docs/sleepycat | |
182 | %doc examples_c examples_cxx | |
183 | %{_libdir}/libdb-%{__soversion}.la | |
184 | %{_libdir}/libdb_tcl-%{__soversion}.la | |
185 | %{_libdir}/%{_libdb_a} | |
186 | %{_includedir}/db3/db.h | |
187 | %{_includedir}/db3/db_185.h | |
188 | %{_includedir}/db3/db_cxx.h | |
189 | %{_includedir}/db.h | |
190 | %ifos linux | |
191 | /lib/libdb.so | |
192 | %else | |
193 | %{_libdir}/libdb.so | |
194 | %endif | |
195 | %{_libdir}/libdb_tcl.so | |
08bc0c20 | 196 | |
fd88317a JR |
197 | %files static |
198 | %defattr(644,root,root,755) | |
199 | %{_libdir}/%{_libdb_a} |