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