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