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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30