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