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