/[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 394857 - (show annotations) (download)
Wed Feb 6 16:09:15 2013 UTC (8 years, 3 months ago) by luigiwalser
File size: 30240 byte(s)
- remove anonymous user in default installation so that CVE-2012-5615
  isn't exploitable anymore in new installations if the network port
  is opened

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

  ViewVC Help
Powered by ViewVC 1.1.28