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