/[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 75676 - (show annotations) (download)
Tue Mar 22 22:09:12 2011 UTC (13 years, 1 month ago) by dmorgan
Original Path: cauldron/mysql/current/SPECS/mysql.spec
File size: 27483 byte(s)
Merge branches commits 75376 && 75223 

Follow fedora's spec to build libmysqld.so ( embedded library)
- Add packages  %name-embedded & %name-embedded-devel
- Remove the -devel-static package (since we're building a .so before)
- Dont delete mysqltest_embedded 

the mysql embedded library should be in %{_libdir} & not in %{_libdir}/mysql (this fix amarok mysql-e usage)
Use 0755 mode for /var/lib/mysql like fedora does


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

  ViewVC Help
Powered by ViewVC 1.1.30