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