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