File libdb-4_8.spec of Package libdb-4_8 (Revision 3b6b672368726d72f7e4a5a749cf16e1)
Currently displaying revision 3b6b672368726d72f7e4a5a749cf16e1 , Show latest
241
1
#
2
# spec file for package libdb-4_8
3
#
4
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define util_list archive checkpoint deadlock dump hotbackup load printlog recover sql stat upgrade verify
20
%define generic_name db
21
%define major 4
22
%define minor 8
23
Name: libdb-4_8
24
Version: %{major}.%{minor}.30
25
Release: 0
26
Summary: Berkeley DB Database Library Version 4.8
27
License: Sleepycat
28
Group: System/Libraries
29
URL: https://oracle.com/technetwork/products/berkeleydb/
30
Source: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
31
Source1: %{name}.changes
32
Source2: baselibs.conf
33
Patch0: db-%{version}.patch
34
# PATCH-FIX-OPENSUSE Fix build with GCC8, conflict with reserved builtin name
35
Patch1: libdb-fix-atomic.patch
36
Patch2: 0001-OPD-deadlock-RH-BZ-1349779.patch
37
BuildRequires: autoconf
38
BuildRequires: fdupes
39
BuildRequires: gcc-c++
40
Provides: db = %{version}
41
42
%description
43
The Berkeley DB Database is a programmatic toolkit that provides
44
database support for applications.
45
46
This package contains the necessary runtime libraries.
47
48
%package -n db48-utils
49
Summary: Command Line tools for Managing Berkeley DB Databases
50
Group: Productivity/Databases/Tools
51
Requires(post): update-alternatives
52
Provides: db-utils = %{version}
53
Obsoletes: db-utils < %{version}
54
55
%description -n db48-utils
56
The Berkeley DB Database is a programmatic toolkit that provides
57
database support for applications.
58
59
This package contains the command line tools for managing Berkeley DB
60
databases.
61
62
%package -n db48-doc
63
Summary: Documentation for Berkeley DB
64
Group: Development/Libraries/C and C++
65
Provides: db-doc = %{version}
66
Provides: db-utils-doc = %{version}
67
Obsoletes: db-doc < %{version}
68
%if 0%{?suse_version} >= 1120
69
BuildArch: noarch
70
%endif
71
72
%description -n db48-doc
73
The Berkeley DB Database is a programmatic toolkit that provides
74
database support for applications.
75
76
This package contains the documentation.
77
78
%package devel
79
Summary: Development Files and Libraries for the Berkeley DB library Version 4.8
80
Group: Development/Libraries/C and C++
81
Requires: %{name} = %{version}
82
Requires: glibc-devel
83
Conflicts: libdb-4_5-devel
84
Provides: db-devel = %{version}
85
86
%description devel
87
The Berkeley DB Database is a programmatic toolkit that provides
88
database support for applications.
89
90
This package contains the header files and libraries.
91
92
%prep
93
%setup -q -n %{generic_name}-%{version}
94
%patch0
95
%patch1
96
%patch2 -p1
97
98
%build
99
cd dist
100
# dist/RELEASE codes the build date into the binary.
101
# Use last change of changes file instead
102
LAST_MOD=`stat --format="%%Y" %{SOURCE1}`
103
DIST_DATE=`date '+%%B %%e, %%Y' --date="@$LAST_MOD"`
104
sed -i -e "s/^DB_RELEASE_DATE=.*$/DB_RELEASE_DATE=\"$DIST_DATE\"/" RELEASE
105
./s_config
106
CFLAGS="%{optflags} -fno-strict-aliasing"
107
CC=gcc
108
export CFLAGS CXXFLAGS CC
109
#
110
# Build now the NPTL version
111
#
112
mkdir ../build_nptl
113
cd ../build_nptl
114
%define _configure ../dist/configure
115
%configure \
116
--enable-compat185 --disable-dump185 \
117
--enable-shared --disable-static \
118
--enable-cxx \
119
--with-mutex="POSIX/pthreads/library" \
120
%ifarch %{arm}
121
%{_target_cpu}-suse-linux-gnueabi
122
%else
123
%{_target_cpu}-suse-linux
124
%endif
125
# Make sure O_DIRECT is really disabled (build host could have old kernel)
126
perl -pi -e 's/#define HAVE_O_DIRECT 1/#undef HAVE_O_DIRECT/' db_config.h
127
# Remove libtool predep_objects and postdep_objects wonkiness
128
perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
129
perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
130
perl -pi -e 's/-shared -nostdlib/-shared/' libtool
131
132
make %{?_smp_mflags} LIBSO_LIBS='$(LIBS)' LIBXSO_LIBS='$(LIBS)'" -L%{_libdir} -lstdc++"
133
134
%install
135
mkdir -p %{buildroot}%{_includedir}/db4
136
mkdir -p %{buildroot}%{_libdir}
137
cd build_nptl
138
%make_install STRIP=true
139
cd ..
140
# make ldd happy:
141
chmod 755 %{buildroot}%{_libdir}/libdb*.so
142
# Fix header file installation
143
mv %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}/db4
144
echo "#include <db4/db.h>" > %{buildroot}%{_includedir}/db.h
145
echo "#include <db4/db_185.h>" > %{buildroot}%{_includedir}/db_185.h
146
echo "#include <db4/db_cxx.h>" > %{buildroot}%{_includedir}/db_cxx.h
147
# remove dangling tags symlink from examples.
148
rm -f examples_cxx/tags
149
rm -f examples_c/tags
150
# Move documentation to the right directory
151
mkdir -p %{buildroot}%{_docdir}/%{name}
152
mv %{buildroot}%{_prefix}/docs/* %{buildroot}/%{_docdir}/%{name}
153
cp -a examples_cxx examples_c %{buildroot}/%{_docdir}/%{name}
154
cp -a LICENSE README %{buildroot}/%{_docdir}/%{name}
155
# Remove api documentation for C++, Java and TCL
156
rm -rf %{buildroot}/%{_docdir}/%{name}/csharp
157
rm -rf %{buildroot}/%{_docdir}/%{name}/java
158
rm -rf %{buildroot}/%{_docdir}/%{name}/api_reference/CXX
159
rm -rf %{buildroot}/%{_docdir}/%{name}/api_reference/STL
160
rm -rf %{buildroot}/%{_docdir}/%{name}/api_reference/TCL
161
rm -rf %{buildroot}/%{_docdir}/%{name}/gsg*/CXX
162
rm -rf %{buildroot}/%{_docdir}/%{name}/gsg*/JAVA
163
mv %{buildroot}/%{_docdir}/%{name}/collections/tutorial %{buildroot}/%{_docdir}/%{name}/
164
# Remove crappy *.la files
165
find %{buildroot} -type f -name "*.la" -delete -print
166
167
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
168
169
for i in %{util_list}; do
170
# dummy
171
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
172
touch "%{buildroot}%{_sysconfdir}/alternatives/db_$i"
173
mv "%{buildroot}/%{_bindir}/db_$i" "%{buildroot}/%{_bindir}/db48_$i"
174
ln -s "%{_sysconfdir}/alternatives/db_$i" "%{buildroot}%{_bindir}/db_$i"
175
done
176
177
%fdupes -s %{buildroot}
178
179
%post -p /sbin/ldconfig
180
%postun -p /sbin/ldconfig
181
%post -n db48-utils
182
for i in %{util_list}; do
183
update-alternatives --install "%{_bindir}/db_$i" \
184
"db_$i" "%{_bindir}/db48_$i" 48
185
done
186
187
%postun -n db48-utils
188
for i in %{util_list}; do
189
update-alternatives --remove "db_$i" "%{_bindir}/db_$i"
190
done
191
192
%files
193
%{_libdir}/libdb-%{major}.%{minor}.so
194
%{_libdir}/libdb_cxx-%{major}.%{minor}.so
195
196
%files -n db48-doc
197
%dir %{_docdir}/%{name}
198
%license %{_docdir}/%{name}/LICENSE
199
%doc %{_docdir}/%{name}/README
200
%doc %{_docdir}/%{name}/index.html
201
%license %{_docdir}/%{name}/license
202
%doc %{_docdir}/%{name}/articles
203
%doc %{_docdir}/%{name}/api_reference
204
%doc %{_docdir}/%{name}/examples_c
205
%doc %{_docdir}/%{name}/examples_cxx
206
%doc %{_docdir}/%{name}/gsg*
207
%doc %{_docdir}/%{name}/porting
208
%doc %{_docdir}/%{name}/programmer_reference
209
%doc %{_docdir}/%{name}/tutorial
210
211
%files -n db48-utils
212
%{_bindir}/db48_*
213
%ghost %{_sysconfdir}/alternatives/db_archive
214
%ghost %{_sysconfdir}/alternatives/db_checkpoint
215
%ghost %{_sysconfdir}/alternatives/db_deadlock
216
%ghost %{_sysconfdir}/alternatives/db_dump
217
%ghost %{_sysconfdir}/alternatives/db_hotbackup
218
%ghost %{_sysconfdir}/alternatives/db_load
219
%ghost %{_sysconfdir}/alternatives/db_printlog
220
%ghost %{_sysconfdir}/alternatives/db_recover
221
%ghost %{_sysconfdir}/alternatives/db_sql
222
%ghost %{_sysconfdir}/alternatives/db_stat
223
%ghost %{_sysconfdir}/alternatives/db_upgrade
224
%ghost %{_sysconfdir}/alternatives/db_verify
225
%{_bindir}/db_*
226
227
%files devel
228
%dir %{_includedir}/db4
229
%{_includedir}/db.h
230
%{_includedir}/db_185.h
231
%{_includedir}/db_cxx.h
232
%{_includedir}/db4/db.h
233
%{_includedir}/db4/db_185.h
234
%{_includedir}/db4/db_cxx.h
235
%{_libdir}/libdb.so
236
%{_libdir}/libdb-%{major}.so
237
%{_libdir}/libdb_cxx.so
238
%{_libdir}/libdb_cxx-%{major}.so
239
240
%changelog
241