1 |
%define Werror_cflags %nil |
2 |
%define _disable_ld_no_undefined 1 |
3 |
|
4 |
%define _with_systemd 0 |
5 |
|
6 |
#(ie. use with rpm --rebuild): |
7 |
# |
8 |
# --with debug Compile with debugging code |
9 |
# |
10 |
# enable build with debugging code: will _not_ strip away any debugging code, |
11 |
# will _add_ -g3 to CFLAGS, will _add_ --enable-maintainer-mode to |
12 |
# configure. |
13 |
|
14 |
%define build_debug 0 |
15 |
%define build_test 0 |
16 |
|
17 |
# commandline overrides: |
18 |
# rpm -ba|--rebuild --with 'xxx' |
19 |
%{?_with_debug: %{expand: %%define build_debug 1}} |
20 |
%{?_with_test: %{expand: %%define build_test 1}} |
21 |
%{?_without_test: %global build_test 0} |
22 |
|
23 |
%if %{build_debug} |
24 |
# disable build root strip policy |
25 |
%define __spec_install_post %{_libdir}/rpm/brp-compress || : |
26 |
|
27 |
# This gives extra debuggin and huge binaries |
28 |
%{expand:%%define optflags %{optflags} %([ ! $DEBUG ] && echo '-g3')} |
29 |
%endif |
30 |
|
31 |
%if %{build_debug} |
32 |
%define build_debug 1 |
33 |
%endif |
34 |
|
35 |
%if %{build_test} |
36 |
%define build_test 1 |
37 |
%endif |
38 |
|
39 |
%define _requires_exceptions perl(this) |
40 |
|
41 |
%define major 18 |
42 |
%define libname %mklibname mysql %{major} |
43 |
%define libmysqlservices %mklibname mysqlservices |
44 |
%define develname %mklibname -d mysql |
45 |
%define old_staticdevelname %mklibname -d -s mysql |
46 |
|
47 |
%define muser mysql |
48 |
|
49 |
Summary: A very fast and reliable SQL database engine |
50 |
Name: mysql |
51 |
Version: 5.5.10 |
52 |
Release: %mkrel 5 |
53 |
Group: Databases |
54 |
License: GPL |
55 |
URL: http://www.mysql.com/ |
56 |
# The upstream tarball includes non-free documentation that we cannot ship. |
57 |
# To remove the non-free documentation, run this script after downloading |
58 |
# the tarball into the current directory: |
59 |
# ./generate-tarball.sh $VERSION |
60 |
Source0: mysql-%{version}-nodocs.tar.gz |
61 |
Source1: generate-tarball.sh |
62 |
Source2: mysqld.sysconfig |
63 |
Source3: my.cnf |
64 |
Source4: libmysql.version |
65 |
Source10: mysql.tmpfiles.d |
66 |
# fedora patches |
67 |
Patch0: mysql-errno.patch |
68 |
Patch1: mysql-strmov.patch |
69 |
Patch2: mysql-install-test.patch |
70 |
Patch3: mysql-expired-certs.patch |
71 |
Patch4: mysql-stack-guard.patch |
72 |
Patch5: mysql-chain-certs.patch |
73 |
Patch6: mysql-versioning.patch |
74 |
Patch7: mysql-dubious-exports.patch |
75 |
Patch8: mysql-disable-test.patch |
76 |
Patch9: mysql-home.patch |
77 |
Patch10: mysql-embedded-crash.patch |
78 |
|
79 |
# mandriva patches |
80 |
Patch100: mysql-mysqldumpslow_no_basedir.diff |
81 |
Patch101: mysql-logrotate.diff |
82 |
Patch102: mysql-initscript.diff |
83 |
Patch103: mysql_upgrade-exit-status.patch |
84 |
Patch104: mysql-5.1.31-shebang.patch |
85 |
Patch105: mysql-5.1.35-test-variables-big.patch |
86 |
Patch106: mysql-5.1.36-hotcopy.patch |
87 |
Patch107: mysql-install_db-quiet.patch |
88 |
Patch109: mysql_valist_fix.patch |
89 |
|
90 |
# mageia patches |
91 |
# (ahmad) add patch to fix some header files location (hint from Mandriva) |
92 |
Patch110: mysql-5.5.9-fix-headers-location.patch |
93 |
Requires(post): rpm-helper |
94 |
Requires(preun): rpm-helper |
95 |
Requires(pre): rpm-helper |
96 |
Requires(postun): rpm-helper |
97 |
Requires(post): mysql-common = %{version}-%{release} |
98 |
Requires(preun): mysql-common = %{version}-%{release} |
99 |
Requires(post): mysql-client = %{version}-%{release} |
100 |
Requires(preun): mysql-client = %{version}-%{release} |
101 |
Requires(postun): mysql-common = %{version}-%{release} |
102 |
Requires(postun): mysql-client = %{version}-%{release} |
103 |
Requires: mysql-common = %{version}-%{release} |
104 |
Requires: mysql-core = %{version}-%{release} |
105 |
Requires: mysql-client = %{version}-%{release} |
106 |
%if %_with_systemd |
107 |
# This is for /etc/tmpfiles.d |
108 |
Requires: systemd-units |
109 |
%endif |
110 |
BuildRequires: bison |
111 |
BuildRequires: cmake |
112 |
BuildRequires: dos2unix |
113 |
BuildRequires: doxygen |
114 |
BuildRequires: glibc-devel |
115 |
BuildRequires: libaio-devel |
116 |
BuildRequires: libstdc++-devel |
117 |
BuildRequires: libtermcap-devel |
118 |
BuildRequires: multiarch-utils >= 1.0.3 |
119 |
BuildRequires: ncurses-devel |
120 |
BuildRequires: openssl-devel |
121 |
BuildRequires: python |
122 |
BuildRequires: readline-devel |
123 |
BuildRequires: systemtap |
124 |
BuildRequires: tetex |
125 |
BuildRequires: texinfo |
126 |
BuildRequires: xfs-devel |
127 |
BuildRequires: zlib-devel |
128 |
BuildConflicts: edit-devel |
129 |
Provides: msqlormysql mysqlserver |
130 |
Provides: mysql-max = %{version}-%{release} |
131 |
Obsoletes: mysql-max < 5.1.43 |
132 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
133 |
|
134 |
%description |
135 |
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, and |
136 |
robust SQL (Structured Query Language) database server. MySQL Server is |
137 |
intended for mission-critical, heavy-load production systems as well as for |
138 |
embedding into mass-deployed software. MySQL is a trademark of MySQL AB. |
139 |
|
140 |
The mysql server is compiled with the following storage engines: |
141 |
|
142 |
- InnoDB Storage Engine |
143 |
- Archive Storage Engine |
144 |
- CSV Storage Engine |
145 |
- Federated Storage Engine |
146 |
- User Defined Functions (UDFs). |
147 |
- Blackhole Storage Engine |
148 |
- Partition Storage Engine |
149 |
- Perfschema Storage Engine |
150 |
|
151 |
%package core |
152 |
Summary: Server core binary |
153 |
Group: System/Servers |
154 |
Conflicts: mysql < 5.1.39-3 |
155 |
Conflicts: mysql-max < 5.1.43 |
156 |
Requires: mysql-common-core >= %{version}-%{release} |
157 |
|
158 |
%description core |
159 |
Core mysqld server binary. For a full MySQL database server, install |
160 |
package 'mysql'. |
161 |
|
162 |
%package common-core |
163 |
Summary: Common files required by core binary |
164 |
Group: System/Servers |
165 |
Conflicts: mysql-common < 5.1.43-1 |
166 |
|
167 |
%description common-core |
168 |
Common files minimally required by mysqld server binary. |
169 |
|
170 |
%package common |
171 |
Summary: Common files |
172 |
Group: System/Servers |
173 |
Requires(post): rpm-helper |
174 |
Requires(preun): rpm-helper |
175 |
Requires(pre): rpm-helper |
176 |
Requires(postun): rpm-helper |
177 |
Requires(post): mysql-client >= %{version}-%{release} |
178 |
Requires(preun): mysql-client >= %{version}-%{release} |
179 |
Requires: mysql-client >= %{version}-%{release} |
180 |
Requires: mysql-common-core >= %{version}-%{release} |
181 |
|
182 |
%description common |
183 |
Common files for the MySQL(TM) database server. |
184 |
|
185 |
%package client |
186 |
Summary: Client |
187 |
Group: Databases |
188 |
Requires(post): %{libname} >= %{version}-%{release} |
189 |
Requires(preun): %{libname} >= %{version}-%{release} |
190 |
Requires: %{libname} >= %{version}-%{release} |
191 |
|
192 |
%description client |
193 |
This package contains the standard MySQL clients. |
194 |
|
195 |
%package bench |
196 |
Summary: Benchmarks and test system |
197 |
Group: System/Servers |
198 |
Requires(post): mysql-client >= %{version}-%{release} |
199 |
Requires(preun): mysql-client >= %{version}-%{release} |
200 |
Requires: mysql-client >= %{version}-%{release} |
201 |
Requires: perl |
202 |
|
203 |
%description bench |
204 |
This package contains MySQL benchmark scripts and data. |
205 |
|
206 |
%package -n %{libname} |
207 |
Summary: Shared libraries |
208 |
Group: System/Libraries |
209 |
Provides: mysql-shared-libs = %{version}-%{release} |
210 |
Provides: mysql-shared = %{version}-%{release} |
211 |
|
212 |
%description -n %{libname} |
213 |
This package contains the shared libraries (*.so*) which certain languages and |
214 |
applications need to dynamically load and use MySQL. |
215 |
|
216 |
|
217 |
%package -n %{libmysqlservices} |
218 |
Summary: Shared libraries |
219 |
Group: System/Libraries |
220 |
Conflicts: %{mklibname %name 16} <= 5.5.9-6 |
221 |
|
222 |
%description -n %{libmysqlservices} |
223 |
The libmysqlservices library provides access to the available services and |
224 |
dynamic plugins now must be linked against this library |
225 |
(use the -lmysqlservices flag). |
226 |
|
227 |
%package -n %{develname} |
228 |
Summary: Development header files and libraries |
229 |
Group: Development/Other |
230 |
Requires(post): %{libname} >= %{version}-%{release} |
231 |
Requires(preun): %{libname} >= %{version}-%{release} |
232 |
Requires(post): mysql-common >= %{version}-%{release} |
233 |
Requires(preun): mysql-common >= %{version}-%{release} |
234 |
Requires(post): mysql-client >= %{version}-%{release} |
235 |
Requires(preun): mysql-client >= %{version}-%{release} |
236 |
Requires: %{libname} = %{version}-%{release} |
237 |
Requires: %{libmysqlservices} = %{version}-%{release} |
238 |
Requires: mysql-common >= %{version}-%{release} |
239 |
Requires: mysql-client >= %{version}-%{release} |
240 |
Provides: mysql-devel = %{version}-%{release} |
241 |
Provides: %{libname}-devel = %{version}-%{release} |
242 |
Obsoletes: %{libname}-devel |
243 |
Obsoletes: %{old_staticdevelname} <= 5.5.9-5 |
244 |
# Todo: 21/03/2011 (Balcaen John) |
245 |
# We should drop thoses conflict & versionnate libmysqlservices.so & put it |
246 |
# in his own subpackage. |
247 |
Conflicts: %{mklibname mysql 12 -d} |
248 |
Conflicts: %{mklibname mysql 14 -d} |
249 |
Conflicts: %{mklibname mysql 15 -d} |
250 |
Conflicts: %{mklibname mysql 16 -d} |
251 |
|
252 |
%description -n %{develname} |
253 |
This package contains the development header files and libraries necessary to |
254 |
develop MySQL client applications. |
255 |
|
256 |
%package embedded |
257 |
Summary: MySQL as an embeddable library |
258 |
Group: System/Libraries |
259 |
|
260 |
%description embedded |
261 |
MySQL is a multi-user, multi-threaded SQL database server. This |
262 |
package contains a version of the MySQL server that can be embedded |
263 |
into a client application instead of running as a separate process. |
264 |
|
265 |
The API is identical for the embedded MySQL version and the client/server |
266 |
version. |
267 |
|
268 |
%package embedded-devel |
269 |
Summary: Development files for MySQL as an embeddable library |
270 |
Group: Development/Other |
271 |
Requires: %{name}-embedded = %{version}-%{release} |
272 |
Requires: %{name}-devel = %{version}-%{release} |
273 |
|
274 |
%description embedded-devel |
275 |
MySQL is a multi-user, multi-threaded SQL database server. This |
276 |
package contains files needed for developing and testing with |
277 |
the embedded version of the MySQL server. |
278 |
|
279 |
The API is identical for the embedded MySQL version and the client/server |
280 |
version. |
281 |
|
282 |
%prep |
283 |
|
284 |
%setup -q -n mysql-%{version} |
285 |
|
286 |
# fedora patches |
287 |
%patch0 -p1 -b .errno |
288 |
%patch1 -p1 -b .strmov |
289 |
%patch2 -p1 -b .install-test |
290 |
%patch3 -p1 -b .expired-certs |
291 |
%patch4 -p1 -b .stack-guard |
292 |
%patch5 -p1 -b .chain-certs |
293 |
%patch6 -p1 -b .versioning |
294 |
%patch7 -p1 -b .dubious-exports |
295 |
%patch8 -p1 -b .disable-test |
296 |
%patch9 -p1 -b .mysql-home |
297 |
%patch10 -p1 -b .mysql-embedded-crash |
298 |
|
299 |
# mandriva patches |
300 |
%patch100 -p0 -b .mysqldumpslow_no_basedir |
301 |
%patch101 -p0 -b .logrotate |
302 |
%patch102 -p0 -b .initscript |
303 |
%patch103 -p1 -b .mysql_upgrade-exit-status |
304 |
%patch104 -p1 -b .shebang |
305 |
%patch105 -p0 -b .test-variables-big |
306 |
%patch106 -p0 -b .hotcopy |
307 |
%patch107 -p0 -b .install_db-quiet |
308 |
%patch109 -p1 -b .va_list_arm |
309 |
%patch110 -p1 -b .headers-location |
310 |
|
311 |
mkdir -p Mageia |
312 |
cp %{SOURCE2} Mageia/mysqld.sysconfig |
313 |
cp %{SOURCE3} Mageia/my.cnf |
314 |
|
315 |
# lib64 fix |
316 |
perl -pi -e "s|/usr/lib/|%{_libdir}/|g" Mageia/my.cnf |
317 |
|
318 |
# antiborker |
319 |
perl -pi -e "s|\@bindir\@|%{_bindir}|g" support-files/* scripts/* |
320 |
perl -pi -e "s|\@sbindir\@|%{_sbindir}|g" support-files/* scripts/* |
321 |
perl -pi -e "s|\@libexecdir\@|%{_sbindir}|g" support-files/* scripts/* |
322 |
perl -pi -e "s|\@localstatedir\@|/var/lib/mysql|g" support-files/* scripts/* |
323 |
perl -pi -e "s|^basedir=.*|basedir=%{_prefix}|g" support-files/* scripts/mysql_install_db* |
324 |
|
325 |
# this may be part of the problems with mysql-test |
326 |
# http://bugs.mysql.com/bug.php?id=52223 |
327 |
#perl -pi -e "s|basedir/lib\b|basedir/%{_lib}\b|g" mysql-test/mysql-test-run.pl |
328 |
#perl -pi -e "s|basedir/lib/|basedir/%{_lib}/|g" mysql-test/mysql-test-run.pl |
329 |
|
330 |
# workaround for upstream bug #56342 |
331 |
rm -f mysql-test/t/ssl_8k_key-master.opt |
332 |
|
333 |
# upstream has fallen down badly on symbol versioning, do it ourselves |
334 |
cp %{SOURCE4} libmysql/libmysql.version |
335 |
|
336 |
%build |
337 |
%serverbuild |
338 |
export CFLAGS="${CFLAGS:-%{optflags}}" |
339 |
export CXXFLAGS="${CXXFLAGS:-%{optflags}}" |
340 |
export FFLAGS="${FFLAGS:-%{optflags}}" |
341 |
|
342 |
%cmake \ |
343 |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
344 |
-DCMAKE_INSTALL_PREFIX=%{_prefix} \ |
345 |
-DINSTALL_SBINDIR=sbin \ |
346 |
-DMYSQL_DATADIR=/var/lib/mysql \ |
347 |
-DSYSCONFDIR=%{_sysconfdir} \ |
348 |
-DINSTALL_PLUGINDIR=%{_lib}/mysql/plugin \ |
349 |
-DINSTALL_MANDIR=share/man \ |
350 |
-DINSTALL_SHAREDIR=share/mysql \ |
351 |
-DINSTALL_LIBDIR=%{_lib} \ |
352 |
-DINSTALL_INCLUDEDIR=include/mysql \ |
353 |
-DINSTALL_INFODIR=share/info \ |
354 |
-DINSTALL_MYSQLDATADIR=/var/lib/mysql \ |
355 |
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \ |
356 |
-DINSTALL_SQLBENCHDIR=share/mysql \ |
357 |
-DINSTALL_SUPPORTFILESDIR=share/mysql \ |
358 |
-DINSTALL_MYSQLSHAREDIR=share/mysql \ |
359 |
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \ |
360 |
-DWITH_READLINE=0 \ |
361 |
-DWITH_LIBEDIT=0 \ |
362 |
-DWITH_LIBWRAP=1 \ |
363 |
-DWITH_SSL=system \ |
364 |
-DWITH_ZLIB=system \ |
365 |
-DWITH_PIC=1 \ |
366 |
-DMYSQL_TCP_PORT=3306 \ |
367 |
-DEXTRA_CHARSETS=all \ |
368 |
-DENABLED_LOCAL_INFILE=1 \ |
369 |
-DENABLE_DTRACE=1 \ |
370 |
-DWITH_EMBEDDED_SERVER=1 \ |
371 |
-DMYSQL_USER=%{muser} \ |
372 |
%if %{build_debug} |
373 |
-DWITH_DEBUG=1 \ |
374 |
%else |
375 |
-DWITH_DEBUG=0 \ |
376 |
%endif |
377 |
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ |
378 |
-DWITHOUT_NDBCLUSTER_STORAGE_ENGINE=1 \ |
379 |
-DWITHOUT_DAEMON_EXAMPLE=1 \ |
380 |
-DFEATURE_SET="community" \ |
381 |
-DCOMPILATION_COMMENT="Mageia - MySQL Community Edition (GPL)" |
382 |
|
383 |
cp ../libmysql/libmysql.version libmysql/libmysql.version |
384 |
|
385 |
%make |
386 |
# regular build will make libmysqld.a but not libmysqld.so :-( |
387 |
mkdir libmysqld/work |
388 |
cd libmysqld/work |
389 |
ar -x ../libmysqld.a |
390 |
# these result in missing dependencies: (filed upstream as bug 59104) |
391 |
rm -f sql_binlog.cc.o rpl_utility.cc.o |
392 |
gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 \ |
393 |
*.o ../../probes_mysql.o \ |
394 |
-lpthread -laio -lcrypt -lssl -lcrypto -lz -lrt -lstdc++ -ldl -lm -lc |
395 |
|
396 |
%install |
397 |
rm -rf %{buildroot} |
398 |
|
399 |
# don't fiddle with the initscript! |
400 |
export DONT_GPRINTIFY=1 |
401 |
|
402 |
%if %{build_debug} |
403 |
export DONT_STRIP=1 |
404 |
%endif |
405 |
|
406 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
407 |
install -d %{buildroot}%{_initrddir} |
408 |
install -d %{buildroot}%{_var}/run/mysqld |
409 |
install -d %{buildroot}%{_var}/log/mysqld |
410 |
install -d %{buildroot}/var/lib/mysql/{mysql,test} |
411 |
|
412 |
%makeinstall_std -C build |
413 |
|
414 |
# install init scripts |
415 |
install -m0755 build/support-files/mysql.server %{buildroot}%{_initrddir}/mysqld |
416 |
|
417 |
# install configuration files |
418 |
install -m0644 Mageia/mysqld.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mysqld |
419 |
install -m0644 Mageia/my.cnf %{buildroot}%{_sysconfdir}/my.cnf |
420 |
|
421 |
%if %_with_systemd |
422 |
mkdir -p $RPM_BUILD_ROOT/etc/tmpfiles.d |
423 |
install -m 0644 %{SOURCE10} $RPM_BUILD_ROOT/etc/tmpfiles.d/mysql.conf |
424 |
%endif |
425 |
|
426 |
# bork |
427 |
mv %{buildroot}%{_bindir}/mysqlaccess.conf %{buildroot}%{_sysconfdir}/ |
428 |
chmod 644 %{buildroot}%{_sysconfdir}/mysqlaccess.conf |
429 |
mv %{buildroot}%{_prefix}/scripts/mysql_install_db %{buildroot}%{_bindir}/ |
430 |
mv %{buildroot}%{_datadir}/mysql/aclocal %{buildroot}%{_datadir}/aclocal |
431 |
|
432 |
pushd %{buildroot}%{_bindir} |
433 |
ln -sf mysqlcheck mysqlrepair |
434 |
ln -sf mysqlcheck mysqlanalyze |
435 |
ln -sf mysqlcheck mysqloptimize |
436 |
popd |
437 |
|
438 |
# nuke -Wl,--as-needed from the mysql_config file |
439 |
perl -pi -e "s|^ldflags=.*|ldflags=\'-rdynamic\'|g" %{buildroot}%{_bindir}/mysql_config |
440 |
|
441 |
# cmake generates some completely wacko references to -lprobes_mysql when |
442 |
# building with dtrace support. Haven't found where to shut that off, |
443 |
# so resort to this blunt instrument. While at it, let's not reference |
444 |
# libmysqlclient_r anymore either. |
445 |
sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' \ |
446 |
%{buildroot}%{_bindir}/mysql_config >mysql_config.tmp |
447 |
cp -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config |
448 |
chmod 755 %{buildroot}%{_bindir}/mysql_config |
449 |
install -m 0755 -d $RPM_BUILD_ROOT/var/lib/mysql |
450 |
|
451 |
# Remove libmysqld.a, install libmysqld.so |
452 |
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libmysqld.a |
453 |
install -m 0755 build/libmysqld/work/libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/libmysqld.so.0.0.1 |
454 |
ln -s libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/libmysqld.so.0 |
455 |
ln -s libmysqld.so.0 ${RPM_BUILD_ROOT}%{_libdir}/libmysqld.so |
456 |
|
457 |
# libmysqlclient_r is no more. Upstream tries to replace it with symlinks |
458 |
# but that really doesn't work (wrong soname in particular). We'll keep |
459 |
# just the devel libmysqlclient_r.so link, so that rebuilding without any |
460 |
# source change is enough to get rid of dependency on libmysqlclient_r. |
461 |
rm -f %{buildroot}%{_libdir}/libmysqlclient_r.so* |
462 |
ln -s libmysqlclient.so %{buildroot}%{_libdir}/libmysqlclient_r.so |
463 |
|
464 |
# mysql-test includes one executable that doesn't belong under /usr/share, |
465 |
# so move it and provide a symlink |
466 |
mv %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} |
467 |
ln -s %{_bindir}/my_safe_process %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process |
468 |
|
469 |
# house cleaning |
470 |
rm -rf %{buildroot}%{_datadir}/info |
471 |
rm -f %{buildroot}%{_bindir}/client_test |
472 |
rm -f %{buildroot}%{_bindir}/make_win_binary_distribution |
473 |
rm -f %{buildroot}%{_bindir}/make_win_src_distribution |
474 |
rm -f %{buildroot}%{_datadir}/mysql/binary-configure |
475 |
rm -f %{buildroot}%{_datadir}/mysql/config.huge.ini |
476 |
rm -f %{buildroot}%{_datadir}/mysql/config.medium.ini |
477 |
rm -f %{buildroot}%{_datadir}/mysql/config.small.ini |
478 |
rm -f %{buildroot}%{_datadir}/mysql/mysqld_multi.server |
479 |
rm -f %{buildroot}%{_datadir}/mysql/mysql-log-rotate |
480 |
rm -f %{buildroot}%{_datadir}/mysql/mysql.server |
481 |
rm -f %{buildroot}%{_datadir}/mysql/ndb-config-2-node.ini |
482 |
rm -f %{buildroot}%{_datadir}/mysql/binary-configure |
483 |
rm -f %{buildroot}%{_mandir}/man1/make_win_bin_dist.1* |
484 |
rm -f %{buildroot}%{_mandir}/man1/make_win_src_distribution.1* |
485 |
rm -f %{buildroot}%{_datadir}/mysql/magic |
486 |
|
487 |
# no idea how to fix this |
488 |
rm -rf %{buildroot}%{_prefix}/data |
489 |
rm -rf %{buildroot}%{_prefix}/docs |
490 |
rm -rf %{buildroot}%{_prefix}/scripts |
491 |
rm -f %{buildroot}%{_prefix}/COPYING |
492 |
rm -f %{buildroot}%{_prefix}/INSTALL-BINARY |
493 |
rm -f %{buildroot}%{_prefix}/README |
494 |
|
495 |
%multiarch_binaries %{buildroot}%{_bindir}/mysql_config |
496 |
%multiarch_includes %{buildroot}%{_includedir}/mysql/my_config.h |
497 |
|
498 |
cat > README.urpmi <<EOF |
499 |
|
500 |
The initscript used to start mysql has been reverted to use the one shipped |
501 |
by MySQL AB. This means the following changes: |
502 |
|
503 |
* The generation of the initial system mysql database is now done when mysql |
504 |
is started from the initscript and only if the /var/lib/mysql/mysql |
505 |
directory is empty (mysql_install_db). Previousely this was quite hidden and |
506 |
silently done at (rpm) install time. As a consequence to this change you may |
507 |
have to perform some manual tasks to upgrade the mysql system database and |
508 |
such. So, doing something like this might help you: |
509 |
|
510 |
/etc/rc.d/init.d/mysqld stop |
511 |
TMPDIR=/var/tmp mysql_install_db |
512 |
mysql_upgrade |
513 |
|
514 |
The cluster functionalities (ndb) has been deactivated and will be removed in |
515 |
future mysql versions. A new product named mysql-cluster has been added that |
516 |
replaces the cluster functionalities. |
517 |
|
518 |
The mysql-common-core package ships with a default /etc/my.cnf file that is |
519 |
based on the my-medium.cnf file that comes with the source code. |
520 |
|
521 |
Starting from mysql-5.1.43-2 the storage engines is built as dynamically |
522 |
loadable modules. You can either load the engines using the /etc/my.cnf file or |
523 |
at runtime. Please look at these lines in the /etc/my.cnf file to enable |
524 |
additional engines or disable one or more of the default ones: |
525 |
|
526 |
plugin_dir=%{_libdir}/mysql/plugin |
527 |
plugin-load=ha_archive.so;ha_blackhole.so;ha_federated.so |
528 |
|
529 |
Starting from mysql-5.1.44-3 the html documentation and the mysql.info is not |
530 |
shipped with the Mageia packages due to strict licensing. |
531 |
|
532 |
EOF |
533 |
|
534 |
################################################################################ |
535 |
# run the tests |
536 |
%if %{build_test} |
537 |
# disable failing tests |
538 |
echo "rpl_trigger : Unstable test case" >> mysql-test/t/disabled.def |
539 |
echo "type_enum : Unstable test case" >> mysql-test/t/disabled.def |
540 |
echo "windows : For MS Windows only" >> mysql-test/t/disabled.def |
541 |
pushd build/mysql-test |
542 |
export LANG=C |
543 |
export LC_ALL=C |
544 |
export LANGUAGE=C |
545 |
perl ./mysql-test-run.pl \ |
546 |
--mtr-build-thread="$((${RANDOM} % 100))" \ |
547 |
--skip-ndb \ |
548 |
--timer \ |
549 |
--retry=0 \ |
550 |
--ssl \ |
551 |
--mysqld=--binlog-format=mixed \ |
552 |
--testcase-timeout=60 \ |
553 |
--suite-timeout=120 || false |
554 |
popd |
555 |
%endif |
556 |
|
557 |
%pre |
558 |
# enable plugins |
559 |
if [ -f %{_sysconfdir}/my.cnf ]; then |
560 |
perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf |
561 |
perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf |
562 |
fi |
563 |
|
564 |
%pre common |
565 |
# delete the mysql group if no mysql user is found, before adding the user |
566 |
if [ -z "`getent passwd %{muser}`" ] && ! [ -z "`getent group %{muser}`" ]; then |
567 |
%{_sbindir}/groupdel %{muser} 2> /dev/null || : |
568 |
fi |
569 |
|
570 |
%_pre_useradd %{muser} /var/lib/mysql /bin/bash |
571 |
|
572 |
%post common |
573 |
|
574 |
%post |
575 |
# Change permissions so that the user that will run the MySQL daemon |
576 |
# owns all needed files. |
577 |
chown -R %{muser}:%{muser} /var/lib/mysql /var/run/mysqld /var/log/mysqld |
578 |
|
579 |
# make sure the /var/lib/mysql directory can be accessed |
580 |
chmod 755 /var/lib/mysql |
581 |
|
582 |
%_post_service mysqld |
583 |
|
584 |
%preun |
585 |
%_preun_service mysqld |
586 |
|
587 |
%postun |
588 |
if [ "$1" = "0" ]; then |
589 |
if [ -f /var/lock/subsys/mysqld ]; then |
590 |
%{_initrddir}/mysqld restart > /dev/null 2>/dev/null || : |
591 |
fi |
592 |
fi |
593 |
|
594 |
%pre common-core |
595 |
# enable plugins |
596 |
if [ -f %{_sysconfdir}/my.cnf ]; then |
597 |
perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf |
598 |
perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf |
599 |
fi |
600 |
|
601 |
%clean |
602 |
rm -rf %{buildroot} |
603 |
|
604 |
%files |
605 |
%defattr(-,root,root) |
606 |
%doc README.urpmi |
607 |
%attr(0755,root,root) %{_initrddir}/mysqld |
608 |
%if %_with_systemd |
609 |
%_sysconfdir/tmpfiles.d/mysql.conf |
610 |
%endif |
611 |
%dir %{_libdir}/mysql/plugin |
612 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/adt_null.so |
613 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/auth.so |
614 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/auth_socket.so |
615 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/auth_test_plugin.so |
616 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/ha_archive.so |
617 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/ha_blackhole.so |
618 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/ha_federated.so |
619 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/mypluglib.so |
620 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/qa_auth_client.so |
621 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/qa_auth_interface.so |
622 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/qa_auth_server.so |
623 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/semisync_master.so |
624 |
%attr(0755,root,root) %{_libdir}/mysql/plugin/semisync_slave.so |
625 |
|
626 |
%files client |
627 |
%defattr(-,root,root) |
628 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/mysqlaccess.conf |
629 |
%attr(0755,root,root) %{_bindir}/msql2mysql |
630 |
%attr(0755,root,root) %{_bindir}/mysql |
631 |
%attr(0755,root,root) %{_bindir}/mysqlaccess |
632 |
%attr(0755,root,root) %{_bindir}/mysqladmin |
633 |
%attr(0755,root,root) %{_bindir}/mysqlanalyze |
634 |
%attr(0755,root,root) %{_bindir}/mysqlbinlog |
635 |
%attr(0755,root,root) %{_bindir}/mysqlcheck |
636 |
%attr(0755,root,root) %{_bindir}/mysqldump |
637 |
%attr(0755,root,root) %{_bindir}/mysqldumpslow |
638 |
%attr(0755,root,root) %{_bindir}/mysql_find_rows |
639 |
%attr(0755,root,root) %{_bindir}/mysqlimport |
640 |
%attr(0755,root,root) %{_bindir}/mysqloptimize |
641 |
%attr(0755,root,root) %{_bindir}/mysqlrepair |
642 |
%attr(0755,root,root) %{_bindir}/mysqlshow |
643 |
%attr(0755,root,root) %{_bindir}/mysqlslap |
644 |
%attr(0755,root,root) %{_bindir}/mysql_waitpid |
645 |
%attr(0644,root,root) %{_mandir}/man1/msql2mysql.1* |
646 |
%attr(0644,root,root) %{_mandir}/man1/myisam_ftdump.1* |
647 |
%attr(0644,root,root) %{_mandir}/man1/mysql.1* |
648 |
%attr(0644,root,root) %{_mandir}/man1/mysqlaccess.1* |
649 |
%attr(0644,root,root) %{_mandir}/man1/mysqladmin.1* |
650 |
%attr(0644,root,root) %{_mandir}/man1/mysqlbinlog.1* |
651 |
%attr(0644,root,root) %{_mandir}/man1/mysqlcheck.1* |
652 |
%attr(0644,root,root) %{_mandir}/man1/mysqldump.1* |
653 |
%attr(0644,root,root) %{_mandir}/man1/mysqldumpslow.1* |
654 |
%attr(0644,root,root) %{_mandir}/man1/mysql_find_rows.1* |
655 |
%attr(0644,root,root) %{_mandir}/man1/mysqlimport.1* |
656 |
%attr(0644,root,root) %{_mandir}/man1/mysqlshow.1* |
657 |
%attr(0644,root,root) %{_mandir}/man1/mysql_waitpid.1* |
658 |
|
659 |
%files bench |
660 |
%defattr(-,root,root) |
661 |
%doc build/sql-bench/README |
662 |
%attr(0755,root,root) %{_bindir}/my_safe_process |
663 |
%attr(0755,root,root) %{_bindir}/mysql_client_test |
664 |
%attr(0755,root,root) %{_bindir}/mysql_client_test_embedded |
665 |
%attr(0755,root,root) %{_bindir}/mysqltest_embedded |
666 |
%{_datadir}/mysql/sql-bench |
667 |
%attr(-,mysql,mysql) %{_datadir}/mysql/mysql-test |
668 |
%attr(0644,root,root) %{_mandir}/man1/mysql-stress-test.pl.1* |
669 |
%attr(0644,root,root) %{_mandir}/man1/mysql-test-run.pl.1* |
670 |
%attr(0644,root,root) %{_mandir}/man1/mysql_client_test.1* |
671 |
%attr(0644,root,root) %{_mandir}/man1/mysql_client_test_embedded.1* |
672 |
%attr(0644,root,root) %{_mandir}/man1/mysqltest.1* |
673 |
%attr(0644,root,root) %{_mandir}/man1/mysqltest_embedded.1* |
674 |
|
675 |
%files core |
676 |
%defattr(-,root,root) |
677 |
%attr(0755,root,root) %{_sbindir}/mysqld |
678 |
|
679 |
%files common-core |
680 |
%defattr(-,root,root) |
681 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/my.cnf |
682 |
%dir %{_datadir}/mysql |
683 |
%{_datadir}/mysql/english |
684 |
%{_datadir}/mysql/charsets |
685 |
|
686 |
%files common |
687 |
%defattr(-,root,root) |
688 |
%doc README COPYING |
689 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/mysqld |
690 |
%attr(0755,root,root) %{_bindir}/innochecksum |
691 |
%attr(0755,root,root) %{_bindir}/myisamchk |
692 |
%attr(0755,root,root) %{_bindir}/myisam_ftdump |
693 |
%attr(0755,root,root) %{_bindir}/myisamlog |
694 |
%attr(0755,root,root) %{_bindir}/myisampack |
695 |
%attr(0755,root,root) %{_bindir}/my_print_defaults |
696 |
%attr(0755,root,root) %{_bindir}/mysqlbug |
697 |
%attr(0755,root,root) %{_bindir}/mysql_convert_table_format |
698 |
%attr(0755,root,root) %{_bindir}/mysqld_multi |
699 |
%attr(0755,root,root) %{_bindir}/mysqld_safe |
700 |
%attr(0755,root,root) %{_bindir}/mysql_fix_extensions |
701 |
%attr(0755,root,root) %{_bindir}/mysqlhotcopy |
702 |
%attr(0755,root,root) %{_bindir}/mysql_install_db |
703 |
%attr(0755,root,root) %{_bindir}/mysql_secure_installation |
704 |
%attr(0755,root,root) %{_bindir}/mysql_setpermission |
705 |
%attr(0755,root,root) %{_bindir}/mysqltest |
706 |
%attr(0755,root,root) %{_bindir}/mysql_tzinfo_to_sql |
707 |
%attr(0755,root,root) %{_bindir}/mysql_upgrade |
708 |
%attr(0755,root,root) %{_bindir}/mysql_zap |
709 |
%attr(0755,root,root) %{_bindir}/perror |
710 |
%attr(0755,root,root) %{_bindir}/replace |
711 |
%attr(0755,root,root) %{_bindir}/resolveip |
712 |
%attr(0755,root,root) %{_bindir}/resolve_stack_dump |
713 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql |
714 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/mysql |
715 |
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/test |
716 |
%attr(0755,%{muser},%{muser}) %dir %{_var}/run/mysqld |
717 |
%attr(0755,%{muser},%{muser}) %dir %{_var}/log/mysqld |
718 |
%{_datadir}/mysql/*.cnf |
719 |
%{_datadir}/mysql/fill_help_tables.sql |
720 |
%{_datadir}/mysql/mysql_system_tables.sql |
721 |
%{_datadir}/mysql/mysql_system_tables_data.sql |
722 |
%{_datadir}/mysql/mysql_test_data_timezone.sql |
723 |
%{_datadir}/mysql/errmsg-utf8.txt |
724 |
%{_datadir}/mysql/czech |
725 |
%{_datadir}/mysql/danish |
726 |
%{_datadir}/mysql/dutch |
727 |
%{_datadir}/mysql/estonian |
728 |
%{_datadir}/mysql/french |
729 |
%{_datadir}/mysql/german |
730 |
%{_datadir}/mysql/greek |
731 |
%{_datadir}/mysql/hungarian |
732 |
%{_datadir}/mysql/italian |
733 |
%{_datadir}/mysql/japanese |
734 |
%{_datadir}/mysql/korean |
735 |
%{_datadir}/mysql/norwegian |
736 |
%{_datadir}/mysql/norwegian-ny |
737 |
%{_datadir}/mysql/polish |
738 |
%{_datadir}/mysql/portuguese |
739 |
%{_datadir}/mysql/romanian |
740 |
%{_datadir}/mysql/russian |
741 |
%{_datadir}/mysql/serbian |
742 |
%{_datadir}/mysql/slovak |
743 |
%{_datadir}/mysql/spanish |
744 |
%{_datadir}/mysql/swedish |
745 |
%{_datadir}/mysql/ukrainian |
746 |
%attr(0644,root,root) %{_mandir}/man1/innochecksum.1* |
747 |
%attr(0644,root,root) %{_mandir}/man1/myisamchk.1* |
748 |
%attr(0644,root,root) %{_mandir}/man1/myisamlog.1* |
749 |
%attr(0644,root,root) %{_mandir}/man1/myisampack.1* |
750 |
%attr(0644,root,root) %{_mandir}/man1/my_print_defaults.1* |
751 |
%attr(0644,root,root) %{_mandir}/man1/mysqlbug.1* |
752 |
%attr(0644,root,root) %{_mandir}/man1/mysql_convert_table_format.1* |
753 |
%attr(0644,root,root) %{_mandir}/man1/mysqld_multi.1* |
754 |
%attr(0644,root,root) %{_mandir}/man1/mysqld_safe.1* |
755 |
%attr(0644,root,root) %{_mandir}/man1/mysql_fix_extensions.1* |
756 |
%attr(0644,root,root) %{_mandir}/man1/mysqlhotcopy.1* |
757 |
%attr(0644,root,root) %{_mandir}/man1/mysql_install_db.1* |
758 |
%attr(0644,root,root) %{_mandir}/man1/mysqlman.1* |
759 |
%attr(0644,root,root) %{_mandir}/man1/mysql_secure_installation.1* |
760 |
%attr(0644,root,root) %{_mandir}/man1/mysql.server.1* |
761 |
%attr(0644,root,root) %{_mandir}/man1/mysql_setpermission.1* |
762 |
%attr(0644,root,root) %{_mandir}/man1/mysqlslap.1* |
763 |
%attr(0644,root,root) %{_mandir}/man1/mysql_tzinfo_to_sql.1* |
764 |
%attr(0644,root,root) %{_mandir}/man1/mysql_upgrade.1* |
765 |
%attr(0644,root,root) %{_mandir}/man1/mysql_zap.1* |
766 |
%attr(0644,root,root) %{_mandir}/man1/perror.1* |
767 |
%attr(0644,root,root) %{_mandir}/man1/replace.1* |
768 |
%attr(0644,root,root) %{_mandir}/man1/resolveip.1* |
769 |
%attr(0644,root,root) %{_mandir}/man1/resolve_stack_dump.1* |
770 |
%attr(0644,root,root) %{_mandir}/man8/mysqld.8* |
771 |
|
772 |
%files -n %{libname} |
773 |
%defattr(-,root,root) |
774 |
%doc Docs/ChangeLog |
775 |
%attr(0755,root,root) %{_libdir}/libmysqlclient.so.%{major}* |
776 |
# not sure about this one... |
777 |
|
778 |
%files -n %{libmysqlservices} |
779 |
%defattr(-,root,root) |
780 |
%attr(0755,root,root) %{_libdir}/libmysqlservices.so |
781 |
|
782 |
%files -n %{develname} |
783 |
%defattr(-,root,root) |
784 |
%doc INSTALL-SOURCE |
785 |
%multiarch %{multiarch_bindir}/mysql_config |
786 |
%attr(0755,root,root) %{_bindir}/mysql_config |
787 |
%attr(0755,root,root) %{_libdir}/libmysqlclient_r.so |
788 |
%attr(0755,root,root) %{_libdir}/libmysqlclient.so |
789 |
%dir %{_includedir}/mysql |
790 |
%dir %{_includedir}/mysql/psi |
791 |
%attr(0644,root,root) %{_includedir}/mysql/*.h |
792 |
%attr(0644,root,root) %{_includedir}/mysql/psi/*.h |
793 |
%multiarch %{multiarch_includedir}/mysql/my_config.h |
794 |
%attr(0644,root,root) %{_mandir}/man1/comp_err.1* |
795 |
%attr(0644,root,root) %{_mandir}/man1/mysql_config.1* |
796 |
%attr(0644,root,root) %{_datadir}/aclocal/mysql.m4 |
797 |
# Todo: 21/03/2011 |
798 |
# We should also delete thoses files (since we're provinding a .so |
799 |
# they're produced since we're building the libmysqld.so |
800 |
%_libdir/libmysqlclient.a |
801 |
%_libdir/libmysqlclient_r.a |
802 |
|
803 |
%files embedded |
804 |
%defattr(-,root,root) |
805 |
%doc README COPYING |
806 |
%{_libdir}/libmysqld.so.* |
807 |
|
808 |
%files embedded-devel |
809 |
%defattr(-,root,root) |
810 |
%{_libdir}/libmysqld.so |
811 |
%{_bindir}/mysql_client_test_embedded |
812 |
%{_bindir}/mysqltest_embedded |
813 |
%{_mandir}/man1/mysql_client_test_embedded.1* |
814 |
%{_mandir}/man1/mysqltest_embedded.1* |