2 # - trigger that prepares system from pre-cluster into cluster
3 # - C(XX)FLAGS for innodb subdirs are overriden by ./configure!
4 # - http://bugs.mysql.com/bug.php?id=16470
5 # - innodb are dynamic (= as plugins) ?
6 # - missing have_archive, have_merge
7 # - is plugin_dir lib64 safe?
8 # - Using NDB Cluster... could not find sci transporter in /{include, lib}
11 %bcond_without innodb # Without InnoDB support
12 %bcond_without raid # Without raid
13 %bcond_without ssl # Without OpenSSL
14 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
15 %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms
17 %include /usr/lib/rpm/macros.perl
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://mysql.dataphone.se/Downloads/MySQL-5.1/%{name}-%{version}-beta.tar.gz
32 # Source0-md5: f02115e98c99558e062adcf2dc305283
34 Source2: %{name}.sysconfig
35 Source3: %{name}.logrotate
36 Source4: %{name}d.conf
37 Source5: %{name}-clusters.conf
38 Source7: %{name}-ndb.init
39 Source8: %{name}-ndb.sysconfig
40 Source9: %{name}-ndb-mgm.init
41 Source10: %{name}-ndb-mgm.sysconfig
42 Source11: %{name}-ndb-cpc.init
43 Source12: %{name}-ndb-cpc.sysconfig
44 Source13: %{name}-client.conf
45 Source14: %{name}-init_db.sql
46 Source15: %{name}-init_db-data.sql
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}-upgrade.patch
59 Patch12: %{name}-NDB_CXXFLAGS.patch
60 Patch13: %{name}-bug-16634.patch
61 Patch14: %{name}-bug-18156.patch
62 Patch15: %{name}-bug-22807.patch
63 Patch16: %{name}-bug-24747.patch
64 URL: http://www.mysql.com/products/database/mysql/community_edition.html
65 BuildRequires: autoconf
66 BuildRequires: automake
67 BuildRequires: doxygen
68 BuildRequires: libstdc++-devel >= 5:3.0
69 BuildRequires: libtool
70 %{?with_tcpd:BuildRequires: libwrap-devel}
71 BuildRequires: ncurses-devel >= 4.2
72 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
73 BuildRequires: perl-DBI
74 BuildRequires: perl-devel >= 1:5.6.1
75 BuildRequires: readline-devel >= 4.2
76 BuildRequires: rpm-perlprov >= 4.1-13
77 BuildRequires: rpmbuild(macros) >= 1.268
78 BuildRequires: sed >= 4.0
79 BuildRequires: texinfo
80 BuildRequires: zlib-devel
81 Requires(post,postun): /sbin/ldconfig
82 Requires(post,preun): /sbin/chkconfig
83 Requires(postun): /usr/sbin/groupdel
84 Requires(postun): /usr/sbin/userdel
85 Requires(pre): /bin/id
86 Requires(pre): /usr/bin/getgid
87 Requires(pre): /usr/sbin/groupadd
88 Requires(pre): /usr/sbin/useradd
89 Requires(triggerpostun): sed >= 4.0
90 Requires: %{name}-charsets = %{version}-%{release}
91 Requires: /usr/bin/setsid
92 Requires: rc-scripts >= 0.2.0
93 Provides: MySQL-server
94 Provides: group(mysql)
98 Obsoletes: mysql-server
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _libexecdir %{_sbindir}
102 %define _localstatedir /var/lib/mysql
103 %define _mysqlhome /home/services/mysql
105 %define _noautoreqdep 'perl(DBD::mysql)'
107 # readline/libedit detection goes wrong
108 %undefine configure_cache
111 MySQL is a true multi-user, multi-threaded SQL (Structured Query
112 Language) database server. SQL is the most popular database language
113 in the world. MySQL is a client/server implementation that consists of
114 a server daemon mysqld and many different client programs/libraries.
116 The main goals of MySQL are speed, robustness and easy to use. MySQL
117 was originally developed because we at Tcx needed a SQL server that
118 could handle very big databases with magnitude higher speed than what
119 any database vendor could offer to us. We have now been using MySQL
120 since 1996 in a environment with more than 40 databases, 10,000
121 tables, of which more than 500 have more than 7 million rows. This is
122 about 50G of mission critical data.
124 The base upon which MySQL is built is a set of routines that have been
125 used in a highly demanding production environment for many years.
126 While MySQL is still in development, it already offers a rich and
127 highly useful function set.
130 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
131 multi-taches. Le langage SQL est le langage de bases de donnees le
132 plus populaire au monde. MySQL est une implementation client/serveur
133 qui consiste en un serveur (mysqld) et differents
134 programmes/bibliotheques clientes.
136 Les objectifs principaux de MySQL sont: vitesse, robustesse et
137 facilite d'utilisation. MySQL fut originalement developpe parce que
138 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
139 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
140 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
141 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
142 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
143 millions de lignes. Ceci represente environ 50G de donnees critiques.
145 A la base de la conception de MySQL, on retrouve une serie de routines
146 qui ont ete utilisees dans un environnement de production pendant
147 plusieurs annees. Meme si MySQL est encore en developpement, il offre
148 deja une riche et utile serie de fonctions.
151 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
152 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
153 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
154 mysqld i wielu ró¿nych programów i bibliotek klienckich.
156 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
157 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
158 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
159 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
160 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
161 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
162 50GB krytycznych danych.
164 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
165 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
166 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
167 i u¿yteczny zbiór funkcji.
170 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
171 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
172 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
173 einem Primärschlüssel versehen werden. Es ist aber keine Definition
174 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
175 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
176 Daten verantwortlich. Allein durch die Nutzung externer
177 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
178 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
180 %description -l pt_BR
181 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
182 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
183 dados no mundo. O MySQL é uma implementação cliente/servidor que
184 consiste de um servidor chamado mysqld e diversos
185 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
186 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
187 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
188 pudesse lidar com grandes bases de dados e com uma velocidade muito
189 maior do que a que qualquer vendedor podia nos oferecer. Estamos
190 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
191 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
192 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
193 A base da construção do MySQL é uma série de rotinas que foram usadas
194 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
195 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
196 funções muito ricas e úteis. Veja a documentação para maiores
200 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
201 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
202 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
206 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
207 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
208 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
212 Summary: MySQL - character sets definitions
213 Summary(pl): MySQL - definicje kodowañ znaków
214 Group: Applications/Databases
216 %description charsets
217 This package contains character sets definitions needed by both client
220 %description charsets -l pl
221 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
225 Summary: MySQL additional utilities
226 Summary(pl): Dodatkowe narzêdzia do MySQL
227 Group: Applications/Databases
228 Requires: %{name}-libs = %{version}-%{release}
231 MySQL additional utilities except Perl scripts (they may be found in
232 %{name}-extras-perl package).
234 %description extras -l pl
235 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
236 pakiecie %{name}-extras-perl).
239 Summary: MySQL additional utilities written in Perl
240 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
241 Group: Applications/Databases
242 Requires: %{name}-extras = %{version}-%{release}
243 Requires: perl(DBD::mysql)
245 %description extras-perl
246 MySQL additional utilities written in Perl.
248 %description extras-perl -l pl
249 Dodatkowe narzêdzia do MySQL napisane w Perlu.
252 Summary: MySQL - Client
253 Summary(pl): MySQL - Klient
254 Summary(pt): MySQL - Cliente
255 Summary(ru): MySQL ËÌÉÅÎÔ
256 Summary(uk): MySQL Ë̦¤ÎÔ
257 Group: Applications/Databases
258 Requires: %{name}-charsets = %{version}-%{release}
259 Requires: %{name}-libs = %{version}-%{release}
260 Obsoletes: MySQL-client
263 This package contains the standard MySQL clients.
265 %description client -l fr
266 Ce package contient les clients MySQL standards.
268 %description client -l pl
269 Standardowe programy klienckie MySQL.
271 %description client -l pt_BR
272 Este pacote contém os clientes padrão para o MySQL.
274 %description client -l ru
275 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
277 %description client -l uk
278 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
281 Summary: Shared libraries for MySQL
282 Summary(pl): Biblioteki dzielone MySQL
284 Obsoletes: libmysql10
285 Obsoletes: mysql-doc < 4.1.12
288 Shared libraries for MySQL.
290 %description libs -l pl
291 Biblioteki dzielone MySQL.
294 Summary: MySQL - Development header files and libraries
295 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
296 Summary(pt): MySQL - Medições de desempenho
297 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
298 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
299 Group: Development/Libraries
300 Requires: %{name}-libs = %{version}-%{release}
301 %{?with_ssl:Requires: openssl-devel}
303 Obsoletes: MySQL-devel
304 Obsoletes: libmysql10-devel
307 This package contains the development header files and libraries
308 necessary to develop MySQL client applications.
310 %description devel -l fr
311 Ce package contient les fichiers entetes et les librairies de
312 developpement necessaires pour developper des applications clientes
315 %description devel -l pl
316 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
319 %description devel -l pt_BR
320 Este pacote contém os arquivos de cabeçalho (header files) e
321 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
323 %description devel -l ru
324 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
325 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
327 %description devel -l uk
328 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
329 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
332 Summary: MySQL static libraries
333 Summary(pl): Biblioteki statyczne MySQL
334 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
335 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
336 Group: Development/Libraries
337 Requires: %{name}-devel = %{version}-%{release}
338 Obsoletes: MySQL-static
341 MySQL static libraries.
343 %description static -l pl
344 Biblioteki statyczne MySQL.
346 %description static -l ru
347 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
348 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
350 %description static -l uk
351 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
352 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
355 Summary: MySQL - Benchmarks
356 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
357 Summary(pt): MySQL - Medições de desempenho
358 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
359 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
360 Group: Applications/Databases
361 Requires: %{name} = %{version}-%{release}
362 Requires: %{name}-client
363 Requires: perl(DBD::mysql)
364 Obsoletes: MySQL-bench
367 This package contains MySQL benchmark scripts and data.
369 %description bench -l pl
370 Programy testuj±ce szybko¶æ serwera MySQL.
372 %description bench -l pt_BR
373 Este pacote contém medições de desempenho de scripts e dados do MySQL.
375 %description bench -l ru
376 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
379 %description bench -l uk
380 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
383 Summary: MySQL manual
384 Summary(pl): Podrêcznik u¿ytkownika MySQL
385 Group: Applications/Databases
388 This package contains manual in HTML format.
390 %description doc -l pl
391 Podrêcznik MySQL-a w formacie HTML.
394 Summary: MySQL - NDB Storage Engine Daemon
395 Summary(pl): MySQL - demon silnika przechowywania danych NDB
396 Group: Applications/Databases
397 Requires: %{name}-libs = %{version}-%{release}
400 This package contains the standard MySQL NDB Storage Engine Daemon.
402 %description ndb -l pl
403 Ten pakiet zawiera standardowego demona silnika przechowywania danych
407 Summary: MySQL - NDB Clients
408 Summary(pl): MySQL - programy klienckie NDB
409 Group: Applications/Databases
410 Requires: %{name}-libs = %{version}-%{release}
412 %description ndb-client
413 This package contains the standard MySQL NDB Clients.
415 %description ndb-client -l pl
416 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
419 Summary: MySQL - NDB Management Daemon
420 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
421 Group: Applications/Databases
422 Requires: %{name}-libs = %{version}-%{release}
425 This package contains the standard MySQL NDB Management Daemon.
427 %description ndb-mgm -l pl
428 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
431 Summary: MySQL - NDB CPC Daemon
432 Summary(pl): MySQL - demon NDB CPC
433 Group: Applications/Databases
434 Requires: %{name}-libs = %{version}-%{release}
437 This package contains the standard MySQL NDB CPC Daemon.
439 %description ndb-cpc -l pl
440 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
443 %setup -q -n %{name}-%{version}-beta
445 #%{?with_tcpd:%patch1 -p1} # WHATS PURPOSE OF THIS PATCH?
446 #%patch2 -p1 # NEEDS CHECK, which exact program needs -lc++
449 # this is strange: mysqld functions for UDF modules are not explicitly defined,
450 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
451 # in objects compiled without -fPIC
474 # The compiler flags are as per their "official" spec ;)
475 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
476 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
478 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
479 # and therefore do not add BR on these. These are here just to satisfy
484 FIND_PROC='/bin/ps p $$PID' \
486 CHECK_PID='/bin/kill -0 $$PID' \
488 --enable-largefile=yes \
491 --enable-thread-safe-client \
492 --with%{!?with_innodb:out}-innodb \
493 --with%{!?with_raid:out}-raid \
494 --with%{!?with_ssl:out}-ssl=/usr \
495 --with%{!?with_tcpd:out}-libwrap \
496 %{?with_big_tables:--with-big-tables} \
497 --with-comment="PLD Linux Distribution MySQL RPM" \
498 --with%{!?debug:out}-debug%{?debug:=full} \
499 --with%{!?debug:out}-ndb-debug \
500 --with-embedded-server \
501 --with-extra-charsets=all \
503 --with-mysqld-user=mysql \
504 --with-named-curses-libs="-lncurses" \
505 --with-named-thread-libs="-lpthread" \
506 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
507 --with-archive-storage-engine \
508 --with-fast-mutexes \
518 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
519 # (it defaults to first cluster but user may change it to whatever
522 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
525 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
527 %{__make} -C Docs mysql.info
530 rm -rf $RPM_BUILD_ROOT
531 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql} \
532 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
533 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
537 DESTDIR=$RPM_BUILD_ROOT \
538 benchdir=%{_datadir}/sql-bench \
540 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
542 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
544 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
545 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
546 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
547 # This is template for configuration file which is created after 'service mysql init'
548 install %{SOURCE4} mysqld.conf
549 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
550 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
552 # remove innodb directives from mysqld.conf if mysqld is configured without
553 %if %{without innodb}
554 cp mysqld.conf mysqld.tmp
555 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
558 # 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
562 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
563 cp -a %{SOURCE14} $RPM_BUILD_ROOT%{_datadir}/mysql/init_db.sql
564 cp -a %{SOURCE15} $RPM_BUILD_ROOT%{_datadir}/mysql/init_db-data.sql
565 cp -a %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
568 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
569 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
570 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
571 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
572 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
573 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
575 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
576 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
578 # remove known unpackaged files
579 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
581 # remove .txt variants for .sys messages
582 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
584 # rename not to be so generic name
585 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
587 # not useful without -debug build
588 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
589 # generate symbols file, so one can generate backtrace using it
590 # mysql_resolve_stack_dump -s /usr/share/mysql/mysqld.sym -n mysqld.stack.
591 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
592 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
594 # functionality in initscript / rpm
595 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
596 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
597 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
598 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
599 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
600 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
601 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
602 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
603 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
604 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
605 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
606 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
607 rm $RPM_BUILD_ROOT%{_bindir}/resolveip
609 # we don't package those (we have no -test or -testsuite pkg) and some of them just segfault
610 rm $RPM_BUILD_ROOT%{_bindir}/mysql_client_test
611 rm $RPM_BUILD_ROOT%{_datadir}/mysql/mi_test_all
612 rm $RPM_BUILD_ROOT%{_datadir}/mysql/mi_test_all.res
615 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
618 rm $RPM_BUILD_ROOT%{_libdir}/mysql/ha_{example,blackhole,federated}.{a,la}
621 rm -rf $RPM_BUILD_ROOT
624 %groupadd -g 89 mysql
625 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
628 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
630 /sbin/chkconfig --add mysql
631 %service mysql restart
634 if [ "$1" = "0" ]; then
635 %service -q mysql stop
636 /sbin/chkconfig --del mysql
640 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
643 if [ "$1" = "0" ]; then
649 /sbin/chkconfig --add mysql-ndb
650 %service mysql-ndb restart "mysql NDB engine"
653 if [ "$1" = "0" ]; then
654 %service mysql-ndb stop
655 /sbin/chkconfig --del mysql-ndb
659 /sbin/chkconfig --add mysql-ndb-mgm
660 %service mysql-ndb-mgm restart "mysql NDB management node"
663 if [ "$1" = "0" ]; then
664 %service mysql-ndb-mgm stop
665 /sbin/chkconfig --del mysql-ndb-mgm
669 /sbin/chkconfig --add mysql-ndb-cpc
670 %service mysql-ndb-cpc restart "mysql NDB CPC"
673 if [ "$1" = "0" ]; then
674 %service mysql-ndb-cpc stop
675 /sbin/chkconfig --del mysql-ndb-cpc
678 %post libs -p /sbin/ldconfig
679 %postun libs -p /sbin/ldconfig
681 %triggerpostun -- mysql <= 4.0.20-2
682 # For clusters in /etc/mysql/clusters.conf
683 if [ -f "/etc/sysconfig/mysql" ]; then
684 . /etc/sysconfig/mysql
685 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
686 for i in "$MYSQL_DB_CLUSTERS"; do
687 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
689 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
690 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
691 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
692 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
696 %triggerpostun -- mysql <= 4.1.1
697 # For better compatibility with prevoius versions:
698 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
699 if echo "$config" | grep -q '^/'; then
700 config_file="$config"
701 elif [ -f "/etc/mysql/$config" ]; then
702 config_file=/etc/mysql/$config
704 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
705 if [ -z "$clusterdir" ]; then
706 echo >&2 "Can't find cluster dir for $config!"
707 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
710 config_file="$clusterdir/mysqld.conf"
713 if [ ! -f "$config_file" ]; then
714 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
717 echo "Adding option old-passwords to config: $config_file"
718 echo "If you want to use new, better passwords - remove it"
720 # sed magic to add 'old-passwords' to [mysqld] section
721 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
723 a; Compatibility options:
729 %banner -e %{name}-4.1.x <<-EOF
730 If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
731 mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
735 %triggerpostun -- mysql < 5.1
737 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
738 if echo "$config" | grep -q '^/'; then
739 config_file="$config"
740 elif [ -f "/etc/mysql/$config" ]; then
741 config_file=/etc/mysql/$config
743 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
744 if [ -z "$clusterdir" ]; then
745 echo >&2 "Can't find cluster dir for $config!"
746 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
749 config_file="$clusterdir/mysqld.conf"
752 if [ ! -f "$config_file" ]; then
753 echo >&2 "ERROR: Can't find real config file for $config! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
756 configs="$configs $config_file"
760 echo 'You should run MySQL upgrade scripts for all MySQL clusters.'
761 echo 'Thus, you should invoke:'
762 for config in $configs; do
763 datadir=$(awk -F= '!/^#/ && $1 ~ /datadir/{print $2}' $config)
764 echo "# mysql_upgrade --datadir=$datadir"
766 ) | %banner -e %{name}-5.1
769 %defattr(644,root,root,755)
770 %doc support-files/*.cnf support-files/*.ini
771 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
772 %attr(754,root,root) /etc/rc.d/init.d/mysql
773 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
774 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
775 %attr(755,root,root) %{_bindir}/innochecksum
776 %attr(755,root,root) %{_bindir}/myisamchk
777 %attr(755,root,root) %{_bindir}/myisamlog
778 %attr(755,root,root) %{_bindir}/myisampack
779 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
780 %attr(755,root,root) %{_bindir}/my_print_defaults
781 %attr(755,root,root) %{_bindir}/mysql_upgrade
782 %attr(755,root,root) %{_bindir}/mysqlcheck
783 %attr(755,root,root) %{_sbindir}/mysqld
784 %dir %{_libdir}/mysql
785 %attr(755,root,root) %{_libdir}/mysql/ha_blackhole.so.*.*.*
786 %attr(755,root,root) %{_libdir}/mysql/ha_example.so.*.*.*
787 %attr(755,root,root) %{_libdir}/mysql/ha_federated.so.*.*.*
788 %{_mandir}/man1/mysql_fix_privilege_tables.1*
789 %{_mandir}/man1/mysqld.1*
790 %{_mandir}/man1/myisamchk.1*
791 %{_mandir}/man1/myisamlog.1*
792 %{_mandir}/man1/myisampack.1*
793 %{_mandir}/man1/mysql_upgrade.1*
794 %{_mandir}/man1/mysqlcheck.1*
795 %{_mandir}/man8/mysqld.8*
797 %attr(700,mysql,mysql) %{_mysqlhome}
798 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
799 %attr(751,root,root) /var/lib/mysql
800 %attr(750,mysql,mysql) %dir /var/log/mysql
801 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
802 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
804 %{_infodir}/mysql.info*
805 # This is template for configuration file which is created after 'service mysql init'
806 %{_datadir}/mysql/mysqld.conf
807 %{_datadir}/mysql/english
808 %{_datadir}/mysql/fill_help_tables.sql
809 %{_datadir}/mysql/init_db-data.sql
810 %{_datadir}/mysql/init_db.sql
811 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
812 %lang(cs) %{_datadir}/mysql/czech
813 %lang(da) %{_datadir}/mysql/danish
814 %lang(de) %{_datadir}/mysql/german
815 %lang(el) %{_datadir}/mysql/greek
816 %lang(es) %{_datadir}/mysql/spanish
817 %lang(et) %{_datadir}/mysql/estonian
818 %lang(fr) %{_datadir}/mysql/french
819 %lang(hu) %{_datadir}/mysql/hungarian
820 %lang(it) %{_datadir}/mysql/italian
821 %lang(ja) %{_datadir}/mysql/japanese
822 %lang(ko) %{_datadir}/mysql/korean
823 %lang(nl) %{_datadir}/mysql/dutch
824 %lang(nb) %{_datadir}/mysql/norwegian
825 %lang(nn) %{_datadir}/mysql/norwegian-ny
826 %lang(pl) %{_datadir}/mysql/polish
827 %lang(pt) %{_datadir}/mysql/portuguese
828 %lang(ro) %{_datadir}/mysql/romanian
829 %lang(ru) %{_datadir}/mysql/russian
830 %lang(sr) %{_datadir}/mysql/serbian
831 %lang(sk) %{_datadir}/mysql/slovak
832 %lang(sv) %{_datadir}/mysql/swedish
833 %lang(uk) %{_datadir}/mysql/ukrainian
836 %defattr(644,root,root,755)
837 %dir %{_datadir}/mysql
838 %{_datadir}/mysql/charsets
841 %defattr(644,root,root,755)
842 %attr(755,root,root) %{_bindir}/msql2mysql
843 %attr(755,root,root) %{_bindir}/myisam_ftdump
844 %attr(755,root,root) %{_bindir}/mysql_secure_installation
845 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
846 %attr(755,root,root) %{_bindir}/perror
847 %attr(755,root,root) %{_bindir}/replace
848 %{_mandir}/man1/msql2mysql.1*
849 %{_mandir}/man1/myisam_ftdump.1*
850 %{_mandir}/man1/perror.1*
851 %{_mandir}/man1/replace.1*
854 %defattr(644,root,root,755)
855 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
856 %attr(755,root,root) %{_bindir}/mysql_find_rows
857 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
858 %attr(755,root,root) %{_bindir}/mysql_setpermission
859 %attr(755,root,root) %{_bindir}/mysql_zap
860 %attr(755,root,root) %{_bindir}/mysqlaccess
861 %attr(755,root,root) %{_bindir}/mysqldumpslow
862 %attr(755,root,root) %{_bindir}/mysqlhotcopy
863 %{_mandir}/man1/mysql_zap.1*
864 %{_mandir}/man1/mysqlaccess.1*
865 %{_mandir}/man1/mysqlhotcopy.1*
868 %defattr(644,root,root,755)
869 %attr(755,root,root) %{_bindir}/mysql
870 %attr(755,root,root) %{_bindir}/mysqladmin
871 %attr(755,root,root) %{_bindir}/mysqlbinlog
872 %attr(755,root,root) %{_bindir}/mysqlbug
873 %attr(755,root,root) %{_bindir}/mysqldump
874 %attr(755,root,root) %{_bindir}/mysqlimport
875 %attr(755,root,root) %{_bindir}/mysqlshow
876 %attr(755,root,root) %{_bindir}/mysqlslap
877 %attr(755,root,root) %{_bindir}/mysqltest*
878 %attr(755,root,root) %{_sbindir}/mysqlmanager*
879 %{_mandir}/man1/mysql.1*
880 %{_mandir}/man1/mysqladmin.1*
881 %{_mandir}/man1/mysqlbinlog.1*
882 %{_mandir}/man1/mysqldump.1*
883 %{_mandir}/man1/mysqlimport.1*
884 %{_mandir}/man1/mysqlmanager.1*
885 %{_mandir}/man1/mysqlshow.1*
886 %{_mandir}/man1/mysqlslap.1*
887 %{_mandir}/man8/mysqlmanager.8*
890 %defattr(644,root,root,755)
891 %doc EXCEPTIONS-CLIENT
892 %attr(755,root,root) %{_libdir}/lib*.so.*.*
893 %attr(751,root,root) %dir %{_sysconfdir}/mysql
894 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
897 %defattr(644,root,root,755)
898 %attr(755,root,root) %{_bindir}/mysql_config
899 %attr(755,root,root) %{_libdir}/lib*.so
900 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
901 %{?debug:%{_datadir}/mysql/mysqld.sym}
903 %{_libdir}/lib*[!tr].a
905 %{_mandir}/man1/mysql_config.1*
908 %defattr(644,root,root,755)
909 %{_libdir}/lib*[tr].a
912 %defattr(644,root,root,755)
913 %attr(755,root,root) %{_bindir}/mysqltest
914 %dir %{_datadir}/sql-bench
915 %{_datadir}/sql-bench/[CDRl]*
916 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
919 #%defattr(644,root,root,755)
920 #%doc Docs/manual.html Docs/manual_toc.html
923 %defattr(644,root,root,755)
924 %attr(755,root,root) %{_sbindir}/ndbd
925 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
926 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
929 %defattr(644,root,root,755)
930 %attr(755,root,root) %{_bindir}/ndb_*
931 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
934 %defattr(644,root,root,755)
935 %attr(755,root,root) %{_sbindir}/ndb_mgmd
936 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
937 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
940 %defattr(644,root,root,755)
941 %attr(755,root,root) %{_sbindir}/ndb_cpcd
942 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
943 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc