2 # - trigger that prepares system from pre-cluster into cluster
3 # - trigger /etc/mysqld.conf into /etc/mysql/mysqld.conf. Solve possible
4 # conflict with /var/lib/mysql/mysqld.conf
5 # - C(XX)FLAGS for innodb subdirs are overriden by ./configre!
6 # - http://bugs.mysql.com/bug.php?id=16470
9 %bcond_with bdb # Berkeley DB support
10 %bcond_without innodb # Without InnoDB support
11 %bcond_without raid # Without raid
12 %bcond_without ssl # Without OpenSSL
13 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
14 %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms
16 %include /usr/lib/rpm/macros.perl
17 #define _snap 20060111
18 Summary: MySQL: a very fast and reliable SQL database engine
19 Summary(de): MySQL: ist eine SQL-Datenbank
20 Summary(fr): MySQL: un serveur SQL rapide et fiable
21 Summary(pl): MySQL: bardzo szybka i niezawodna baza danych (SQL)
22 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
23 Summary(ru): MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
24 Summary(uk): MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
25 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
29 License: GPL + MySQL FLOSS Exception
30 Group: Applications/Databases
31 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
32 # Source0-md5: f18153b0239aaa03fc5a751f2d82cb71
33 #Source0: http://downloads.mysql.com/snapshots/mysql-5.0/%{name}-%{version}-nightly-%{_snap}.tar.gz
35 Source2: %{name}.sysconfig
36 Source3: %{name}.logrotate
37 Source4: %{name}d.conf
38 Source5: %{name}-clusters.conf
39 Source6: %{name}.monitrc
40 Source7: %{name}-ndb.init
41 Source8: %{name}-ndb.sysconfig
42 Source9: %{name}-ndb-mgm.init
43 Source10: %{name}-ndb-mgm.sysconfig
44 Source11: %{name}-ndb-cpc.init
45 Source12: %{name}-ndb-cpc.sysconfig
46 Source13: %{name}-client.conf
47 Patch0: %{name}-libs.patch
48 Patch1: %{name}-libwrap.patch
49 Patch2: %{name}-c++.patch
50 Patch3: %{name}-info.patch
51 Patch4: %{name}-sql-cxx-pic.patch
52 Patch5: %{name}-noproc.patch
53 Patch6: %{name}-fix_privilege_tables.patch
54 Patch7: %{name}-align.patch
55 Patch8: %{name}-client-config.patch
56 Patch9: %{name}-build.patch
57 Patch10: %{name}-alpha.patch
58 Patch11: %{name}-bug-14057.patch
59 URL: http://www.mysql.com/
60 BuildRequires: autoconf
61 BuildRequires: automake
62 %{?with_bdb:BuildRequires: db3-devel}
63 BuildRequires: libstdc++-devel >= 5:3.0
64 BuildRequires: libtool
65 %{?with_tcpd:BuildRequires: libwrap-devel}
66 BuildRequires: ncurses-devel >= 4.2
67 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
68 BuildRequires: perl-DBI
69 BuildRequires: perl-devel >= 1:5.6.1
70 BuildRequires: readline-devel >= 4.2
71 BuildRequires: rpm-perlprov >= 4.1-13
72 BuildRequires: rpmbuild(macros) >= 1.268
73 BuildRequires: sed >= 4.0
74 BuildRequires: texinfo
75 BuildRequires: zlib-devel
76 Requires(post,preun): /sbin/chkconfig
77 Requires(postun): /usr/sbin/groupdel
78 Requires(postun): /usr/sbin/userdel
79 Requires(pre): /bin/id
80 Requires(pre): /usr/bin/getgid
81 Requires(pre): /usr/sbin/groupadd
82 Requires(pre): /usr/sbin/useradd
83 Requires(triggerpostun): sed >= 4.0
84 Requires: %{name}-charsets = %{version}-%{release}
85 Requires: /usr/bin/setsid
86 Requires: rc-scripts >= 0.2.0
87 Provides: MySQL-server
88 Provides: group(mysql)
92 Obsoletes: mysql-server
93 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95 %define _libexecdir %{_sbindir}
96 %define _localstatedir /var/lib/mysql
97 %define _mysqlhome /home/services/mysql
99 %define _noautoreqdep 'perl(DBD::mysql)'
102 MySQL is a true multi-user, multi-threaded SQL (Structured Query
103 Language) database server. SQL is the most popular database language
104 in the world. MySQL is a client/server implementation that consists of
105 a server daemon mysqld and many different client programs/libraries.
107 The main goals of MySQL are speed, robustness and easy to use. MySQL
108 was originally developed because we at Tcx needed a SQL server that
109 could handle very big databases with magnitude higher speed than what
110 any database vendor could offer to us. We have now been using MySQL
111 since 1996 in a environment with more than 40 databases, 10,000
112 tables, of which more than 500 have more than 7 million rows. This is
113 about 50G of mission critical data.
115 The base upon which MySQL is built is a set of routines that have been
116 used in a highly demanding production environment for many years.
117 While MySQL is still in development, it already offers a rich and
118 highly useful function set.
121 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
122 multi-taches. Le langage SQL est le langage de bases de donnees le
123 plus populaire au monde. MySQL est une implementation client/serveur
124 qui consiste en un serveur (mysqld) et differents
125 programmes/bibliotheques clientes.
127 Les objectifs principaux de MySQL sont: vitesse, robustesse et
128 facilite d'utilisation. MySQL fut originalement developpe parce que
129 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
130 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
131 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
132 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
133 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
134 millions de lignes. Ceci represente environ 50G de donnees critiques.
136 A la base de la conception de MySQL, on retrouve une serie de routines
137 qui ont ete utilisees dans un environnement de production pendant
138 plusieurs annees. Meme si MySQL est encore en developpement, il offre
139 deja une riche et utile serie de fonctions.
142 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
143 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
144 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
145 mysqld i wielu ró¿nych programów i bibliotek klienckich.
147 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
148 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
149 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
150 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
151 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
152 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
153 50GB krytycznych danych.
155 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
156 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
157 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
158 i u¿yteczny zbiór funkcji.
161 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
162 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
163 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
164 einem Primärschlüssel versehen werden. Es ist aber keine Definition
165 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
166 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
167 Daten verantwortlich. Allein durch die Nutzung externer
168 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
169 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
171 %description -l pt_BR
172 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
173 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
174 dados no mundo. O MySQL é uma implementação cliente/servidor que
175 consiste de um servidor chamado mysqld e diversos
176 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
177 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
178 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
179 pudesse lidar com grandes bases de dados e com uma velocidade muito
180 maior do que a que qualquer vendedor podia nos oferecer. Estamos
181 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
182 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
183 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
184 A base da construção do MySQL é uma série de rotinas que foram usadas
185 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
186 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
187 funções muito ricas e úteis. Veja a documentação para maiores
191 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
192 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
193 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
197 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
198 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
199 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
203 Summary: MySQL - character sets definitions
204 Summary(pl): MySQL - definicje kodowañ znaków
205 Group: Applications/Databases
207 %description charsets
208 This package contains character sets definitions needed by both client
211 %description charsets -l pl
212 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
216 Summary: MySQL additional utilities
217 Summary(pl): Dodatkowe narzêdzia do MySQL
218 Group: Applications/Databases
219 Requires: %{name}-libs = %{version}-%{release}
222 MySQL additional utilities except Perl scripts (they may be found in
223 %{name}-extras-perl package).
225 %description extras -l pl
226 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
227 pakiecie %{name}-extras-perl).
230 Summary: MySQL additional utilities written in Perl
231 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
232 Group: Applications/Databases
233 Requires: %{name}-extras = %{version}-%{release}
234 Requires: perl(DBD::mysql)
236 %description extras-perl
237 MySQL additional utilities written in Perl.
239 %description extras-perl -l pl
240 Dodatkowe narzêdzia do MySQL napisane w Perlu.
243 Summary: MySQL - Client
244 Summary(pl): MySQL - Klient
245 Summary(pt): MySQL - Cliente
246 Summary(ru): MySQL ËÌÉÅÎÔ
247 Summary(uk): MySQL Ë̦¤ÎÔ
248 Group: Applications/Databases
249 Requires: %{name}-charsets = %{version}-%{release}
250 Requires: %{name}-libs = %{version}-%{release}
251 Obsoletes: MySQL-client
254 This package contains the standard MySQL clients.
256 %description client -l fr
257 Ce package contient les clients MySQL standards.
259 %description client -l pl
260 Standardowe programy klienckie MySQL.
262 %description client -l pt_BR
263 Este pacote contém os clientes padrão para o MySQL.
265 %description client -l ru
266 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
268 %description client -l uk
269 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
272 Summary: Shared libraries for MySQL
273 Summary(pl): Biblioteki dzielone MySQL
275 Obsoletes: libmysql10
276 Obsoletes: mysql-doc < 4.1.12
279 Shared libraries for MySQL.
281 %description libs -l pl
282 Biblioteki dzielone MySQL.
285 Summary: MySQL - Development header files and libraries
286 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
287 Summary(pt): MySQL - Medições de desempenho
288 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
289 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
290 Group: Development/Libraries
291 Requires: %{name}-libs = %{version}-%{release}
292 %{?with_ssl:Requires: openssl-devel}
294 Obsoletes: MySQL-devel
295 Obsoletes: libmysql10-devel
298 This package contains the development header files and libraries
299 necessary to develop MySQL client applications.
301 %description devel -l fr
302 Ce package contient les fichiers entetes et les librairies de
303 developpement necessaires pour developper des applications clientes
306 %description devel -l pl
307 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
310 %description devel -l pt_BR
311 Este pacote contém os arquivos de cabeçalho (header files) e
312 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
314 %description devel -l ru
315 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
316 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
318 %description devel -l uk
319 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
320 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
323 Summary: MySQL static libraries
324 Summary(pl): Biblioteki statyczne MySQL
325 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
326 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
327 Group: Development/Libraries
328 Requires: %{name}-devel = %{version}-%{release}
329 Obsoletes: MySQL-static
332 MySQL static libraries.
334 %description static -l pl
335 Biblioteki statyczne MySQL.
337 %description static -l ru
338 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
339 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
341 %description static -l uk
342 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
343 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
346 Summary: MySQL - Benchmarks
347 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
348 Summary(pt): MySQL - Medições de desempenho
349 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
350 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
351 Group: Applications/Databases
352 Requires: %{name} = %{version}-%{release}
353 Requires: %{name}-client
354 Requires: perl(DBD::mysql)
355 Obsoletes: MySQL-bench
358 This package contains MySQL benchmark scripts and data.
360 %description bench -l pl
361 Programy testuj±ce szybko¶æ serwera MySQL.
363 %description bench -l pt_BR
364 Este pacote contém medições de desempenho de scripts e dados do MySQL.
366 %description bench -l ru
367 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
370 %description bench -l uk
371 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
374 Summary: MySQL manual
375 Summary(pl): Podrêcznik u¿ytkownika MySQL
376 Group: Applications/Databases
379 This package contains manual in HTML format.
381 %description doc -l pl
382 Podrêcznik MySQL-a w formacie HTML.
385 Summary: MySQL - NDB Storage Engine Daemon
386 Summary(pl): MySQL - demon silnika przechowywania danych NDB
387 Group: Applications/Databases
388 Requires: %{name}-libs = %{version}-%{release}
391 This package contains the standard MySQL NDB Storage Engine Daemon.
393 %description ndb -l pl
394 Ten pakiet zawiera standardowego demona silnika przechowywania danych
398 Summary: MySQL - NDB Clients
399 Summary(pl): MySQL - programy klienckie NDB
400 Group: Applications/Databases
401 Requires: %{name}-libs = %{version}-%{release}
403 %description ndb-client
404 This package contains the standard MySQL NDB Clients.
406 %description ndb-client -l pl
407 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
410 Summary: MySQL - NDB Management Daemon
411 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
412 Group: Applications/Databases
413 Requires: %{name}-libs = %{version}-%{release}
416 This package contains the standard MySQL NDB Management Daemon.
418 %description ndb-mgm -l pl
419 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
422 Summary: MySQL - NDB CPC Daemon
423 Summary(pl): MySQL - demon NDB CPC
424 Group: Applications/Databases
425 Requires: %{name}-libs = %{version}-%{release}
428 This package contains the standard MySQL NDB CPC Daemon.
430 %description ndb-cpc -l pl
431 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
434 %setup -q %{?_snap:-n %{name}-%{version}-nightly-%{_snap}}
436 %{?with_tcpd:%patch1 -p1}
440 # this is strange: mysqld functions for UDF modules are not explicitly defined,
441 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
442 # in objects compiled without -fPIC
454 %{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
462 # The compiler flags are as per their "official" spec ;)
463 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
464 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
466 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
467 # and therefore do not add BR on these. These are here just to satisfy
472 FIND_PROC='/bin/ps p $$PID' \
474 CHECK_PID='/bin/kill -0 $$PID' \
476 --enable-largefile=yes \
479 --enable-thread-safe-client \
480 --with%{!?with_bdb:out}-berkeley-db \
481 --with%{!?with_innodb:out}-innodb \
482 --with%{!?with_raid:out}-raid \
483 --with%{!?with_ssl:out}-openssl \
484 --with%{!?with_tcpd:out}-libwrap \
485 %{?with_big_tables:--with-big-tables} \
486 --with-comment="PLD Linux Distribution MySQL RPM" \
487 --with%{!?debug:out}-debug \
488 --with%{!?debug:out}-ndb-debug \
489 --with-embedded-server \
490 --with-extra-charsets=all \
492 --with-mysqld-user=mysql \
493 --with-named-curses-libs="-lncurses" \
494 --with-named-thread-libs="-lpthread" \
495 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
496 --with-archive-storage-engine \
503 # --with-ndb-test --with-ndb-docs
505 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
506 # (it defaults to first cluster but user may change it to whatever
509 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
512 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
514 %{__make} -C Docs mysql.info
517 rm -rf $RPM_BUILD_ROOT
518 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql,monit} \
519 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
520 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
523 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
528 DESTDIR=$RPM_BUILD_ROOT \
529 benchdir=%{_datadir}/sql-bench \
531 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
533 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
535 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
536 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
537 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
538 # This is template for configuration file which is created after 'service mysql init'
539 install %{SOURCE4} mysqld.conf
540 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
541 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/monit
542 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
544 # remove innodb directives from mysqld.conf if mysqld is configured without
545 %if %{without innodb}
546 cp mysqld.conf mysqld.tmp
547 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
550 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
552 cp mysqld.conf mysqld.tmp
553 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
556 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
557 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
560 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
561 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
562 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
563 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
564 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
565 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
566 # remove .txt variants for .sys messages
567 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
569 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
570 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT%{_libdir}/libmysqlclient{,_r}.la
572 # remove known unpackaged files
573 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
575 # rename not to be so generic name
576 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
577 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
579 # not useful without -debug build
580 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
581 # generate symbols file, so one can generate backtrace using it
582 # mysql_resolve_stack_dump -s /usr/share/mysql/mysqld.sym -n mysqld.stack.
583 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
584 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
586 # functionality in initscript / rpm
587 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
588 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
589 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
590 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
591 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
592 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/fill_help_tables.sql
593 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
594 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
595 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
596 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
597 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
598 rm $RPM_BUILD_ROOT%{_mandir}/man1/safe_mysqld*
601 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
604 rm -rf $RPM_BUILD_ROOT
607 %groupadd -g 89 mysql
608 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
611 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
612 /sbin/chkconfig --add mysql
614 if [ "$1" = 1 ]; then
615 %banner -e %{name}-4.1.x <<-EOF
616 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
617 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
622 %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 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
726 %defattr(644,root,root,755)
727 %doc support-files/*.cnf support-files/*.ini scripts/fill_help_tables.sql
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(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
733 %attr(755,root,root) %{_bindir}/innochecksum
734 %attr(755,root,root) %{_bindir}/myisamchk
735 %attr(755,root,root) %{_bindir}/myisamlog
736 %attr(755,root,root) %{_bindir}/myisampack
737 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
738 %attr(755,root,root) %{_bindir}/my_print_defaults
739 %attr(755,root,root) %{_sbindir}/mysqld
740 %{_mandir}/man1/mysql_fix_privilege_tables.1*
741 %{_mandir}/man1/mysqld.1*
742 %{_mandir}/man1/myisamchk.1*
743 %{_mandir}/man1/myisamlog.1*
744 %{_mandir}/man1/myisampack.1*
746 %attr(700,mysql,mysql) %{_mysqlhome}
747 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
748 %attr(751,root,root) /var/lib/mysql
749 %attr(750,mysql,mysql) %dir /var/log/mysql
750 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
751 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
753 %{_infodir}/mysql.info*
754 # This is template for configuration file which is created after 'service mysql init'
755 %{_datadir}/mysql/mysqld.conf
756 %{_datadir}/mysql/english
757 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
758 %lang(cs) %{_datadir}/mysql/czech
759 %lang(da) %{_datadir}/mysql/danish
760 %lang(de) %{_datadir}/mysql/german
761 %lang(el) %{_datadir}/mysql/greek
762 %lang(es) %{_datadir}/mysql/spanish
763 %lang(et) %{_datadir}/mysql/estonian
764 %lang(fr) %{_datadir}/mysql/french
765 %lang(hu) %{_datadir}/mysql/hungarian
766 %lang(it) %{_datadir}/mysql/italian
767 %lang(ja) %{_datadir}/mysql/japanese
768 %lang(ko) %{_datadir}/mysql/korean
769 %lang(nl) %{_datadir}/mysql/dutch
770 %lang(nb) %{_datadir}/mysql/norwegian
771 %lang(nn) %{_datadir}/mysql/norwegian-ny
772 %lang(pl) %{_datadir}/mysql/polish
773 %lang(pt) %{_datadir}/mysql/portuguese
774 %lang(ro) %{_datadir}/mysql/romanian
775 %lang(ru) %{_datadir}/mysql/russian
776 %lang(sr) %{_datadir}/mysql/serbian
777 %lang(sk) %{_datadir}/mysql/slovak
778 %lang(sv) %{_datadir}/mysql/swedish
779 %lang(uk) %{_datadir}/mysql/ukrainian
782 %defattr(644,root,root,755)
783 %dir %{_datadir}/mysql
784 %{_datadir}/mysql/charsets
787 %defattr(644,root,root,755)
788 %attr(755,root,root) %{_bindir}/msql2mysql
789 %attr(755,root,root) %{_bindir}/myisam_ftdump
790 %attr(755,root,root) %{_bindir}/mysql_secure_installation
791 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
792 %attr(755,root,root) %{_bindir}/mysqlcheck
793 %attr(755,root,root) %{_bindir}/perror
794 %attr(755,root,root) %{_bindir}/replace
795 %attr(755,root,root) %{_bindir}/resolveip
796 %{_mandir}/man1/msql2mysql.1*
797 %{_mandir}/man1/mysqlcheck.1*
798 %{_mandir}/man1/perror.1*
799 %{_mandir}/man1/replace.1*
802 %defattr(644,root,root,755)
803 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
804 %attr(755,root,root) %{_bindir}/mysqldumpslow
805 %attr(755,root,root) %{_bindir}/mysqlhotcopy
806 %attr(755,root,root) %{_bindir}/mysql_setpermission
807 %attr(755,root,root) %{_bindir}/mysql_zap
808 %attr(755,root,root) %{_bindir}/mysql_find_rows
809 %attr(755,root,root) %{_bindir}/mysqlaccess
810 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
811 %attr(755,root,root) %{_bindir}/mysql_explain_log
812 %attr(755,root,root) %{_bindir}/mysql_tableinfo
813 %{_mandir}/man1/mysql_zap.1*
814 %{_mandir}/man1/mysqlaccess.1*
815 %{_mandir}/man1/mysqlhotcopy.1*
818 %defattr(644,root,root,755)
819 %attr(755,root,root) %{_bindir}/mysql
820 %attr(755,root,root) %{_bindir}/mysqlbug
821 %attr(755,root,root) %{_bindir}/mysqldump
822 %attr(755,root,root) %{_bindir}/mysqlimport
823 %attr(755,root,root) %{_sbindir}/mysqlmanager*
824 %attr(755,root,root) %{_bindir}/mysqlshow
825 %attr(755,root,root) %{_bindir}/mysqlbinlog
826 %attr(755,root,root) %{_bindir}/mysqladmin
827 %attr(755,root,root) %{_bindir}/mysqltest*
828 %{_mandir}/man1/mysql.1*
829 %{_mandir}/man1/mysqladmin.1*
830 %{_mandir}/man1/mysqldump.1*
831 %{_mandir}/man1/mysqlshow.1*
832 %{_mandir}/man1/mysqlmanager.1*
833 %{_mandir}/man1/mysqlbinlog.1*
834 %{_mandir}/man1/mysqlimport.1*
837 %defattr(644,root,root,755)
838 %doc EXCEPTIONS-CLIENT
839 %attr(755,root,root) %{_libdir}/lib*.so.*.*
840 %attr(751,root,root) %dir %{_sysconfdir}/mysql
841 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
844 %defattr(644,root,root,755)
845 %attr(755,root,root) %{_bindir}/mysql_config
846 %attr(755,root,root) %{_libdir}/lib*.so
847 %attr(755,root,root) %{_bindir}/*comp_err
848 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
849 %{?debug:%{_datadir}/mysql/mysqld.sym}
851 %{_libdir}/lib*[!tr].a
853 %{_mandir}/man1/mysql_config.1*
856 %defattr(644,root,root,755)
857 %{_libdir}/lib*[tr].a
860 %defattr(644,root,root,755)
861 %attr(755,root,root) %{_bindir}/mysqltest
862 %attr(755,root,root) %{_bindir}/mysql_client_test
863 %dir %{_datadir}/sql-bench
864 %{_datadir}/sql-bench/[CDRl]*
865 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
867 %{_datadir}/mysql/mi_test_all.res
868 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
871 #%defattr(644,root,root,755)
872 #%doc Docs/manual.html Docs/manual_toc.html
875 %defattr(644,root,root,755)
876 %attr(755,root,root) %{_sbindir}/ndbd
877 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
878 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
881 %defattr(644,root,root,755)
882 %attr(755,root,root) %{_bindir}/ndb_*
885 %defattr(644,root,root,755)
886 %attr(755,root,root) %{_sbindir}/ndb_mgmd
887 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
888 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
891 %defattr(644,root,root,755)
892 %attr(755,root,root) %{_sbindir}/ndb_cpcd
893 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
894 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc