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