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

  ViewVC Help
Powered by ViewVC 1.1.30