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

  ViewVC Help
Powered by ViewVC 1.1.30