/[packages]/updates/1/mysql/current/SPECS/mysql.spec
ViewVC logotype

Contents of /updates/1/mysql/current/SPECS/mysql.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30