2 # - C(XX)FLAGS for innodb subdirs are overriden by ./configure!
3 # - http://bugs.mysql.com/bug.php?id=16470
6 %bcond_with bdb # Berkeley DB support
7 %bcond_without innodb # InnoDB storage engine support
8 %bcond_with sphinx # Sphinx storage engine support
9 %bcond_without raid # Without raid
10 %bcond_without ssl # Without OpenSSL
11 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
12 %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms
14 %include /usr/lib/rpm/macros.perl
15 #define _snap 20060111
16 Summary: MySQL: a very fast and reliable SQL database engine
17 Summary(de): MySQL: ist eine SQL-Datenbank
18 Summary(fr): MySQL: un serveur SQL rapide et fiable
19 Summary(pl): MySQL: bardzo szybka i niezawodna baza danych (SQL)
20 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
21 Summary(ru): MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
22 Summary(uk): MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
23 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
27 License: GPL + MySQL FLOSS Exception
28 Group: Applications/Databases
29 #Source0: ftp://ftp.mysql.com/pub/mysql/src/%{name}-%{version}.tar.gz
30 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
31 # Source0-md5: b45cd6c89e35dfc1cdbe1a1f782aefbf
32 Source100: http://www.sphinxsearch.com/downloads/sphinx-0.9.7.tar.gz
33 # Source100-md5: 32f2b7e98d8485c86108851d52c5cef4
35 Source2: %{name}.sysconfig
36 Source3: %{name}.logrotate
37 Source4: %{name}d.conf
38 Source5: %{name}-clusters.conf
39 Source7: %{name}-ndb.init
40 Source8: %{name}-ndb.sysconfig
41 Source9: %{name}-ndb-mgm.init
42 Source10: %{name}-ndb-mgm.sysconfig
43 Source11: %{name}-ndb-cpc.init
44 Source12: %{name}-ndb-cpc.sysconfig
45 Source13: %{name}-client.conf
46 Patch0: %{name}-libs.patch
47 Patch1: %{name}-sphinx.patch
48 Patch2: %{name}-c++.patch
49 Patch3: %{name}-info.patch
50 Patch4: %{name}-sql-cxx-pic.patch
51 Patch5: %{name}-noproc.patch
52 Patch6: %{name}-fix_privilege_tables.patch
53 Patch7: %{name}-align.patch
54 Patch8: %{name}-client-config.patch
55 Patch9: %{name}-build.patch
56 Patch10: %{name}-alpha.patch
57 Patch11: %{name}-ndb-ldflags.patch
58 Patch12: %{name}-bug-20153.patch
59 Patch13: %{name}-bug-28337.patch
60 URL: http://www.mysql.com/products/database/mysql/community_edition.html
61 BuildRequires: autoconf
62 BuildRequires: automake
63 %{?with_bdb:BuildRequires: db3-devel}
64 BuildRequires: libstdc++-devel >= 5:3.0
65 BuildRequires: libtool
66 %{?with_tcpd:BuildRequires: libwrap-devel}
67 BuildRequires: ncurses-devel >= 4.2
68 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
69 BuildRequires: perl-DBI
70 BuildRequires: perl-devel >= 1:5.6.1
71 BuildRequires: readline-devel >= 4.2
72 BuildRequires: rpm-perlprov >= 4.1-13
73 BuildRequires: rpmbuild(macros) >= 1.268
74 BuildRequires: sed >= 4.0
75 BuildRequires: texinfo
76 BuildRequires: zlib-devel
77 Requires(post,preun): /sbin/chkconfig
78 Requires(postun): /usr/sbin/groupdel
79 Requires(postun): /usr/sbin/userdel
80 Requires(pre): /bin/id
81 Requires(pre): /usr/bin/getgid
82 Requires(pre): /usr/sbin/groupadd
83 Requires(pre): /usr/sbin/useradd
84 Requires(triggerpostun): sed >= 4.0
85 Requires: %{name}-charsets = %{version}-%{release}
86 Requires: /usr/bin/setsid
87 Requires: rc-scripts >= 0.2.0
88 Provides: MySQL-server
89 Provides: group(mysql)
93 Obsoletes: mysql-server
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define _libexecdir %{_sbindir}
97 %define _localstatedir /var/lib/mysql
98 %define _mysqlhome /home/services/mysql
100 %define _noautoreqdep 'perl(DBD::mysql)'
101 # CFLAGS for innodb are altered
102 %undefine configure_cache
105 MySQL is a true multi-user, multi-threaded SQL (Structured Query
106 Language) database server. SQL is the most popular database language
107 in the world. MySQL is a client/server implementation that consists of
108 a server daemon mysqld and many different client programs/libraries.
110 The main goals of MySQL are speed, robustness and easy to use. MySQL
111 was originally developed because we at Tcx needed a SQL server that
112 could handle very big databases with magnitude higher speed than what
113 any database vendor could offer to us. We have now been using MySQL
114 since 1996 in a environment with more than 40 databases, 10,000
115 tables, of which more than 500 have more than 7 million rows. This is
116 about 50G of mission critical data.
118 The base upon which MySQL is built is a set of routines that have been
119 used in a highly demanding production environment for many years.
120 While MySQL is still in development, it already offers a rich and
121 highly useful function set.
124 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
125 multi-taches. Le langage SQL est le langage de bases de donnees le
126 plus populaire au monde. MySQL est une implementation client/serveur
127 qui consiste en un serveur (mysqld) et differents
128 programmes/bibliotheques clientes.
130 Les objectifs principaux de MySQL sont: vitesse, robustesse et
131 facilite d'utilisation. MySQL fut originalement developpe parce que
132 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
133 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
134 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
135 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
136 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
137 millions de lignes. Ceci represente environ 50G de donnees critiques.
139 A la base de la conception de MySQL, on retrouve une serie de routines
140 qui ont ete utilisees dans un environnement de production pendant
141 plusieurs annees. Meme si MySQL est encore en developpement, il offre
142 deja une riche et utile serie de fonctions.
145 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
146 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
147 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
148 mysqld i wielu ró¿nych programów i bibliotek klienckich.
150 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
151 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
152 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
153 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
154 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
155 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
156 50GB krytycznych danych.
158 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
159 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
160 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
161 i u¿yteczny zbiór funkcji.
164 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
165 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
166 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
167 einem Primärschlüssel versehen werden. Es ist aber keine Definition
168 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
169 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
170 Daten verantwortlich. Allein durch die Nutzung externer
171 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
172 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
174 %description -l pt_BR
175 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
176 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
177 dados no mundo. O MySQL é uma implementação cliente/servidor que
178 consiste de um servidor chamado mysqld e diversos
179 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
180 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
181 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
182 pudesse lidar com grandes bases de dados e com uma velocidade muito
183 maior do que a que qualquer vendedor podia nos oferecer. Estamos
184 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
185 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
186 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
187 A base da construção do MySQL é uma série de rotinas que foram usadas
188 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
189 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
190 funções muito ricas e úteis. Veja a documentação para maiores
194 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
195 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
196 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
200 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
201 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
202 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
206 Summary: MySQL - character sets definitions
207 Summary(pl): MySQL - definicje kodowañ znaków
208 Group: Applications/Databases
210 %description charsets
211 This package contains character sets definitions needed by both client
214 %description charsets -l pl
215 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
219 Summary: MySQL additional utilities
220 Summary(pl): Dodatkowe narzêdzia do MySQL
221 Group: Applications/Databases
222 Requires: %{name}-libs = %{version}-%{release}
225 MySQL additional utilities except Perl scripts (they may be found in
226 %{name}-extras-perl package).
228 %description extras -l pl
229 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
230 pakiecie %{name}-extras-perl).
233 Summary: MySQL additional utilities written in Perl
234 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
235 Group: Applications/Databases
236 Requires: %{name}-extras = %{version}-%{release}
237 Requires: perl(DBD::mysql)
239 %description extras-perl
240 MySQL additional utilities written in Perl.
242 %description extras-perl -l pl
243 Dodatkowe narzêdzia do MySQL napisane w Perlu.
246 Summary: MySQL - Client
247 Summary(pl): MySQL - Klient
248 Summary(pt): MySQL - Cliente
249 Summary(ru): MySQL ËÌÉÅÎÔ
250 Summary(uk): MySQL Ë̦¤ÎÔ
251 Group: Applications/Databases
252 Requires: %{name}-charsets = %{version}-%{release}
253 Requires: %{name}-libs = %{version}-%{release}
254 Obsoletes: MySQL-client
257 This package contains the standard MySQL clients.
259 %description client -l fr
260 Ce package contient les clients MySQL standards.
262 %description client -l pl
263 Standardowe programy klienckie MySQL.
265 %description client -l pt_BR
266 Este pacote contém os clientes padrão para o MySQL.
268 %description client -l ru
269 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
271 %description client -l uk
272 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
275 Summary: Shared libraries for MySQL
276 Summary(pl): Biblioteki dzielone MySQL
278 Obsoletes: libmysql10
279 Obsoletes: mysql-doc < 4.1.12
282 Shared libraries for MySQL.
284 %description libs -l pl
285 Biblioteki dzielone MySQL.
288 Summary: MySQL - Development header files and libraries
289 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
290 Summary(pt): MySQL - Medições de desempenho
291 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
292 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
293 Group: Development/Libraries
294 Requires: %{name}-libs = %{version}-%{release}
295 %{?with_ssl:Requires: openssl-devel}
297 Obsoletes: MySQL-devel
298 Obsoletes: libmysql10-devel
301 This package contains the development header files and libraries
302 necessary to develop MySQL client applications.
304 %description devel -l fr
305 Ce package contient les fichiers entetes et les librairies de
306 developpement necessaires pour developper des applications clientes
309 %description devel -l pl
310 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
313 %description devel -l pt_BR
314 Este pacote contém os arquivos de cabeçalho (header files) e
315 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
317 %description devel -l ru
318 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
319 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
321 %description devel -l uk
322 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
323 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
326 Summary: MySQL static libraries
327 Summary(pl): Biblioteki statyczne MySQL
328 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
329 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
330 Group: Development/Libraries
331 Requires: %{name}-devel = %{version}-%{release}
332 Obsoletes: MySQL-static
335 MySQL static libraries.
337 %description static -l pl
338 Biblioteki statyczne MySQL.
340 %description static -l ru
341 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
342 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
344 %description static -l uk
345 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
346 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
349 Summary: MySQL - Benchmarks
350 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
351 Summary(pt): MySQL - Medições de desempenho
352 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
353 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
354 Group: Applications/Databases
355 Requires: %{name} = %{version}-%{release}
356 Requires: %{name}-client
357 Requires: perl(DBD::mysql)
358 Obsoletes: MySQL-bench
361 This package contains MySQL benchmark scripts and data.
363 %description bench -l pl
364 Programy testuj±ce szybko¶æ serwera MySQL.
366 %description bench -l pt_BR
367 Este pacote contém medições de desempenho de scripts e dados do MySQL.
369 %description bench -l ru
370 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
373 %description bench -l uk
374 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
377 Summary: MySQL manual
378 Summary(pl): Podrêcznik u¿ytkownika MySQL
379 Group: Applications/Databases
382 This package contains manual in HTML format.
384 %description doc -l pl
385 Podrêcznik MySQL-a w formacie HTML.
388 Summary: MySQL - NDB Storage Engine Daemon
389 Summary(pl): MySQL - demon silnika przechowywania danych NDB
390 Group: Applications/Databases
391 Requires: %{name}-libs = %{version}-%{release}
394 This package contains the standard MySQL NDB Storage Engine Daemon.
396 %description ndb -l pl
397 Ten pakiet zawiera standardowego demona silnika przechowywania danych
401 Summary: MySQL - NDB Clients
402 Summary(pl): MySQL - programy klienckie NDB
403 Group: Applications/Databases
404 Requires: %{name}-libs = %{version}-%{release}
406 %description ndb-client
407 This package contains the standard MySQL NDB Clients.
409 %description ndb-client -l pl
410 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
413 Summary: MySQL - NDB Management Daemon
414 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
415 Group: Applications/Databases
416 Requires: %{name}-libs = %{version}-%{release}
419 This package contains the standard MySQL NDB Management Daemon.
421 %description ndb-mgm -l pl
422 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
425 Summary: MySQL - NDB CPC Daemon
426 Summary(pl): MySQL - demon NDB CPC
427 Group: Applications/Databases
428 Requires: %{name}-libs = %{version}-%{release}
431 This package contains the standard MySQL NDB CPC Daemon.
433 %description ndb-cpc -l pl
434 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
437 %setup -q %{?_snap:-n %{name}-%{version}-nightly-%{_snap}} %{?with_sphinx:-a100}
440 mv sphinx-*/mysqlse sql/sphinx
446 # this is strange: mysqld functions for UDF modules are not explicitly defined,
447 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
448 # in objects compiled without -fPIC
468 # The compiler flags are as per their "official" spec ;)
469 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
470 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
472 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
473 # and therefore do not add BR on these. These are here just to satisfy
478 FIND_PROC='/bin/ps p $$PID' \
480 CHECK_PID='/bin/kill -0 $$PID' \
482 --enable-largefile=yes \
485 --enable-thread-safe-client \
486 --with%{!?with_bdb:out}-berkeley-db \
487 --with%{!?with_innodb:out}-innodb \
488 --with%{!?with_raid:out}-raid \
489 --with%{!?with_ssl:out}-openssl \
490 --with%{!?with_tcpd:out}-libwrap \
491 %{?with_big_tables:--with-big-tables} \
492 --with-comment="PLD Linux Distribution MySQL RPM" \
493 --with%{!?debug:out}-debug \
494 --with%{!?debug:out}-ndb-debug \
495 --with-embedded-server \
496 --with-extra-charsets=all \
498 --with-mysqld-user=mysql \
499 --with-named-curses-libs="-lncurses" \
500 --with-named-thread-libs="-lpthread" \
501 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
502 --with-archive-storage-engine \
503 %{?with_sphinx:--with-sphinx-storage-engine} \
510 # --with-ndb-test --with-ndb-docs
512 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
513 # (it defaults to first cluster but user may change it to whatever
516 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
519 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
521 %{__make} -C Docs mysql.info
524 rm -rf $RPM_BUILD_ROOT
525 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql} \
526 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
527 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
530 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
535 DESTDIR=$RPM_BUILD_ROOT \
536 benchdir=%{_datadir}/sql-bench \
538 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
540 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
542 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
543 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
544 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
545 # This is template for configuration file which is created after 'service mysql init'
546 install %{SOURCE4} mysqld.conf
547 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
548 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
550 # remove innodb directives from mysqld.conf if mysqld is configured without
552 echo "BASE_TABLETYPE=MyISAM" >> $RPM_BUILD_ROOT/etc/sysconfig/mysql
553 cp mysqld.conf mysqld.tmp
554 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
557 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
559 cp mysqld.conf mysqld.tmp
560 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
563 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
564 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
567 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
568 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
569 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
570 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
571 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
572 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
573 # remove .txt variants for .sys messages
574 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
576 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
577 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
579 # remove known unpackaged files
580 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
582 # rename not to be so generic name
583 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
584 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
586 # not useful without -debug build
587 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
588 # generate symbols file, so one can generate backtrace using it
589 # mysql_resolve_stack_dump -s %{_datadir}/mysql/mysqld.sym -n mysqld.stack.
590 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
591 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
593 # functionality in initscript / rpm
594 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
595 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
596 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
597 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
598 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
599 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
600 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
601 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
602 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
603 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
604 rm $RPM_BUILD_ROOT%{_mandir}/man1/safe_mysqld*
605 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
606 rm $RPM_BUILD_ROOT%{_mandir}/man1/make_win_bin_dist.1
607 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_install_db.1
608 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_waitpid.1
611 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
614 rm -rf $RPM_BUILD_ROOT
617 %groupadd -g 89 mysql
618 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
621 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
622 /sbin/chkconfig --add mysql
623 %service mysql restart
626 if [ "$1" = "0" ]; then
627 %service -q mysql stop
628 /sbin/chkconfig --del mysql
632 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
633 if [ "$1" = "0" ]; then
639 /sbin/chkconfig --add mysql-ndb
640 %service mysql-ndb restart "mysql NDB engine"
643 if [ "$1" = "0" ]; then
644 %service mysql-ndb stop
645 /sbin/chkconfig --del mysql-ndb
649 /sbin/chkconfig --add mysql-ndb-mgm
650 %service mysql-ndb-mgm restart "mysql NDB management node"
653 if [ "$1" = "0" ]; then
654 %service mysql-ndb-mgm stop
655 /sbin/chkconfig --del mysql-ndb-mgm
659 /sbin/chkconfig --add mysql-ndb-cpc
660 %service mysql-ndb-cpc restart "mysql NDB CPC"
663 if [ "$1" = "0" ]; then
664 %service mysql-ndb-cpc stop
665 /sbin/chkconfig --del mysql-ndb-cpc
668 %post libs -p /sbin/ldconfig
669 %postun libs -p /sbin/ldconfig
671 %triggerpostun -- mysql <= 4.0.20-2
672 # For clusters in /etc/mysql/clusters.conf
673 if [ -f "/etc/sysconfig/mysql" ]; then
674 . /etc/sysconfig/mysql
675 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
676 for i in "$MYSQL_DB_CLUSTERS"; do
677 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
679 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
680 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
681 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
682 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
686 %triggerpostun -- mysql <= 4.1.1
687 # For better compatibility with prevoius versions:
688 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
689 if echo "$config" | grep -q '^/'; then
690 config_file="$config"
691 elif [ -f "/etc/mysql/$config" ]; then
692 config_file=/etc/mysql/$config
694 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
695 if [ -z "$clusterdir" ]; then
696 echo >&2 "Can't find cluster dir for $config!"
697 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
700 config_file="$clusterdir/mysqld.conf"
703 if [ ! -f "$config_file" ]; then
704 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
707 echo "Adding option old-passwords to config: $config_file"
708 echo "If you want to use new, better passwords - remove it"
710 # sed magic to add 'old-passwords' to [mysqld] section
711 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
713 a; Compatibility options:
719 %banner -e %{name}-4.1.x <<-EOF
720 If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
721 mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
726 %defattr(644,root,root,755)
727 %doc support-files/*.cnf support-files/*.ini
728 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
729 %attr(754,root,root) /etc/rc.d/init.d/mysql
730 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
731 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
732 %attr(755,root,root) %{_bindir}/innochecksum
733 %attr(755,root,root) %{_bindir}/myisamchk
734 %attr(755,root,root) %{_bindir}/myisamlog
735 %attr(755,root,root) %{_bindir}/myisampack
736 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
737 %attr(755,root,root) %{_bindir}/my_print_defaults
738 %attr(755,root,root) %{_bindir}/mysql_upgrade
739 %attr(755,root,root) %{_bindir}/mysql_upgrade_shell
740 %attr(755,root,root) %{_sbindir}/mysqld
741 %{_mandir}/man1/mysql_fix_privilege_tables.1*
742 %{_mandir}/man1/my_print_defaults.1*
743 %{_mandir}/man1/myisamchk.1*
744 %{_mandir}/man1/myisamlog.1*
745 %{_mandir}/man1/myisampack.1*
746 %{_mandir}/man1/mysql_upgrade.1*
747 %{_mandir}/man1/innochecksum.1*
748 %{_mandir}/man8/mysqld.8*
750 %attr(700,mysql,mysql) %{_mysqlhome}
751 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
752 %attr(751,root,root) /var/lib/mysql
753 %attr(750,mysql,mysql) %dir /var/log/mysql
754 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
755 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
757 %{_infodir}/mysql.info*
758 # This is template for configuration file which is created after 'service mysql init'
759 %{_datadir}/mysql/mysqld.conf
760 %{_datadir}/mysql/english
761 %{_datadir}/mysql/fill_help_tables.sql
762 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
763 %lang(cs) %{_datadir}/mysql/czech
764 %lang(da) %{_datadir}/mysql/danish
765 %lang(de) %{_datadir}/mysql/german
766 %lang(el) %{_datadir}/mysql/greek
767 %lang(es) %{_datadir}/mysql/spanish
768 %lang(et) %{_datadir}/mysql/estonian
769 %lang(fr) %{_datadir}/mysql/french
770 %lang(hu) %{_datadir}/mysql/hungarian
771 %lang(it) %{_datadir}/mysql/italian
772 %lang(ja) %{_datadir}/mysql/japanese
773 %lang(ko) %{_datadir}/mysql/korean
774 %lang(nl) %{_datadir}/mysql/dutch
775 %lang(nb) %{_datadir}/mysql/norwegian
776 %lang(nn) %{_datadir}/mysql/norwegian-ny
777 %lang(pl) %{_datadir}/mysql/polish
778 %lang(pt) %{_datadir}/mysql/portuguese
779 %lang(ro) %{_datadir}/mysql/romanian
780 %lang(ru) %{_datadir}/mysql/russian
781 %lang(sr) %{_datadir}/mysql/serbian
782 %lang(sk) %{_datadir}/mysql/slovak
783 %lang(sv) %{_datadir}/mysql/swedish
784 %lang(uk) %{_datadir}/mysql/ukrainian
787 %defattr(644,root,root,755)
788 %dir %{_datadir}/mysql
789 %{_datadir}/mysql/charsets
792 %defattr(644,root,root,755)
793 %attr(755,root,root) %{_bindir}/msql2mysql
794 %attr(755,root,root) %{_bindir}/myisam_ftdump
795 %attr(755,root,root) %{_bindir}/mysql_secure_installation
796 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
797 %attr(755,root,root) %{_bindir}/mysqlcheck
798 %attr(755,root,root) %{_bindir}/perror
799 %attr(755,root,root) %{_bindir}/replace
800 %attr(755,root,root) %{_bindir}/resolveip
801 %{_mandir}/man1/msql2mysql.1*
802 %{_mandir}/man1/myisam_ftdump.1*
803 %{_mandir}/man1/mysql_tzinfo_to_sql.1*
804 %{_mandir}/man1/mysqlcheck.1*
805 %{_mandir}/man1/perror.1*
806 %{_mandir}/man1/replace.1*
807 %{_mandir}/man1/mysql_secure_installation.1*
810 %defattr(644,root,root,755)
811 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
812 %attr(755,root,root) %{_bindir}/mysql_explain_log
813 %attr(755,root,root) %{_bindir}/mysql_find_rows
814 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
815 %attr(755,root,root) %{_bindir}/mysql_setpermission
816 %attr(755,root,root) %{_bindir}/mysql_tableinfo
817 %attr(755,root,root) %{_bindir}/mysql_zap
818 %attr(755,root,root) %{_bindir}/mysqlaccess
819 %attr(755,root,root) %{_bindir}/mysqldumpslow
820 %attr(755,root,root) %{_bindir}/mysqlhotcopy
821 %{_mandir}/man1/mysql_explain_log.1*
822 %{_mandir}/man1/mysql_zap.1*
823 %{_mandir}/man1/mysqlaccess.1*
824 %{_mandir}/man1/mysqlhotcopy.1*
825 %{_mandir}/man1/mysql_setpermission.1*
826 %{_mandir}/man1/mysql_tableinfo.1*
827 %{_mandir}/man1/mysql_fix_extensions.1*
828 %{_mandir}/man1/mysql_find_rows.1*
829 %{_mandir}/man1/mysql_convert_table_format.1*
832 %defattr(644,root,root,755)
833 %attr(755,root,root) %{_bindir}/mysql
834 %attr(755,root,root) %{_bindir}/mysqlbug
835 %attr(755,root,root) %{_bindir}/mysqldump
836 %attr(755,root,root) %{_bindir}/mysqlimport
837 %attr(755,root,root) %{_sbindir}/mysqlmanager*
838 %attr(755,root,root) %{_bindir}/mysqlshow
839 %attr(755,root,root) %{_bindir}/mysqlbinlog
840 %attr(755,root,root) %{_bindir}/mysqladmin
841 %attr(755,root,root) %{_bindir}/mysqltest*
842 %{_mandir}/man1/mysql.1*
843 %{_mandir}/man1/mysqladmin.1*
844 %{_mandir}/man1/mysqldump.1*
845 %{_mandir}/man1/mysqlshow.1*
846 %{_mandir}/man1/mysqlbinlog.1*
847 %{_mandir}/man1/mysqlimport.1*
848 %{_mandir}/man1/mysqltest*.1*
849 %{_mandir}/man1/mysqlmanager*.1*
850 %{_mandir}/man8/mysqlmanager.8*
853 %defattr(644,root,root,755)
854 %doc EXCEPTIONS-CLIENT
855 %attr(755,root,root) %{_libdir}/lib*.so.*.*
856 %attr(751,root,root) %dir %{_sysconfdir}/mysql
857 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
860 %defattr(644,root,root,755)
861 %attr(755,root,root) %{_bindir}/mysql_config
862 %attr(755,root,root) %{_libdir}/lib*.so
863 %attr(755,root,root) %{_bindir}/*comp_err
864 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
865 %{?debug:%{_datadir}/mysql/mysqld.sym}
867 %{_libdir}/lib*[!tr].a
869 %{_mandir}/man1/mysql_config.1*
870 %{?debug:%{_mandir}/man1/resolve_stack_dump.1*}
873 %defattr(644,root,root,755)
874 %{_libdir}/lib*[tr].a
877 %defattr(644,root,root,755)
878 %attr(755,root,root) %{_bindir}/mysqltest
879 %attr(755,root,root) %{_bindir}/mysql_client_test
880 %dir %{_datadir}/sql-bench
881 %{_datadir}/sql-bench/[CDRl]*
882 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
884 %{_datadir}/mysql/mi_test_all.res
885 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
886 %{_mandir}/man1/mysql_client_test.1*
889 #%defattr(644,root,root,755)
890 #%doc Docs/manual.html Docs/manual_toc.html
893 %defattr(644,root,root,755)
894 %attr(755,root,root) %{_sbindir}/ndbd
895 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
896 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
897 %{_mandir}/man1/ndbd.1*
900 %defattr(644,root,root,755)
901 %attr(755,root,root) %{_bindir}/ndb_*
902 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
903 %{_mandir}/man1/ndb_*.1*
904 %exclude %{_mandir}/man1/ndb_mgmd.1*
905 %exclude %{_mandir}/man1/ndb_cpcd.1*
908 %defattr(644,root,root,755)
909 %attr(755,root,root) %{_sbindir}/ndb_mgmd
910 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
911 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
912 %{_mandir}/man1/ndb_mgmd.1*
915 %defattr(644,root,root,755)
916 %attr(755,root,root) %{_sbindir}/ndb_cpcd
917 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
918 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
919 %{_mandir}/man1/ndb_cpcd.1*