2 # - C(XX)FLAGS for innodb subdirs are overriden by ./configure!
3 # - http://bugs.mysql.com/bug.php?id=16470
6 %bcond_with bdb # Berkeley DB support
7 %bcond_without innodb # InnoDB storage engine support
8 %bcond_with sphinx # Sphinx storage engine support
9 %bcond_without raid # Without raid
10 %bcond_without ssl # Without OpenSSL
11 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
12 %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms
14 %include /usr/lib/rpm/macros.perl
15 #define _snap 20060111
16 Summary: MySQL: a very fast and reliable SQL database engine
17 Summary(de): MySQL: ist eine SQL-Datenbank
18 Summary(fr): MySQL: un serveur SQL rapide et fiable
19 Summary(pl): MySQL: bardzo szybka i niezawodna baza danych (SQL)
20 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
21 Summary(ru): MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
22 Summary(uk): MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
23 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
27 License: GPL + MySQL FLOSS Exception
28 Group: Applications/Databases
29 #Source0: ftp://ftp.mysql.com/pub/mysql/src/%{name}-%{version}.tar.gz
30 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
31 # Source0-md5: b45cd6c89e35dfc1cdbe1a1f782aefbf
32 Source100: http://www.sphinxsearch.com/downloads/sphinx-0.9.7.tar.gz
33 # Source100-md5: 32f2b7e98d8485c86108851d52c5cef4
35 Source2: %{name}.sysconfig
36 Source3: %{name}.logrotate
37 Source4: %{name}d.conf
38 Source5: %{name}-clusters.conf
39 Source7: %{name}-ndb.init
40 Source8: %{name}-ndb.sysconfig
41 Source9: %{name}-ndb-mgm.init
42 Source10: %{name}-ndb-mgm.sysconfig
43 Source11: %{name}-ndb-cpc.init
44 Source12: %{name}-ndb-cpc.sysconfig
45 Source13: %{name}-client.conf
46 Patch0: %{name}-libs.patch
47 Patch1: %{name}-sphinx.patch
48 Patch2: %{name}-c++.patch
49 Patch3: %{name}-info.patch
50 Patch4: %{name}-sql-cxx-pic.patch
51 Patch5: %{name}-noproc.patch
52 Patch6: %{name}-fix_privilege_tables.patch
53 Patch7: %{name}-align.patch
54 Patch8: %{name}-client-config.patch
55 Patch9: %{name}-build.patch
56 Patch10: %{name}-alpha.patch
57 Patch11: %{name}-ndb-ldflags.patch
58 Patch12: %{name}-bug-20153.patch
59 Patch13: %{name}-bug-28337.patch
60 Patch14: %{name}-bug-27694.patch
61 Patch15: %{name}-bug-29082.patch
62 URL: http://www.mysql.com/products/database/mysql/community_edition.html
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}} %{?with_sphinx:-a100}
442 mv sphinx-*/mysqlse sql/sphinx
448 # this is strange: mysqld functions for UDF modules are not explicitly defined,
449 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
450 # in objects compiled without -fPIC
472 # The compiler flags are as per their "official" spec ;)
473 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
474 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
476 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
477 # and therefore do not add BR on these. These are here just to satisfy
482 FIND_PROC='/bin/ps p $$PID' \
484 CHECK_PID='/bin/kill -0 $$PID' \
486 --enable-largefile=yes \
489 --enable-thread-safe-client \
490 --with%{!?with_bdb:out}-berkeley-db \
491 --with%{!?with_innodb:out}-innodb \
492 --with%{!?with_raid:out}-raid \
493 --with%{!?with_ssl:out}-openssl \
494 --with%{!?with_tcpd:out}-libwrap \
495 %{?with_big_tables:--with-big-tables} \
496 --with-comment="PLD Linux Distribution MySQL RPM" \
497 --with%{!?debug:out}-debug \
498 --with%{!?debug:out}-ndb-debug \
499 --with-embedded-server \
500 --with-extra-charsets=all \
502 --with-mysqld-user=mysql \
503 --with-named-curses-libs="-lncurses" \
504 --with-named-thread-libs="-lpthread" \
505 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
506 --with-archive-storage-engine \
507 %{?with_sphinx:--with-sphinx-storage-engine} \
514 # --with-ndb-test --with-ndb-docs
516 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
517 # (it defaults to first cluster but user may change it to whatever
520 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
523 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
525 %{__make} -C Docs mysql.info
528 rm -rf $RPM_BUILD_ROOT
529 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql} \
530 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
531 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
534 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
539 DESTDIR=$RPM_BUILD_ROOT \
540 benchdir=%{_datadir}/sql-bench \
542 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
544 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
546 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
547 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
548 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
549 # This is template for configuration file which is created after 'service mysql init'
550 install %{SOURCE4} mysqld.conf
551 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
552 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
554 # remove innodb directives from mysqld.conf if mysqld is configured without
556 echo "BASE_TABLETYPE=MyISAM" >> $RPM_BUILD_ROOT/etc/sysconfig/mysql
557 cp mysqld.conf mysqld.tmp
558 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
561 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
563 cp mysqld.conf mysqld.tmp
564 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
567 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
568 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
571 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
572 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
573 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
574 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
575 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
576 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
577 # remove .txt variants for .sys messages
578 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
580 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
581 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
583 # remove known unpackaged files
584 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
586 # rename not to be so generic name
587 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
588 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
590 # not useful without -debug build
591 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
592 # generate symbols file, so one can generate backtrace using it
593 # mysql_resolve_stack_dump -s %{_datadir}/mysql/mysqld.sym -n mysqld.stack.
594 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
595 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
597 # functionality in initscript / rpm
598 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
599 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
600 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
601 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
602 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
603 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
604 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
605 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
606 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
607 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
608 rm $RPM_BUILD_ROOT%{_mandir}/man1/safe_mysqld*
609 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
610 rm $RPM_BUILD_ROOT%{_mandir}/man1/make_win_bin_dist.1
611 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_install_db.1
612 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_waitpid.1
615 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
618 rm -rf $RPM_BUILD_ROOT
621 %groupadd -g 89 mysql
622 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
625 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
626 /sbin/chkconfig --add mysql
627 %service mysql restart
630 if [ "$1" = "0" ]; then
631 %service -q mysql stop
632 /sbin/chkconfig --del mysql
636 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
637 if [ "$1" = "0" ]; then
643 /sbin/chkconfig --add mysql-ndb
644 %service mysql-ndb restart "mysql NDB engine"
647 if [ "$1" = "0" ]; then
648 %service mysql-ndb stop
649 /sbin/chkconfig --del mysql-ndb
653 /sbin/chkconfig --add mysql-ndb-mgm
654 %service mysql-ndb-mgm restart "mysql NDB management node"
657 if [ "$1" = "0" ]; then
658 %service mysql-ndb-mgm stop
659 /sbin/chkconfig --del mysql-ndb-mgm
663 /sbin/chkconfig --add mysql-ndb-cpc
664 %service mysql-ndb-cpc restart "mysql NDB CPC"
667 if [ "$1" = "0" ]; then
668 %service mysql-ndb-cpc stop
669 /sbin/chkconfig --del mysql-ndb-cpc
672 %post libs -p /sbin/ldconfig
673 %postun libs -p /sbin/ldconfig
675 %triggerpostun -- mysql <= 4.0.20-2
676 # For clusters in /etc/mysql/clusters.conf
677 if [ -f "/etc/sysconfig/mysql" ]; then
678 . /etc/sysconfig/mysql
679 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
680 for i in "$MYSQL_DB_CLUSTERS"; do
681 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
683 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
684 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
685 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
686 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
690 %triggerpostun -- mysql <= 4.1.1
691 # For better compatibility with prevoius versions:
692 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
693 if echo "$config" | grep -q '^/'; then
694 config_file="$config"
695 elif [ -f "/etc/mysql/$config" ]; then
696 config_file=/etc/mysql/$config
698 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
699 if [ -z "$clusterdir" ]; then
700 echo >&2 "Can't find cluster dir for $config!"
701 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
704 config_file="$clusterdir/mysqld.conf"
707 if [ ! -f "$config_file" ]; then
708 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
711 echo "Adding option old-passwords to config: $config_file"
712 echo "If you want to use new, better passwords - remove it"
714 # sed magic to add 'old-passwords' to [mysqld] section
715 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
717 a; Compatibility options:
723 %banner -e %{name}-4.1.x <<-EOF
724 If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
725 mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
730 %defattr(644,root,root,755)
731 %doc support-files/*.cnf support-files/*.ini
732 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
733 %attr(754,root,root) /etc/rc.d/init.d/mysql
734 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
735 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
736 %attr(755,root,root) %{_bindir}/innochecksum
737 %attr(755,root,root) %{_bindir}/myisamchk
738 %attr(755,root,root) %{_bindir}/myisamlog
739 %attr(755,root,root) %{_bindir}/myisampack
740 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
741 %attr(755,root,root) %{_bindir}/my_print_defaults
742 %attr(755,root,root) %{_bindir}/mysql_upgrade
743 %attr(755,root,root) %{_bindir}/mysql_upgrade_shell
744 %attr(755,root,root) %{_sbindir}/mysqld
745 %{_mandir}/man1/mysql_fix_privilege_tables.1*
746 %{_mandir}/man1/my_print_defaults.1*
747 %{_mandir}/man1/myisamchk.1*
748 %{_mandir}/man1/myisamlog.1*
749 %{_mandir}/man1/myisampack.1*
750 %{_mandir}/man1/mysql_upgrade.1*
751 %{_mandir}/man1/innochecksum.1*
752 %{_mandir}/man8/mysqld.8*
754 %attr(700,mysql,mysql) %{_mysqlhome}
755 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
756 %attr(751,root,root) /var/lib/mysql
757 %attr(750,mysql,mysql) %dir /var/log/mysql
758 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
759 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
761 %{_infodir}/mysql.info*
762 # This is template for configuration file which is created after 'service mysql init'
763 %{_datadir}/mysql/mysqld.conf
764 %{_datadir}/mysql/english
765 %{_datadir}/mysql/fill_help_tables.sql
766 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
767 %lang(cs) %{_datadir}/mysql/czech
768 %lang(da) %{_datadir}/mysql/danish
769 %lang(de) %{_datadir}/mysql/german
770 %lang(el) %{_datadir}/mysql/greek
771 %lang(es) %{_datadir}/mysql/spanish
772 %lang(et) %{_datadir}/mysql/estonian
773 %lang(fr) %{_datadir}/mysql/french
774 %lang(hu) %{_datadir}/mysql/hungarian
775 %lang(it) %{_datadir}/mysql/italian
776 %lang(ja) %{_datadir}/mysql/japanese
777 %lang(ko) %{_datadir}/mysql/korean
778 %lang(nl) %{_datadir}/mysql/dutch
779 %lang(nb) %{_datadir}/mysql/norwegian
780 %lang(nn) %{_datadir}/mysql/norwegian-ny
781 %lang(pl) %{_datadir}/mysql/polish
782 %lang(pt) %{_datadir}/mysql/portuguese
783 %lang(ro) %{_datadir}/mysql/romanian
784 %lang(ru) %{_datadir}/mysql/russian
785 %lang(sr) %{_datadir}/mysql/serbian
786 %lang(sk) %{_datadir}/mysql/slovak
787 %lang(sv) %{_datadir}/mysql/swedish
788 %lang(uk) %{_datadir}/mysql/ukrainian
791 %defattr(644,root,root,755)
792 %dir %{_datadir}/mysql
793 %{_datadir}/mysql/charsets
796 %defattr(644,root,root,755)
797 %attr(755,root,root) %{_bindir}/msql2mysql
798 %attr(755,root,root) %{_bindir}/myisam_ftdump
799 %attr(755,root,root) %{_bindir}/mysql_secure_installation
800 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
801 %attr(755,root,root) %{_bindir}/mysqlcheck
802 %attr(755,root,root) %{_bindir}/perror
803 %attr(755,root,root) %{_bindir}/replace
804 %attr(755,root,root) %{_bindir}/resolveip
805 %{_mandir}/man1/msql2mysql.1*
806 %{_mandir}/man1/myisam_ftdump.1*
807 %{_mandir}/man1/mysql_tzinfo_to_sql.1*
808 %{_mandir}/man1/mysqlcheck.1*
809 %{_mandir}/man1/perror.1*
810 %{_mandir}/man1/replace.1*
811 %{_mandir}/man1/mysql_secure_installation.1*
814 %defattr(644,root,root,755)
815 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
816 %attr(755,root,root) %{_bindir}/mysql_explain_log
817 %attr(755,root,root) %{_bindir}/mysql_find_rows
818 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
819 %attr(755,root,root) %{_bindir}/mysql_setpermission
820 %attr(755,root,root) %{_bindir}/mysql_tableinfo
821 %attr(755,root,root) %{_bindir}/mysql_zap
822 %attr(755,root,root) %{_bindir}/mysqlaccess
823 %attr(755,root,root) %{_bindir}/mysqldumpslow
824 %attr(755,root,root) %{_bindir}/mysqlhotcopy
825 %{_mandir}/man1/mysql_explain_log.1*
826 %{_mandir}/man1/mysql_zap.1*
827 %{_mandir}/man1/mysqlaccess.1*
828 %{_mandir}/man1/mysqlhotcopy.1*
829 %{_mandir}/man1/mysql_setpermission.1*
830 %{_mandir}/man1/mysql_tableinfo.1*
831 %{_mandir}/man1/mysql_fix_extensions.1*
832 %{_mandir}/man1/mysql_find_rows.1*
833 %{_mandir}/man1/mysql_convert_table_format.1*
836 %defattr(644,root,root,755)
837 %attr(755,root,root) %{_bindir}/mysql
838 %attr(755,root,root) %{_bindir}/mysqlbug
839 %attr(755,root,root) %{_bindir}/mysqldump
840 %attr(755,root,root) %{_bindir}/mysqlimport
841 %attr(755,root,root) %{_sbindir}/mysqlmanager*
842 %attr(755,root,root) %{_bindir}/mysqlshow
843 %attr(755,root,root) %{_bindir}/mysqlbinlog
844 %attr(755,root,root) %{_bindir}/mysqladmin
845 %attr(755,root,root) %{_bindir}/mysqltest*
846 %{_mandir}/man1/mysql.1*
847 %{_mandir}/man1/mysqladmin.1*
848 %{_mandir}/man1/mysqldump.1*
849 %{_mandir}/man1/mysqlshow.1*
850 %{_mandir}/man1/mysqlbinlog.1*
851 %{_mandir}/man1/mysqlimport.1*
852 %{_mandir}/man1/mysqltest*.1*
853 %{_mandir}/man1/mysqlmanager*.1*
854 %{_mandir}/man8/mysqlmanager.8*
857 %defattr(644,root,root,755)
858 %doc EXCEPTIONS-CLIENT
859 %attr(755,root,root) %{_libdir}/lib*.so.*.*
860 %attr(751,root,root) %dir %{_sysconfdir}/mysql
861 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
864 %defattr(644,root,root,755)
865 %attr(755,root,root) %{_bindir}/mysql_config
866 %attr(755,root,root) %{_libdir}/lib*.so
867 %attr(755,root,root) %{_bindir}/*comp_err
868 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
869 %{?debug:%{_datadir}/mysql/mysqld.sym}
871 %{_libdir}/lib*[!tr].a
873 %{_mandir}/man1/mysql_config.1*
874 %{?debug:%{_mandir}/man1/resolve_stack_dump.1*}
877 %defattr(644,root,root,755)
878 %{_libdir}/lib*[tr].a
881 %defattr(644,root,root,755)
882 %attr(755,root,root) %{_bindir}/mysqltest
883 %attr(755,root,root) %{_bindir}/mysql_client_test
884 %dir %{_datadir}/sql-bench
885 %{_datadir}/sql-bench/[CDRl]*
886 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
888 %{_datadir}/mysql/mi_test_all.res
889 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
890 %{_mandir}/man1/mysql_client_test.1*
893 #%defattr(644,root,root,755)
894 #%doc Docs/manual.html Docs/manual_toc.html
897 %defattr(644,root,root,755)
898 %attr(755,root,root) %{_sbindir}/ndbd
899 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
900 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
901 %{_mandir}/man1/ndbd.1*
904 %defattr(644,root,root,755)
905 %attr(755,root,root) %{_bindir}/ndb_*
906 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
907 %{_mandir}/man1/ndb_*.1*
908 %exclude %{_mandir}/man1/ndb_mgmd.1*
909 %exclude %{_mandir}/man1/ndb_cpcd.1*
912 %defattr(644,root,root,755)
913 %attr(755,root,root) %{_sbindir}/ndb_mgmd
914 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
915 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
916 %{_mandir}/man1/ndb_mgmd.1*
919 %defattr(644,root,root,755)
920 %attr(755,root,root) %{_sbindir}/ndb_cpcd
921 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
922 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
923 %{_mandir}/man1/ndb_cpcd.1*