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
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: d8a922fe657cca3b03d390e5f13d60a8
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}-ndb-ldflags.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)'
100 # CFLAGS for innodb are altered
101 %undefine configure_cache
104 MySQL is a true multi-user, multi-threaded SQL (Structured Query
105 Language) database server. SQL is the most popular database language
106 in the world. MySQL is a client/server implementation that consists of
107 a server daemon mysqld and many different client programs/libraries.
109 The main goals of MySQL are speed, robustness and easy to use. MySQL
110 was originally developed because we at Tcx needed a SQL server that
111 could handle very big databases with magnitude higher speed than what
112 any database vendor could offer to us. We have now been using MySQL
113 since 1996 in a environment with more than 40 databases, 10,000
114 tables, of which more than 500 have more than 7 million rows. This is
115 about 50G of mission critical data.
117 The base upon which MySQL is built is a set of routines that have been
118 used in a highly demanding production environment for many years.
119 While MySQL is still in development, it already offers a rich and
120 highly useful function set.
123 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
124 multi-taches. Le langage SQL est le langage de bases de donnees le
125 plus populaire au monde. MySQL est une implementation client/serveur
126 qui consiste en un serveur (mysqld) et differents
127 programmes/bibliotheques clientes.
129 Les objectifs principaux de MySQL sont: vitesse, robustesse et
130 facilite d'utilisation. MySQL fut originalement developpe parce que
131 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
132 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
133 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
134 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
135 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
136 millions de lignes. Ceci represente environ 50G de donnees critiques.
138 A la base de la conception de MySQL, on retrouve une serie de routines
139 qui ont ete utilisees dans un environnement de production pendant
140 plusieurs annees. Meme si MySQL est encore en developpement, il offre
141 deja une riche et utile serie de fonctions.
144 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
145 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
146 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
147 mysqld i wielu ró¿nych programów i bibliotek klienckich.
149 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
150 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
151 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
152 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
153 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
154 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
155 50GB krytycznych danych.
157 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
158 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
159 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
160 i u¿yteczny zbiór funkcji.
163 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
164 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
165 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
166 einem Primärschlüssel versehen werden. Es ist aber keine Definition
167 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
168 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
169 Daten verantwortlich. Allein durch die Nutzung externer
170 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
171 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
173 %description -l pt_BR
174 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
175 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
176 dados no mundo. O MySQL é uma implementação cliente/servidor que
177 consiste de um servidor chamado mysqld e diversos
178 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
179 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
180 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
181 pudesse lidar com grandes bases de dados e com uma velocidade muito
182 maior do que a que qualquer vendedor podia nos oferecer. Estamos
183 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
184 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
185 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
186 A base da construção do MySQL é uma série de rotinas que foram usadas
187 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
188 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
189 funções muito ricas e úteis. Veja a documentação para maiores
193 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
194 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
195 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
199 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
200 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
201 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
205 Summary: MySQL - character sets definitions
206 Summary(pl): MySQL - definicje kodowañ znaków
207 Group: Applications/Databases
209 %description charsets
210 This package contains character sets definitions needed by both client
213 %description charsets -l pl
214 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
218 Summary: MySQL additional utilities
219 Summary(pl): Dodatkowe narzêdzia do MySQL
220 Group: Applications/Databases
221 Requires: %{name}-libs = %{version}-%{release}
224 MySQL additional utilities except Perl scripts (they may be found in
225 %{name}-extras-perl package).
227 %description extras -l pl
228 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
229 pakiecie %{name}-extras-perl).
232 Summary: MySQL additional utilities written in Perl
233 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
234 Group: Applications/Databases
235 Requires: %{name}-extras = %{version}-%{release}
236 Requires: perl(DBD::mysql)
238 %description extras-perl
239 MySQL additional utilities written in Perl.
241 %description extras-perl -l pl
242 Dodatkowe narzêdzia do MySQL napisane w Perlu.
245 Summary: MySQL - Client
246 Summary(pl): MySQL - Klient
247 Summary(pt): MySQL - Cliente
248 Summary(ru): MySQL ËÌÉÅÎÔ
249 Summary(uk): MySQL Ë̦¤ÎÔ
250 Group: Applications/Databases
251 Requires: %{name}-charsets = %{version}-%{release}
252 Requires: %{name}-libs = %{version}-%{release}
253 Obsoletes: MySQL-client
256 This package contains the standard MySQL clients.
258 %description client -l fr
259 Ce package contient les clients MySQL standards.
261 %description client -l pl
262 Standardowe programy klienckie MySQL.
264 %description client -l pt_BR
265 Este pacote contém os clientes padrão para o MySQL.
267 %description client -l ru
268 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
270 %description client -l uk
271 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
274 Summary: Shared libraries for MySQL
275 Summary(pl): Biblioteki dzielone MySQL
277 Obsoletes: libmysql10
278 Obsoletes: mysql-doc < 4.1.12
281 Shared libraries for MySQL.
283 %description libs -l pl
284 Biblioteki dzielone MySQL.
287 Summary: MySQL - Development header files and libraries
288 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
289 Summary(pt): MySQL - Medições de desempenho
290 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
291 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
292 Group: Development/Libraries
293 Requires: %{name}-libs = %{version}-%{release}
294 %{?with_ssl:Requires: openssl-devel}
296 Obsoletes: MySQL-devel
297 Obsoletes: libmysql10-devel
300 This package contains the development header files and libraries
301 necessary to develop MySQL client applications.
303 %description devel -l fr
304 Ce package contient les fichiers entetes et les librairies de
305 developpement necessaires pour developper des applications clientes
308 %description devel -l pl
309 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
312 %description devel -l pt_BR
313 Este pacote contém os arquivos de cabeçalho (header files) e
314 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
316 %description devel -l ru
317 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
318 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
320 %description devel -l uk
321 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
322 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
325 Summary: MySQL static libraries
326 Summary(pl): Biblioteki statyczne MySQL
327 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
328 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
329 Group: Development/Libraries
330 Requires: %{name}-devel = %{version}-%{release}
331 Obsoletes: MySQL-static
334 MySQL static libraries.
336 %description static -l pl
337 Biblioteki statyczne MySQL.
339 %description static -l ru
340 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
341 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
343 %description static -l uk
344 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
345 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
348 Summary: MySQL - Benchmarks
349 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
350 Summary(pt): MySQL - Medições de desempenho
351 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
352 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
353 Group: Applications/Databases
354 Requires: %{name} = %{version}-%{release}
355 Requires: %{name}-client
356 Requires: perl(DBD::mysql)
357 Obsoletes: MySQL-bench
360 This package contains MySQL benchmark scripts and data.
362 %description bench -l pl
363 Programy testuj±ce szybko¶æ serwera MySQL.
365 %description bench -l pt_BR
366 Este pacote contém medições de desempenho de scripts e dados do MySQL.
368 %description bench -l ru
369 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
372 %description bench -l uk
373 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
376 Summary: MySQL manual
377 Summary(pl): Podrêcznik u¿ytkownika MySQL
378 Group: Applications/Databases
381 This package contains manual in HTML format.
383 %description doc -l pl
384 Podrêcznik MySQL-a w formacie HTML.
387 Summary: MySQL - NDB Storage Engine Daemon
388 Summary(pl): MySQL - demon silnika przechowywania danych NDB
389 Group: Applications/Databases
390 Requires: %{name}-libs = %{version}-%{release}
393 This package contains the standard MySQL NDB Storage Engine Daemon.
395 %description ndb -l pl
396 Ten pakiet zawiera standardowego demona silnika przechowywania danych
400 Summary: MySQL - NDB Clients
401 Summary(pl): MySQL - programy klienckie NDB
402 Group: Applications/Databases
403 Requires: %{name}-libs = %{version}-%{release}
405 %description ndb-client
406 This package contains the standard MySQL NDB Clients.
408 %description ndb-client -l pl
409 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
412 Summary: MySQL - NDB Management Daemon
413 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
414 Group: Applications/Databases
415 Requires: %{name}-libs = %{version}-%{release}
418 This package contains the standard MySQL NDB Management Daemon.
420 %description ndb-mgm -l pl
421 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
424 Summary: MySQL - NDB CPC Daemon
425 Summary(pl): MySQL - demon NDB CPC
426 Group: Applications/Databases
427 Requires: %{name}-libs = %{version}-%{release}
430 This package contains the standard MySQL NDB CPC Daemon.
432 %description ndb-cpc -l pl
433 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
436 %setup -q %{?_snap:-n %{name}-%{version}-nightly-%{_snap}}
438 %{?with_tcpd:%patch1 -p1}
442 # this is strange: mysqld functions for UDF modules are not explicitly defined,
443 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
444 # in objects compiled without -fPIC
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
625 if [ "$1" = "0" ]; then
626 %service -q mysql stop
627 /sbin/chkconfig --del mysql
631 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
632 if [ "$1" = "0" ]; then
638 /sbin/chkconfig --add mysql-ndb
639 %service mysql-ndb restart "mysql NDB engine"
642 if [ "$1" = "0" ]; then
643 %service mysql-ndb stop
644 /sbin/chkconfig --del mysql-ndb
648 /sbin/chkconfig --add mysql-ndb-mgm
649 %service mysql-ndb-mgm restart "mysql NDB management node"
652 if [ "$1" = "0" ]; then
653 %service mysql-ndb-mgm stop
654 /sbin/chkconfig --del mysql-ndb-mgm
658 /sbin/chkconfig --add mysql-ndb-cpc
659 %service mysql-ndb-cpc restart "mysql NDB CPC"
662 if [ "$1" = "0" ]; then
663 %service mysql-ndb-cpc stop
664 /sbin/chkconfig --del mysql-ndb-cpc
667 %post libs -p /sbin/ldconfig
668 %postun libs -p /sbin/ldconfig
670 %triggerpostun -- mysql <= 4.0.20-2
671 # For clusters in /etc/mysql/clusters.conf
672 if [ -f "/etc/sysconfig/mysql" ]; then
673 . /etc/sysconfig/mysql
674 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
675 for i in "$MYSQL_DB_CLUSTERS"; do
676 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
678 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
679 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
680 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
681 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
685 %triggerpostun -- mysql <= 4.1.1
686 # For better compatibility with prevoius versions:
687 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
688 if echo "$config" | grep -q '^/'; then
689 config_file="$config"
690 elif [ -f "/etc/mysql/$config" ]; then
691 config_file=/etc/mysql/$config
693 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
694 if [ -z "$clusterdir" ]; then
695 echo >&2 "Can't find cluster dir for $config!"
696 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
699 config_file="$clusterdir/mysqld.conf"
702 if [ ! -f "$config_file" ]; then
703 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
706 echo "Adding option old-passwords to config: $config_file"
707 echo "If you want to use new, better passwords - remove it"
709 # sed magic to add 'old-passwords' to [mysqld] section
710 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
712 a; Compatibility options:
718 %banner -e %{name}-4.1.x <<-EOF
719 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
720 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
725 %defattr(644,root,root,755)
726 %doc support-files/*.cnf support-files/*.ini scripts/fill_help_tables.sql
727 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
728 %attr(754,root,root) /etc/rc.d/init.d/mysql
729 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
730 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
731 %attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
732 %attr(755,root,root) %{_bindir}/innochecksum
733 %attr(755,root,root) %{_bindir}/myisamchk
734 %attr(755,root,root) %{_bindir}/myisamlog
735 %attr(755,root,root) %{_bindir}/myisampack
736 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
737 %attr(755,root,root) %{_bindir}/my_print_defaults
738 %attr(755,root,root) %{_bindir}/mysql_upgrade
739 %attr(755,root,root) %{_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*
745 %{_mandir}/man1/mysql_upgrade.1*
747 %attr(700,mysql,mysql) %{_mysqlhome}
748 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
749 %attr(751,root,root) /var/lib/mysql
750 %attr(750,mysql,mysql) %dir /var/log/mysql
751 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
752 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
754 %{_infodir}/mysql.info*
755 # This is template for configuration file which is created after 'service mysql init'
756 %{_datadir}/mysql/mysqld.conf
757 %{_datadir}/mysql/english
758 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
759 %lang(cs) %{_datadir}/mysql/czech
760 %lang(da) %{_datadir}/mysql/danish
761 %lang(de) %{_datadir}/mysql/german
762 %lang(el) %{_datadir}/mysql/greek
763 %lang(es) %{_datadir}/mysql/spanish
764 %lang(et) %{_datadir}/mysql/estonian
765 %lang(fr) %{_datadir}/mysql/french
766 %lang(hu) %{_datadir}/mysql/hungarian
767 %lang(it) %{_datadir}/mysql/italian
768 %lang(ja) %{_datadir}/mysql/japanese
769 %lang(ko) %{_datadir}/mysql/korean
770 %lang(nl) %{_datadir}/mysql/dutch
771 %lang(nb) %{_datadir}/mysql/norwegian
772 %lang(nn) %{_datadir}/mysql/norwegian-ny
773 %lang(pl) %{_datadir}/mysql/polish
774 %lang(pt) %{_datadir}/mysql/portuguese
775 %lang(ro) %{_datadir}/mysql/romanian
776 %lang(ru) %{_datadir}/mysql/russian
777 %lang(sr) %{_datadir}/mysql/serbian
778 %lang(sk) %{_datadir}/mysql/slovak
779 %lang(sv) %{_datadir}/mysql/swedish
780 %lang(uk) %{_datadir}/mysql/ukrainian
783 %defattr(644,root,root,755)
784 %dir %{_datadir}/mysql
785 %{_datadir}/mysql/charsets
788 %defattr(644,root,root,755)
789 %attr(755,root,root) %{_bindir}/msql2mysql
790 %attr(755,root,root) %{_bindir}/myisam_ftdump
791 %attr(755,root,root) %{_bindir}/mysql_secure_installation
792 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
793 %attr(755,root,root) %{_bindir}/mysqlcheck
794 %attr(755,root,root) %{_bindir}/perror
795 %attr(755,root,root) %{_bindir}/replace
796 %attr(755,root,root) %{_bindir}/resolveip
797 %{_mandir}/man1/msql2mysql.1*
798 %{_mandir}/man1/mysqlcheck.1*
799 %{_mandir}/man1/perror.1*
800 %{_mandir}/man1/replace.1*
803 %defattr(644,root,root,755)
804 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
805 %attr(755,root,root) %{_bindir}/mysqldumpslow
806 %attr(755,root,root) %{_bindir}/mysqlhotcopy
807 %attr(755,root,root) %{_bindir}/mysql_setpermission
808 %attr(755,root,root) %{_bindir}/mysql_zap
809 %attr(755,root,root) %{_bindir}/mysql_find_rows
810 %attr(755,root,root) %{_bindir}/mysqlaccess
811 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
812 %attr(755,root,root) %{_bindir}/mysql_explain_log
813 %attr(755,root,root) %{_bindir}/mysql_tableinfo
814 %{_mandir}/man1/mysql_zap.1*
815 %{_mandir}/man1/mysqlaccess.1*
816 %{_mandir}/man1/mysqlhotcopy.1*
819 %defattr(644,root,root,755)
820 %attr(755,root,root) %{_bindir}/mysql
821 %attr(755,root,root) %{_bindir}/mysqlbug
822 %attr(755,root,root) %{_bindir}/mysqldump
823 %attr(755,root,root) %{_bindir}/mysqlimport
824 %attr(755,root,root) %{_sbindir}/mysqlmanager*
825 %attr(755,root,root) %{_bindir}/mysqlshow
826 %attr(755,root,root) %{_bindir}/mysqlbinlog
827 %attr(755,root,root) %{_bindir}/mysqladmin
828 %attr(755,root,root) %{_bindir}/mysqltest*
829 %{_mandir}/man1/mysql.1*
830 %{_mandir}/man1/mysqladmin.1*
831 %{_mandir}/man1/mysqldump.1*
832 %{_mandir}/man1/mysqlshow.1*
833 %{_mandir}/man1/mysqlmanager.1*
834 %{_mandir}/man1/mysqlbinlog.1*
835 %{_mandir}/man1/mysqlimport.1*
838 %defattr(644,root,root,755)
839 %doc EXCEPTIONS-CLIENT
840 %attr(755,root,root) %{_libdir}/lib*.so.*.*
841 %attr(751,root,root) %dir %{_sysconfdir}/mysql
842 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
845 %defattr(644,root,root,755)
846 %attr(755,root,root) %{_bindir}/mysql_config
847 %attr(755,root,root) %{_libdir}/lib*.so
848 %attr(755,root,root) %{_bindir}/*comp_err
849 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
850 %{?debug:%{_datadir}/mysql/mysqld.sym}
852 %{_libdir}/lib*[!tr].a
854 %{_mandir}/man1/mysql_config.1*
857 %defattr(644,root,root,755)
858 %{_libdir}/lib*[tr].a
861 %defattr(644,root,root,755)
862 %attr(755,root,root) %{_bindir}/mysqltest
863 %attr(755,root,root) %{_bindir}/mysql_client_test
864 %dir %{_datadir}/sql-bench
865 %{_datadir}/sql-bench/[CDRl]*
866 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
868 %{_datadir}/mysql/mi_test_all.res
869 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
872 #%defattr(644,root,root,755)
873 #%doc Docs/manual.html Docs/manual_toc.html
876 %defattr(644,root,root,755)
877 %attr(755,root,root) %{_sbindir}/ndbd
878 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
879 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
882 %defattr(644,root,root,755)
883 %attr(755,root,root) %{_bindir}/ndb_*
886 %defattr(644,root,root,755)
887 %attr(755,root,root) %{_sbindir}/ndb_mgmd
888 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
889 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
892 %defattr(644,root,root,755)
893 %attr(755,root,root) %{_sbindir}/ndb_cpcd
894 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
895 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc