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