1 |
#(ie. use with rpm --rebuild): |
2 |
# |
3 |
# --with debug Compile with debugging code |
4 |
# |
5 |
# enable build with debugging code: will _not_ strip away any debugging code, |
6 |
# will _add_ -g3 to CFLAGS, will _add_ --enable-maintainer-mode to |
7 |
# configure. |
8 |
|
9 |
%define build_debug 0 |
10 |
%define build_test 0 |
11 |
|
12 |
# commandline overrides: |
13 |
# rpm -ba|--rebuild --with 'xxx' |
14 |
%{?_with_debug: %{expand: %%define build_debug 1}} |
15 |
%{?_with_test: %{expand: %%define build_test 1}} |
16 |
%{?_without_test: %global build_test 0} |
17 |
|
18 |
%if %{build_debug} |
19 |
# disable build root strip policy |
20 |
%define __spec_install_post %{_libdir}/rpm/brp-compress || : |
21 |
|
22 |
# This gives extra debuggin and huge binaries |
23 |
%{expand:%%define optflags %{optflags} %([ ! $DEBUG ] && echo '-g3')} |
24 |
%endif |
25 |
|
26 |
%if %{build_debug} |
27 |
%define build_debug 1 |
28 |
%endif |
29 |
|
30 |
%if %{build_test} |
31 |
%define build_test 1 |
32 |
%endif |
33 |
|
34 |
|
35 |
%define major 18 |
36 |
%define libmysqlembedded_major 0 |
37 |
%define libmysqlembedded_minor 0.1 |
38 |
%define libname %mklibname mariadb %{major} |
39 |
%define libmariadbservices %mklibname mariadbservices |
40 |
%define libmariadbembedded %mklibname mariadb-embedded %{major} |
41 |
%define develname %mklibname -d mariadb |
42 |
%define old_staticdevelname %mklibname -d -s mariadb |
43 |
%define libmariadbembedded_devel %mklibname -d mariadb-embedded |
44 |
|
45 |
%define mysql_libname %mklibname mysql %{major} |
46 |
%define mysql_develname %mklibname -d mysql |
47 |
%define libmysqlservices %mklibname mysqlservices |
48 |
%define libmysqlembedded %mklibname mysqld %{libmysqlembedded_major} |
49 |
%define libmysqlembedded_devel %mklibname -d mariadb-embedded |
50 |
|
51 |
%define mirror http://mirror2.hs-esslingen.de/mariadb |
52 |
%define bzrrev 3194.20111227 |
53 |
|
54 |
%define muser mysql |
55 |
Summary: A very fast and reliable SQL database engine |
56 |
Name: mariadb |
57 |
Version: 5.5.18 |
58 |
Release: %mkrel 0.bzr%{bzrrev} |
59 |
Group: Databases |
60 |
License: GPLv2 with exceptions |
61 |
URL: http://mariadb.org/ |
62 |
#Source0: %{mirror}/%{name}-%{version}/kvm-tarbake-jaunty-x86/%{name}-%{version}.tar.gz |
63 |
Source0: %{name}-%{version}.tar.gz |
64 |
Source2: mysqld.sysconfig |
65 |
Source3: my.cnf |
66 |
Source4: libmysql.version |
67 |
Source10: mysql.tmpfiles.d |
68 |
Source11: mysqld.service |
69 |
Source12: mysqld-prepare-db-dir |
70 |
Source13: mysqld-wait-ready |
71 |
# the following patches are rediffed from the mysql-5.5 src.rpm to mariadb-5.5 |
72 |
# fedora patches |
73 |
Patch1: mariadb-5.5-errno.patch |
74 |
Patch2: mariadb-5.5-strmov.patch |
75 |
Patch3: mariadb-5.5-install-test.patch |
76 |
Patch4: mysql-expired-certs.patch |
77 |
# filed upstream: https://bugs.launchpad.net/maria/+bug/886368 |
78 |
Patch5: mariadb-5.5-stack-guard.patch |
79 |
Patch7: mariadb-5.5-versioning.patch |
80 |
Patch8: mariadb-5.5-dubious-exports.patch |
81 |
# filed upstream: https://bugs.launchpad.net/maria/+bug/886476 |
82 |
Patch9: mariadb-5.5-disable-test.patch |
83 |
# filed upstream: https://bugs.launchpad.net/maria/+bug/886479 |
84 |
Patch10: mariadb-5.5-plugin-bool.patch |
85 |
Patch12: mysql-openssl-test.patch |
86 |
# filed upstream: https://bugs.launchpad.net/maria/+bug/886484 |
87 |
Patch13: mariadb-5.5-mysqld-nowatch.patch |
88 |
|
89 |
# mandriva patches |
90 |
Patch101: mariadb-5.5-logrotate.patch |
91 |
Patch102: mariadb-5.5-initscript.patch |
92 |
Patch103: mariadb-5.5-mysql_upgrade-exit-status.patch |
93 |
# unsure if still required |
94 |
#Patch105: mysql-5.1.35-test-variables-big.patch |
95 |
Patch106: mariadb-5.5-hotcopy.patch |
96 |
Patch107: mariadb-5.5-mysql_install_db-quiet.patch |
97 |
|
98 |
# mageia patches |
99 |
# (ahmad) add patch to fix some header files location (hint from Mandriva) |
100 |
# filed upstream: https://bugs.launchpad.net/maria/+bug/886550 |
101 |
Patch110: mariadb-5.5-fix-headers-location.patch |
102 |
# fix oqgraph typecast -- alien |
103 |
Patch111: mariadb-5.5-fix-typecast-oqgraph.patch |
104 |
# fix typeinfo of the handler class for rtti build -- alien |
105 |
Patch113: mariadb-5.5-oqgraph-typeinfo.patch |
106 |
|
107 |
Requires(post): rpm-helper |
108 |
Requires(preun): rpm-helper |
109 |
Requires(pre): rpm-helper |
110 |
Requires(postun): rpm-helper |
111 |
Requires(post): %{name}-common = %{version}-%{release} |
112 |
Requires(preun): %{name}-common = %{version}-%{release} |
113 |
Requires(post): %{name}-client = %{version}-%{release} |
114 |
Requires(preun): %{name}-client = %{version}-%{release} |
115 |
Requires(postun): %{name}-common = %{version}-%{release} |
116 |
Requires(postun): %{name}-client = %{version}-%{release} |
117 |
Requires: %{name}-common = %{version}-%{release} |
118 |
Requires: %{name}-core = %{version}-%{release} |
119 |
Requires: %{name}-client = %{version}-%{release} |
120 |
Provides: mysql = %{version}-%{release} |
121 |
Obsoletes: mysql < 5.5.18 |
122 |
Suggests: %{name}-extra |
123 |
BuildRequires: bison |
124 |
BuildRequires: cmake |
125 |
BuildRequires: doxygen |
126 |
BuildRequires: glibc-devel |
127 |
BuildRequires: libaio-devel |
128 |
BuildRequires: libstdc++-devel |
129 |
BuildRequires: libtermcap-devel |
130 |
BuildRequires: multiarch-utils >= 1.0.3 |
131 |
BuildRequires: ncurses-devel |
132 |
BuildRequires: openssl-devel |
133 |
BuildRequires: wrap-devel |
134 |
BuildRequires: python |
135 |
BuildRequires: readline-devel |
136 |
BuildRequires: systemtap |
137 |
BuildRequires: tetex |
138 |
BuildRequires: texinfo |
139 |
BuildRequires: xfs-devel |
140 |
BuildRequires: zlib-devel |
141 |
BuildRequires: boost-devel |
142 |
BuildConflicts: edit-devel |
143 |
|
144 |
%description |
145 |
The MariaDB software delivers a very fast, multi-threaded, multi-user, and |
146 |
robust SQL (Structured Query Language) database server. MariaDB Server is |
147 |
intended for mission-critical, heavy-load production systems as well as for |
148 |
embedding into mass-deployed software. |
149 |
|
150 |
The mariadb server is compiled with the following storage engines: |
151 |
|
152 |
- Aria Storage Engine |
153 |
- Archive Storage Engine |
154 |
- Blackhole Storage Engine |
155 |
- CSV Storage Engine |
156 |
- FederatedX Storage Engine (Federated replacement) |
157 |
- Heap Storage Engine |
158 |
- MyISAM Storage Engine |
159 |
- MyISAMMRG Storage Engine |
160 |
- Partition Storage Engine |
161 |
- Perfschema Storage Engine |
162 |
- XtraDB Storage Engine (InnoDB replacement) |
163 |
|
164 |
The following extra storage engines are provided by the mariadb-extra package |
165 |
|
166 |
- OQGraph Storage Engine |
167 |
- Sphinx Storage Engine |
168 |
|
169 |
The feedback storage engine is provided by the mariadb-feedback package |
170 |
|
171 |
- Feedback Storage Engine |
172 |
|
173 |
The following storage engines are provided in the mariadb-obsolete package |
174 |
|
175 |
- Federated Storage Engine |
176 |
- InnoDB Storage Engine |
177 |
|
178 |
%package feedback |
179 |
Summary: MariaDB feedback storage engine |
180 |
Group: System/Servers |
181 |
Requires: %{name}-common-core >= %{version}-%{release} |
182 |
|
183 |
%description feedback |
184 |
MariaDB feedback storage engine submits feedback about your mariadb server. |
185 |
Results can be seen on http://mariadb.org/feedback_plugin/ . |
186 |
|
187 |
%package extra |
188 |
Summary: MariaDB extra storage engines |
189 |
Group: System/Servers |
190 |
Requires: %{name}-common-core >= %{version}-%{release} |
191 |
|
192 |
%description extra |
193 |
MariaDB oqgraph and sphinx storage engines. |
194 |
|
195 |
%package obsolete |
196 |
Summary: MariaDB obsolete storage engines |
197 |
Group: System/Servers |
198 |
Requires: %{name}-common-core >= %{version}-%{release} |
199 |
Conflicts: mysql-core < 5.5.18 |
200 |
|
201 |
%description obsolete |
202 |
MariaDB obsolete storage engines. InnoDB and Federated are being replaced by |
203 |
XtraDB and FederatedX storage engines. These obsolete storage engines are |
204 |
provided in case you need the vanilla mysql storage engines. |
205 |
|
206 |
%package core |
207 |
Summary: Server core binary |
208 |
Group: System/Servers |
209 |
Requires: %{name}-common-core >= %{version}-%{release} |
210 |
Provides: mysql-core = %{version}-%{release} |
211 |
Obsoletes: mysql-core < 5.5.18 |
212 |
|
213 |
%description core |
214 |
Core mysqld server binary. For a full MariaDB database server, install |
215 |
package 'mariadb'. |
216 |
|
217 |
%package common-core |
218 |
Summary: Common files required by core binary |
219 |
Group: System/Servers |
220 |
Provides: mysql-common-core = %{version}-%{release} |
221 |
Obsoletes: mysql-common-core < 5.5.18 |
222 |
|
223 |
%description common-core |
224 |
Common files minimally required by mysqld server binary. |
225 |
|
226 |
%package common |
227 |
Summary: Common files |
228 |
Group: System/Servers |
229 |
Requires(post): rpm-helper |
230 |
Requires(preun): rpm-helper |
231 |
Requires(pre): rpm-helper |
232 |
Requires(postun): rpm-helper |
233 |
Requires(post): %{name}-client >= %{version}-%{release} |
234 |
Requires(preun): %{name}-client >= %{version}-%{release} |
235 |
Requires: %{name}-client >= %{version}-%{release} |
236 |
Requires: %{name}-common-core >= %{version}-%{release} |
237 |
Provides: mysql-common = %{version}-%{release} |
238 |
Obsoletes: mysql-common < 5.5.18 |
239 |
|
240 |
%description common |
241 |
Common files for the MariaDB database server. |
242 |
|
243 |
%package client |
244 |
Summary: Client |
245 |
Group: Databases |
246 |
Requires(post): %{libname} >= %{version}-%{release} |
247 |
Requires(preun): %{libname} >= %{version}-%{release} |
248 |
Requires: %{libname} >= %{version}-%{release} |
249 |
Provides: mysql-client = %{version}-%{release} |
250 |
Obsoletes: mysql-client < 5.5.18 |
251 |
|
252 |
%description client |
253 |
This package contains the standard MariaDB clients. |
254 |
|
255 |
%package bench |
256 |
Summary: Benchmarks and test system |
257 |
Group: System/Servers |
258 |
Requires(post): %{name}-client >= %{version}-%{release} |
259 |
Requires(preun): %{name}-client >= %{version}-%{release} |
260 |
Requires: %{name}-client >= %{version}-%{release} |
261 |
Provides: mysql-bench = %{version}-%{release} |
262 |
Obsoletes: mysql-bench < 5.5.18 |
263 |
|
264 |
%description bench |
265 |
This package contains MariaDB benchmark scripts and data. |
266 |
|
267 |
%package -n %{libname} |
268 |
Summary: Shared libraries |
269 |
Group: System/Libraries |
270 |
Provides: %{name}-shared-libs = %{version}-%{release} |
271 |
Provides: %{name}-shared = %{version}-%{release} |
272 |
Provides: %{mysql_libname} = %{version}-%{release} |
273 |
Obsoletes: %{mysql_libname} < 5.5.18 |
274 |
|
275 |
%description -n %{libname} |
276 |
This package contains the shared libraries (*.so*) which certain languages and |
277 |
applications need to dynamically load and use MariaDB. |
278 |
|
279 |
|
280 |
%package -n %{libmariadbservices} |
281 |
Summary: Shared libraries |
282 |
Group: System/Libraries |
283 |
Provides: %{libmysqlservices} = %{version}-%{release} |
284 |
Obsoletes: %{libmysqlservices} < 5.5.18 |
285 |
|
286 |
%description -n %{libmariadbservices} |
287 |
The libmariadbservices library provides access to the available services and |
288 |
dynamic plugins now must be linked against this library |
289 |
(use the -lmysqlservices flag). |
290 |
|
291 |
%package -n %{develname} |
292 |
Summary: Development header files and libraries |
293 |
Group: Development/Other |
294 |
Requires(post): %{libname} >= %{version}-%{release} |
295 |
Requires(preun): %{libname} >= %{version}-%{release} |
296 |
Requires(post): %{name}-common >= %{version}-%{release} |
297 |
Requires(preun): %{name}-common >= %{version}-%{release} |
298 |
Requires(post): %{name}-client >= %{version}-%{release} |
299 |
Requires(preun): %{name}-client >= %{version}-%{release} |
300 |
Requires: %{libname} = %{version}-%{release} |
301 |
Requires: %{libmariadbservices} = %{version}-%{release} |
302 |
Requires: %{name}-common >= %{version}-%{release} |
303 |
Requires: %{name}-client >= %{version}-%{release} |
304 |
Provides: %{name}-devel = %{version}-%{release} |
305 |
Provides: %{libname}-devel = %{version}-%{release} |
306 |
Obsoletes: %{libname}-devel < 5.5.18 |
307 |
Obsoletes: %{old_staticdevelname} < 5.5.10 |
308 |
Provides: %{mysql_develname} = %{version}-%{release} |
309 |
Obsoletes: %{mysql_develname} < 5.5.18 |
310 |
Provides: mysql-devel = %{version}-%{release} |
311 |
|
312 |
%description -n %{develname} |
313 |
This package contains the development header files and libraries necessary to |
314 |
develop MariaDB client applications. |
315 |
|
316 |
%package -n %{libmariadbembedded} |
317 |
Summary: MariaDB as an embeddable library |
318 |
Group: System/Libraries |
319 |
Provides: %{name}-embedded = %{version}-%{release} |
320 |
Obsoletes: %{name}-embedded < 5.5.10-6 |
321 |
Provides: %{libmysqlembedded} = %{version}-%{release} |
322 |
Obsoletes: %{libmysqlembedded} < 5.5.18 |
323 |
|
324 |
%description -n %{libmariadbembedded} |
325 |
MariaDB is a multi-user, multi-threaded SQL database server. This |
326 |
package contains a version of the MariaDB server that can be embedded |
327 |
into a client application instead of running as a separate process. |
328 |
|
329 |
The API is identical for the embedded MariaDB version and the client/server |
330 |
version. |
331 |
|
332 |
%package -n %{libmariadbembedded_devel} |
333 |
Summary: Development files for MySQL as an embeddable library |
334 |
Group: Development/Other |
335 |
Provides: %{name}-embedded-devel = %{version}-%{release} |
336 |
Obsoletes: %{name}-embedded-devel < 5.5.10-6 |
337 |
Requires: %{libmariadbembedded} = %{version}-%{release} |
338 |
Requires: %{name}-devel = %{version}-%{release} |
339 |
Provides: %{libmysqlembedded_devel} = %{version}-%{release} |
340 |
Obsoletes: %{libmysqlembedded_devel} < 5.5.18 |
341 |
Provides: mysql-embedded-devel = %{version}-%{release} |
342 |
|
343 |
%description -n %{libmariadbembedded_devel} |
344 |
MariaDB is a multi-user, multi-threaded SQL database server. This |
345 |
package contains files needed for developing and testing with |
346 |
the embedded version of the MariaDB server. |
347 |
|
348 |
The API is identical for the embedded MariaDB version and the client/server |
349 |
version. |
350 |
|
351 |
%prep |
352 |
%setup -q |
353 |
%apply_patches |
354 |
|
355 |
mkdir -p Mageia |
356 |
cp %{SOURCE2} Mageia/mysqld.sysconfig |
357 |
cp %{SOURCE3} Mageia/my.cnf |
358 |
|
359 |
# lib64 fix |
360 |
perl -pi -e "s|/usr/lib/|%{_libdir}/|g" Mageia/my.cnf |
361 |
|
362 |
# antiborker |
363 |
perl -pi -e "s|\@bindir\@|%{_bindir}|g" support-files/* scripts/* |
364 |
perl -pi -e "s|\@sbindir\@|%{_sbindir}|g" support-files/* scripts/* |
365 |
perl -pi -e "s|\@libexecdir\@|%{_sbindir}|g" support-files/* scripts/* |
366 |
perl -pi -e "s|\@localstatedir\@|/var/lib/mysql|g" support-files/* scripts/* |
367 |
perl -pi -e "s|^basedir=.*|basedir=%{_prefix}|g" support-files/* scripts/mysql_install_db* |
368 |
|
369 |
# this may be part of the problems with mysql-test |
370 |
# http://bugs.mysql.com/bug.php?id=52223 |
371 |
#perl -pi -e "s|basedir/lib\b|basedir/%{_lib}\b|g" mysql-test/mysql-test-run.pl |
372 |
#perl -pi -e "s|basedir/lib/|basedir/%{_lib}/|g" mysql-test/mysql-test-run.pl |
373 |
|
374 |
# workaround for upstream bug #56342 |
375 |
rm -f mysql-test/t/ssl_8k_key-master.opt |
376 |
|
377 |
# upstream has fallen down badly on symbol versioning, do it ourselves |
378 |
cp %{SOURCE4} libmysql/libmysql.version |
379 |
|
380 |
%build |
381 |
%serverbuild |
382 |
export CFLAGS="${CFLAGS:-%{optflags}}" |
383 |
export CXXFLAGS="${CXXFLAGS:-%{optflags}}" |
384 |
export FFLAGS="${FFLAGS:-%{optflags}}" |
385 |
|
386 |
%cmake \ |
387 |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
388 |
-DCMAKE_INSTALL_PREFIX=%{_prefix} \ |
389 |
-DINSTALL_SBINDIR=sbin \ |
390 |
-DMYSQL_DATADIR=/var/lib/mysql \ |
391 |
-DSYSCONFDIR=%{_sysconfdir} \ |
392 |
-DINSTALL_PLUGINDIR=%{_lib}/mysql/plugin \ |
393 |
-DINSTALL_MANDIR=share/man \ |
394 |
-DINSTALL_SHAREDIR=share/mysql \ |
395 |
-DINSTALL_LIBDIR=%{_lib} \ |
396 |
-DINSTALL_INCLUDEDIR=include/mysql \ |
397 |
-DINSTALL_INFODIR=share/info \ |
398 |
-DINSTALL_MYSQLDATADIR=/var/lib/mysql \ |
399 |
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \ |
400 |
-DINSTALL_SQLBENCHDIR=share/mysql \ |
401 |
-DINSTALL_SUPPORTFILESDIR=share/mysql \ |
402 |
-DINSTALL_MYSQLSHAREDIR=share/mysql \ |
403 |
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \ |
404 |
-DWITH_READLINE=0 \ |
405 |
-DWITH_LIBEDIT=0 \ |
406 |
-DWITH_LIBWRAP=1 \ |
407 |
-DWITH_SSL=system \ |
408 |
-DWITH_ZLIB=system \ |
409 |
-DWITH_PIC=1 \ |
410 |
-DMYSQL_TCP_PORT=3306 \ |
411 |
-DEXTRA_CHARSETS=all \ |
412 |
-DENABLED_LOCAL_INFILE=1 \ |
413 |
-DENABLE_DTRACE=1 \ |
414 |
-DWITH_EMBEDDED_SERVER=1 \ |
415 |
-DMYSQL_USER=%{muser} \ |
416 |
%if %{build_debug} |
417 |
-DWITH_DEBUG=1 \ |
418 |
%else |
419 |
-DWITH_DEBUG=0 \ |
420 |
%endif |
421 |
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ |
422 |
-DWITHOUT_NDBCLUSTER_STORAGE_ENGINE=1 \ |
423 |
-DWITHOUT_DAEMON_EXAMPLE=1 \ |
424 |
-DWITH_PLUGIN_PBXT=1 \ |
425 |
-DFEATURE_SET="community" \ |
426 |
-DCOMPILATION_COMMENT="%{_vendor} - MariaDB Community Edition (GPL)" |
427 |
|
428 |
cp ../libmysql/libmysql.version libmysql/libmysql.version |
429 |
|
430 |
%make |
431 |
|
432 |
%install |
433 |
rm -rf %{buildroot} |
434 |
|
435 |
# don't fiddle with the initscript! |
436 |
export DONT_GPRINTIFY=1 |
437 |
|
438 |
%if %{build_debug} |
439 |
export DONT_STRIP=1 |
440 |
%endif |
441 |
|
442 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
443 |
install -d %{buildroot}%{_initrddir} |
444 |
install -d %{buildroot}%{_var}/run/mysqld |
445 |
install -d %{buildroot}%{_var}/log/mysqld |
446 |
install -d %{buildroot}/var/lib/mysql/{mysql,test} |
447 |
|
448 |
%makeinstall_std -C build |
449 |
|
450 |
# install init scripts |
451 |
install -m0755 build/support-files/mysql.server %{buildroot}%{_initrddir}/mysqld |
452 |
|
453 |
# install configuration files |
454 |
install -m0644 Mageia/mysqld.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mysqld |
455 |
install -m0644 Mageia/my.cnf %{buildroot}%{_sysconfdir}/my.cnf |
456 |
|
457 |
mkdir -p %{buildroot}/etc/tmpfiles.d |
458 |
install -m 0644 %{SOURCE10} %{buildroot}/etc/tmpfiles.d/mysql.conf |
459 |
mkdir -p %{buildroot}/lib/systemd/system |
460 |
install -m 644 %{SOURCE11} %{buildroot}/lib/systemd/system |
461 |
install -m 755 %{SOURCE12} %{buildroot}%{_sbindir}/mysqld-prepare-db-dir |
462 |
install -m 755 %{SOURCE13} %{buildroot}%{_sbindir}/mysqld-wait-ready |
463 |
|
464 |
# bork |
465 |
mv %{buildroot}%{_bindir}/mysqlaccess.conf %{buildroot}%{_sysconfdir}/ |
466 |
chmod 644 %{buildroot}%{_sysconfdir}/mysqlaccess.conf |
467 |
mv %{buildroot}%{_prefix}/scripts/mysql_install_db %{buildroot}%{_bindir}/ |
468 |
mv %{buildroot}%{_datadir}/mysql/aclocal %{buildroot}%{_datadir}/aclocal |
469 |
|
470 |
pushd %{buildroot}%{_bindir} |
471 |
ln -sf mysqlcheck mysqlrepair |
472 |
ln -sf mysqlcheck mysqlanalyze |
473 |
ln -sf mysqlcheck mysqloptimize |
474 |
popd |
475 |
|
476 |
# nuke -Wl,--as-needed from the mysql_config file |
477 |
perl -pi -e "s|^ldflags=.*|ldflags=\'-rdynamic\'|g" %{buildroot}%{_bindir}/mysql_config |
478 |
|
479 |
# cmake generates some completely wacko references to -lprobes_mysql when |
480 |
# building with dtrace support. Haven't found where to shut that off, |
481 |
# so resort to this blunt instrument. While at it, let's not reference |
482 |
# libmysqlclient_r anymore either. |
483 |
sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' \ |
484 |
%{buildroot}%{_bindir}/mysql_config >mysql_config.tmp |
485 |
cp -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config |
486 |
chmod 755 %{buildroot}%{_bindir}/mysql_config |
487 |
install -m 0755 -d %{buildroot}/var/lib/mysql |
488 |
|
489 |
# Remove libmysqld.a, + hardlink libmysqld.so.%{libmysqlembedded_major} so that it's provided |
490 |
rm -f %{buildroot}%{_libdir}/libmysqld.a |
491 |
ln %{buildroot}%{_libdir}/libmysqld.so.%{major} %{buildroot}%{_libdir}/libmysqld.so.%{libmysqlembedded_major}.%{libmysqlembedded_minor} |
492 |
ln -s libmysqld.so.%{libmysqlembedded_major}.%{libmysqlembedded_minor} %{buildroot}%{_libdir}/libmysqld.so.%{libmysqlembedded_major} |
493 |
|
494 |
# libmysqlclient_r is no more. Upstream tries to replace it with symlinks |
495 |
# but that really doesn't work (wrong soname in particular). We'll keep |
496 |
# just the devel libmysqlclient_r.so link, so that rebuilding without any |
497 |
# source change is enough to get rid of dependency on libmysqlclient_r. |
498 |
rm -f %{buildroot}%{_libdir}/libmysqlclient_r.so* |
499 |
ln -s libmysqlclient.so %{buildroot}%{_libdir}/libmysqlclient_r.so |
500 |
|
501 |
# remove static libs |
502 |
rm -f %{buildroot}%{_libdir}/libmysqlclient.a |
503 |
rm -f %{buildroot}%{_libdir}/libmysqlclient_r.a |
504 |
|
505 |
# mysql-test includes one executable that doesn't belong under /usr/share, |
506 |
# so move it and provide a symlink |
507 |
mv %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} |
508 |
ln -s %{_bindir}/my_safe_process %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process |
509 |
|
510 |
# mysql client statically built against a local embedded library, pretty useless |
511 |
rm -f %{buildroot}%{_bindir}/mysql_embedded |
512 |
|
513 |
# this command enables plugins, but needs ini file + configuration in my.cnf before executing |
514 |
# and oh yeah, mysql must be stopped... => useless |
515 |
rm -f %{buildroot}%{_bindir}/mysql_plugin |
516 |
rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini |
517 |
|
518 |
# remove more useless plugins |
519 |
rm -f %{buildroot}%{_libdir}/mysql/plugin/auth_test_plugin.so |
520 |
rm -f %{buildroot}%{_libdir}/mysql/plugin/dialog_examples.so |
521 |
|
522 |
# house cleaning |
523 |
rm -rf %{buildroot}%{_datadir}/info |
524 |
rm -f %{buildroot}%{_bindir}/client_test |
525 |
rm -f %{buildroot}%{_bindir}/make_win_binary_distribution |
526 |
rm -f %{buildroot}%{_bindir}/make_win_src_distribution |
527 |
rm -f %{buildroot}%{_datadir}/mysql/binary-configure |
528 |
rm -f %{buildroot}%{_datadir}/mysql/config.huge.ini |
529 |
rm -f %{buildroot}%{_datadir}/mysql/config.medium.ini |
530 |
rm -f %{buildroot}%{_datadir}/mysql/config.small.ini |
531 |
rm -f %{buildroot}%{_datadir}/mysql/mysqld_multi.server |
532 |
rm -f %{buildroot}%{_datadir}/mysql/mysql-log-rotate |
533 |
rm -f %{buildroot}%{_datadir}/mysql/mysql.server |
534 |
rm -f %{buildroot}%{_datadir}/mysql/ndb-config-2-node.ini |
535 |
rm -f %{buildroot}%{_datadir}/mysql/binary-configure |
536 |
rm -f %{buildroot}%{_mandir}/man1/make_win_bin_dist.1* |
537 |
rm -f %{buildroot}%{_mandir}/man1/make_win_src_distribution.1* |
538 |
rm -f %{buildroot}%{_datadir}/mysql/magic |
539 |
|
540 |
# no idea how to fix this |
541 |
rm -rf %{buildroot}%{_prefix}/data |
542 |
rm -rf %{buildroot}%{_prefix}/docs |
543 |
rm -rf %{buildroot}%{_prefix}/scripts |
544 |
rm -f %{buildroot}%{_prefix}/COPYING |
545 |
rm -f %{buildroot}%{_prefix}/INSTALL-BINARY |
546 |
rm -f %{buildroot}%{_prefix}/README |
547 |
|
548 |
%multiarch_binaries %{buildroot}%{_bindir}/mysql_config |
549 |
%multiarch_includes %{buildroot}%{_includedir}/mysql/my_config.h |
550 |
|
551 |
cat > README.urpmi <<EOF |
552 |
|
553 |
NOTE: MariaDB is installed without root password, it is recommended to set the |
554 |
root password as soon as possible: |
555 |
|
556 |
mysqladmin password 'new_password' |
557 |
|
558 |
The initscript used to start mysql has been reverted to use the one shipped |
559 |
by MariaDB. This means the following changes: |
560 |
|
561 |
* The generation of the initial system mysql database is now done when mysql |
562 |
is started from the initscript and only if the /var/lib/mysql/mysql |
563 |
directory is empty (mysql_install_db). Previousely this was quite hidden and |
564 |
silently done at (rpm) install time. As a consequence to this change you may |
565 |
have to perform some manual tasks to upgrade the mysql system database and |
566 |
such. So, doing something like this might help you: |
567 |
|
568 |
/etc/init.d/mysqld stop |
569 |
TMPDIR=/var/tmp mysql_install_db |
570 |
mysql_upgrade |
571 |
|
572 |
The cluster functionalities (ndb) has been deactivated and will be removed in |
573 |
future mysql versions. Oracle has a new product named mysql-cluster that |
574 |
replaces the cluster functionalities. |
575 |
|
576 |
The mysql-common-core package ships with a default /etc/my.cnf file that is |
577 |
based on the my-medium.cnf file that comes with the source code. |
578 |
EOF |
579 |
|
580 |
################################################################################ |
581 |
# run the tests |
582 |
%if %{build_test} |
583 |
# disable failing tests |
584 |
echo "rpl_trigger : Unstable test case" >> mysql-test/t/disabled.def |
585 |
echo "type_enum : Unstable test case" >> mysql-test/t/disabled.def |
586 |
echo "windows : For MS Windows only" >> mysql-test/t/disabled.def |
587 |
pushd build/mysql-test |
588 |
export LANG=C |
589 |
export LC_ALL=C |
590 |
export LANGUAGE=C |
591 |
perl ./mysql-test-run.pl \ |
592 |
--mtr-build-thread="$((${RANDOM} % 100))" \ |
593 |
--skip-ndb \ |
594 |
--timer \ |
595 |
--retry=0 \ |
596 |
--ssl \ |
597 |
--mysqld=--binlog-format=mixed \ |
598 |
--testcase-timeout=60 \ |
599 |
--suite-timeout=120 || false |
600 |
popd |
601 |
%endif |
602 |
|
603 |
%pre |
604 |
# enable plugins |
605 |
if [ -f %{_sysconfdir}/my.cnf ]; then |
606 |
perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf |
607 |
perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf |
608 |
fi |
609 |
|
610 |
%pre common |
611 |
# delete the mysql group if no mysql user is found, before adding the user |
612 |
if [ -z "`getent passwd %{muser}`" ] && ! [ -z "`getent group %{muser}`" ]; then |
613 |
%{_sbindir}/groupdel %{muser} 2> /dev/null || : |
614 |
fi |
615 |
|
616 |
%_pre_useradd %{muser} /var/lib/mysql /bin/bash |
617 |
|
618 |
%post |
619 |
%_post_service mysqld |
620 |
|
621 |
%preun |
622 |
%_preun_service mysqld |
623 |
|
624 |
%postun |
625 |
if [ "$1" = "0" ]; then |
626 |
if [ -f /var/lock/subsys/mysqld ]; then |
627 |
%{_initrddir}/mysqld restart > /dev/null 2>/dev/null || : |
628 |
fi |
629 |
fi |
630 |
|
631 |
%pre common-core |
632 |
# enable plugins |
633 |
if [ -f %{_sysconfdir}/my.cnf ]; then |
634 |
perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf |
635 |
perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf |
636 |
fi |
637 |
|
638 |
%files |
639 |
%doc README.urpmi |
640 |
%{_initrddir}/mysqld |
641 |
%_sysconfdir/tmpfiles.d/mysql.conf |
642 |
/lib/systemd/system/mysqld.service |
643 |
%{_sbindir}/mysqld-prepare-db-dir |
644 |
%{_sbindir}/mysqld-wait-ready |
645 |
%dir %{_libdir}/mysql/plugin |
646 |
# authentication plugins |
647 |
%{_libdir}/mysql/plugin/auth_socket.so |
648 |
%{_libdir}/mysql/plugin/dialog.so |
649 |
%{_libdir}/mysql/plugin/mysql_clear_password.so |
650 |
# replication plugins |
651 |
%{_libdir}/mysql/plugin/semisync_master.so |
652 |
%{_libdir}/mysql/plugin/semisync_slave.so |
653 |
# storage engines |
654 |
%{_libdir}/mysql/plugin/ha_archive.so |
655 |
%{_libdir}/mysql/plugin/ha_blackhole.so |
656 |
%{_libdir}/mysql/plugin/ha_federatedx.so |
657 |
# upstream describes this as "junk" |
658 |
%{_libdir}/mysql/plugin/adt_null.so |
659 |
%{_libdir}/mysql/plugin/mypluglib.so |
660 |
%{_libdir}/mysql/plugin/qa_auth_client.so |
661 |
%{_libdir}/mysql/plugin/qa_auth_interface.so |
662 |
%{_libdir}/mysql/plugin/qa_auth_server.so |
663 |
# example plugins, not usefull at all, removing |
664 |
#%{_libdir}/mysql/plugin/auth_test_plugin.so |
665 |
#%{_libdir}/mysql/plugin/dialog_examples.so |
666 |
|
667 |
%files obsolete |
668 |
%{_libdir}/mysql/plugin/ha_innodb.so |
669 |
%{_libdir}/mysql/plugin/ha_federated.so |
670 |
|
671 |
%files feedback |
672 |
%{_libdir}/mysql/plugin/feedback.so |
673 |
|
674 |
%files extra |
675 |
%{_libdir}/mysql/plugin/ha_oqgraph.so |
676 |
%{_libdir}/mysql/plugin/ha_sphinx.so |
677 |
|
678 |
%files client |
679 |
%config(noreplace) %{_sysconfdir}/mysqlaccess.conf |
680 |
%{_bindir}/msql2mysql |
681 |
%{_bindir}/mysql |
682 |
%{_bindir}/mysqlaccess |
683 |
%{_bindir}/mysqladmin |
684 |
%{_bindir}/mysqlanalyze |
685 |
%{_bindir}/mysqlbinlog |
686 |
%{_bindir}/mysqlcheck |
687 |
%{_bindir}/mysqldump |
688 |
%{_bindir}/mysqldumpslow |
689 |
%{_bindir}/mysql_find_rows |
690 |
%{_bindir}/mysqlimport |
691 |
%{_bindir}/mysqloptimize |
692 |
%{_bindir}/mysqlrepair |
693 |
%{_bindir}/mysqlshow |
694 |
%{_bindir}/mysqlslap |
695 |
%{_bindir}/mysql_waitpid |
696 |
%{_mandir}/man1/msql2mysql.1* |
697 |
%{_mandir}/man1/myisam_ftdump.1* |
698 |
%{_mandir}/man1/mysql.1* |
699 |
%{_mandir}/man1/mysqlaccess.1* |
700 |
%{_mandir}/man1/mysqladmin.1* |
701 |
%{_mandir}/man1/mysqlbinlog.1* |
702 |
%{_mandir}/man1/mysqlcheck.1* |
703 |
%{_mandir}/man1/mysqldump.1* |
704 |
%{_mandir}/man1/mysqldumpslow.1* |
705 |
%{_mandir}/man1/mysql_find_rows.1* |
706 |
%{_mandir}/man1/mysqlimport.1* |
707 |
%{_mandir}/man1/mysqlshow.1* |
708 |
%{_mandir}/man1/mysql_waitpid.1* |
709 |
|
710 |
%files bench |
711 |
%doc build/sql-bench/README |
712 |
%{_bindir}/my_safe_process |
713 |
%{_bindir}/mysql_client_test |
714 |
%{_bindir}/mysql_client_test_embedded |
715 |
%{_bindir}/mysqltest_embedded |
716 |
%{_datadir}/mysql/sql-bench |
717 |
%attr(-,mysql,mysql) %{_datadir}/mysql/mysql-test |
718 |
%{_mandir}/man1/mysql-stress-test.pl.1* |
719 |
%{_mandir}/man1/mysql-test-run.pl.1* |
720 |
%{_mandir}/man1/mysql_client_test.1* |
721 |
%{_mandir}/man1/mysql_client_test_embedded.1* |
722 |
%{_mandir}/man1/mysqltest.1* |
723 |
%{_mandir}/man1/mysqltest_embedded.1* |
724 |
|
725 |
%files core |
726 |
%{_sbindir}/mysqld |
727 |
|
728 |
%files common-core |
729 |
%config(noreplace) %{_sysconfdir}/my.cnf |
730 |
%dir %{_datadir}/mysql |
731 |
%{_datadir}/mysql/english |
732 |
%{_datadir}/mysql/charsets |
733 |
|
734 |
%files common |
735 |
%doc README COPYING |
736 |
%config(noreplace) %{_sysconfdir}/sysconfig/mysqld |
737 |
%{_bindir}/aria_chk |
738 |
%{_bindir}/aria_dump_log |
739 |
%{_bindir}/aria_ftdump |
740 |
%{_bindir}/aria_pack |
741 |
%{_bindir}/aria_read_log |
742 |
%{_bindir}/innochecksum |
743 |
%{_bindir}/myisamchk |
744 |
%{_bindir}/myisam_ftdump |
745 |
%{_bindir}/myisamlog |
746 |
%{_bindir}/myisampack |
747 |
%{_bindir}/my_print_defaults |
748 |
%{_bindir}/mysqlbug |
749 |
%{_bindir}/mysql_convert_table_format |
750 |
%{_bindir}/mysqld_multi |
751 |
%{_bindir}/mysqld_safe |
752 |
%{_bindir}/mysql_fix_extensions |
753 |
%{_bindir}/mysqlhotcopy |
754 |
%{_bindir}/mysql_install_db |
755 |
%{_bindir}/mysql_secure_installation |
756 |
%{_bindir}/mysql_setpermission |
757 |
%{_bindir}/mysqltest |
758 |
%{_bindir}/mysql_tzinfo_to_sql |
759 |
%{_bindir}/mysql_upgrade |
760 |
%{_bindir}/mysql_zap |
761 |
%{_bindir}/perror |
762 |
%{_bindir}/replace |
763 |
%{_bindir}/resolveip |
764 |
%{_bindir}/resolve_stack_dump |
765 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql |
766 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/mysql |
767 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/test |
768 |
%attr(0755,%{muser},%{muser}) %dir %{_var}/run/mysqld |
769 |
%attr(0755,%{muser},%{muser}) %dir %{_var}/log/mysqld |
770 |
%{_datadir}/mysql/*.cnf |
771 |
%{_datadir}/mysql/fill_help_tables.sql |
772 |
%{_datadir}/mysql/mysql_system_tables.sql |
773 |
%{_datadir}/mysql/mysql_system_tables_data.sql |
774 |
%{_datadir}/mysql/mysql_test_data_timezone.sql |
775 |
%{_datadir}/mysql/errmsg-utf8.txt |
776 |
%{_datadir}/mysql/czech |
777 |
%{_datadir}/mysql/danish |
778 |
%{_datadir}/mysql/dutch |
779 |
%{_datadir}/mysql/estonian |
780 |
%{_datadir}/mysql/french |
781 |
%{_datadir}/mysql/german |
782 |
%{_datadir}/mysql/greek |
783 |
%{_datadir}/mysql/hungarian |
784 |
%{_datadir}/mysql/italian |
785 |
%{_datadir}/mysql/japanese |
786 |
%{_datadir}/mysql/korean |
787 |
%{_datadir}/mysql/norwegian |
788 |
%{_datadir}/mysql/norwegian-ny |
789 |
%{_datadir}/mysql/polish |
790 |
%{_datadir}/mysql/portuguese |
791 |
%{_datadir}/mysql/romanian |
792 |
%{_datadir}/mysql/russian |
793 |
%{_datadir}/mysql/serbian |
794 |
%{_datadir}/mysql/slovak |
795 |
%{_datadir}/mysql/spanish |
796 |
%{_datadir}/mysql/swedish |
797 |
%{_datadir}/mysql/ukrainian |
798 |
%{_mandir}/man1/innochecksum.1* |
799 |
%{_mandir}/man1/myisamchk.1* |
800 |
%{_mandir}/man1/myisamlog.1* |
801 |
%{_mandir}/man1/myisampack.1* |
802 |
%{_mandir}/man1/my_print_defaults.1* |
803 |
%{_mandir}/man1/mysqlbug.1* |
804 |
%{_mandir}/man1/mysql_convert_table_format.1* |
805 |
%{_mandir}/man1/mysqld_multi.1* |
806 |
%{_mandir}/man1/mysqld_safe.1* |
807 |
%{_mandir}/man1/mysql_fix_extensions.1* |
808 |
%{_mandir}/man1/mysql_fix_privilege_tables.1* |
809 |
%{_mandir}/man1/mysqlhotcopy.1* |
810 |
%{_mandir}/man1/mysql_install_db.1* |
811 |
%{_mandir}/man1/mysqlman.1* |
812 |
%{_mandir}/man1/mysql_secure_installation.1* |
813 |
%{_mandir}/man1/mysql.server.1* |
814 |
%{_mandir}/man1/mysql_setpermission.1* |
815 |
%{_mandir}/man1/mysqlslap.1* |
816 |
%{_mandir}/man1/mysql_tzinfo_to_sql.1* |
817 |
%{_mandir}/man1/mysql_upgrade.1* |
818 |
%{_mandir}/man1/mysql_zap.1* |
819 |
%{_mandir}/man1/ndbd_redo_log_reader.1* |
820 |
%{_mandir}/man1/perror.1* |
821 |
%{_mandir}/man1/replace.1* |
822 |
%{_mandir}/man1/resolveip.1* |
823 |
%{_mandir}/man1/resolve_stack_dump.1* |
824 |
%{_mandir}/man8/mysqld.8* |
825 |
%{_mandir}/man8/mysqlmanager.8* |
826 |
%{_mandir}/man8/ndbd.8* |
827 |
%{_mandir}/man8/ndbmtd.8* |
828 |
|
829 |
%files -n %{libname} |
830 |
%{_libdir}/libmysqlclient.so.%{major}* |
831 |
|
832 |
%files -n %{libmariadbservices} |
833 |
%{_libdir}/libmysqlservices.so |
834 |
|
835 |
%files -n %{develname} |
836 |
%doc INSTALL-SOURCE |
837 |
%multiarch %{multiarch_bindir}/mysql_config |
838 |
%{_bindir}/mysql_config |
839 |
%{_libdir}/libmysqlclient_r.so |
840 |
%{_libdir}/libmysqlclient.so |
841 |
%dir %{_includedir}/mysql |
842 |
%dir %{_includedir}/mysql/psi |
843 |
%{_includedir}/mysql/*.h |
844 |
%{_includedir}/mysql/psi/*.h |
845 |
%multiarch %{multiarch_includedir}/mysql/my_config.h |
846 |
%{_mandir}/man1/comp_err.1* |
847 |
%{_mandir}/man1/mysql_config.1* |
848 |
%{_datadir}/aclocal/mysql.m4 |
849 |
|
850 |
%files -n %{libmariadbembedded} |
851 |
%doc README COPYING |
852 |
%{_libdir}/libmysqld.so.%{major} |
853 |
%{_libdir}/libmysqld.so.%{libmysqlembedded_major}* |
854 |
|
855 |
%files -n %{libmariadbembedded_devel} |
856 |
%{_libdir}/libmysqld.so |
857 |
%{_bindir}/mysql_client_test_embedded |
858 |
%{_bindir}/mysqltest_embedded |
859 |
%{_mandir}/man1/mysql_client_test_embedded.1* |
860 |
%{_mandir}/man1/mysqltest_embedded.1* |