/[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 393865 - (show annotations) (download)
Fri Feb 1 01:38:41 2013 UTC (11 years, 2 months ago) by luigiwalser
File size: 30158 byte(s)
- Add MariaDB patches to fix:
  - CVE-2012-5627
  - MDEV-4029
  - a buffer overflow (similar to CVE-2012-5611)

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

  ViewVC Help
Powered by ViewVC 1.1.30