2 # - C(XX)FLAGS for innodb subdirs are overriden by ./configure!
3 # - http://bugs.mysql.com/bug.php?id=16470
6 %bcond_without big_tables # Support tables with more than 4G rows even on 32 bit platforms
7 %bcond_without federated # Federated storage engine support
8 %bcond_without innodb # InnoDB 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_with bdb # Berkeley DB support
13 %bcond_with sphinx # Sphinx storage engine support
15 %include /usr/lib/rpm/macros.perl
16 #define _snap 20060111
17 Summary: MySQL: a very fast and reliable SQL database engine
18 Summary(de): MySQL: ist eine SQL-Datenbank
19 Summary(fr): MySQL: un serveur SQL rapide et fiable
20 Summary(pl): MySQL: bardzo szybka i niezawodna baza danych (SQL)
21 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
22 Summary(ru): MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
23 Summary(uk): MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
24 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
28 License: GPL + MySQL FLOSS Exception
29 Group: Applications/Databases
30 #Source0: ftp://ftp.mysql.com/pub/mysql/src/%{name}-%{version}.tar.gz
31 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
32 # Source0-md5: 88c39c8cb77810febb83b7ee625364d7
33 Source100: http://www.sphinxsearch.com/downloads/sphinx-0.9.7.tar.gz
34 # Source100-md5: 32f2b7e98d8485c86108851d52c5cef4
36 Source2: %{name}.sysconfig
37 Source3: %{name}.logrotate
38 Source4: %{name}d.conf
39 Source5: %{name}-clusters.conf
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}-sphinx.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 Patch12: %{name}-bug-20153.patch
60 Patch15: %{name}-bug-29082.patch
61 Patch16: %{name}-bug-16470.patch
62 Patch17: %{name}-CVE-2007-5925.patch
63 URL: http://www.mysql.com/products/database/mysql/community_edition.html
64 BuildRequires: autoconf
65 BuildRequires: automake
66 %{?with_bdb:BuildRequires: db3-devel}
67 BuildRequires: libstdc++-devel >= 5:3.0
68 BuildRequires: libtool
69 %{?with_tcpd:BuildRequires: libwrap-devel}
70 BuildRequires: ncurses-devel >= 4.2
71 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
72 BuildRequires: perl-DBI
73 BuildRequires: perl-devel >= 1:5.6.1
74 BuildRequires: readline-devel >= 4.2
75 BuildRequires: rpm-perlprov >= 4.1-13
76 BuildRequires: rpmbuild(macros) >= 1.268
77 BuildRequires: sed >= 4.0
78 BuildRequires: texinfo
79 BuildRequires: zlib-devel
80 Requires(post,preun): /sbin/chkconfig
81 Requires(postun): /usr/sbin/groupdel
82 Requires(postun): /usr/sbin/userdel
83 Requires(pre): /bin/id
84 Requires(pre): /usr/bin/getgid
85 Requires(pre): /usr/sbin/groupadd
86 Requires(pre): /usr/sbin/useradd
87 Requires(triggerpostun): sed >= 4.0
88 Requires: %{name}-charsets = %{version}-%{release}
89 Requires: /usr/bin/setsid
90 Requires: rc-scripts >= 0.2.0
91 Provides: MySQL-server
92 Provides: group(mysql)
96 Obsoletes: mysql-server
97 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99 %define _libexecdir %{_sbindir}
100 %define _localstatedir /var/lib/mysql
101 %define _mysqlhome /home/services/mysql
103 %define _noautoreqdep 'perl(DBD::mysql)'
104 # CFLAGS for innodb are altered
105 %undefine configure_cache
108 MySQL is a true multi-user, multi-threaded SQL (Structured Query
109 Language) database server. SQL is the most popular database language
110 in the world. MySQL is a client/server implementation that consists of
111 a server daemon mysqld and many different client programs/libraries.
113 The main goals of MySQL are speed, robustness and easy to use. MySQL
114 was originally developed because we at Tcx needed a SQL server that
115 could handle very big databases with magnitude higher speed than what
116 any database vendor could offer to us. We have now been using MySQL
117 since 1996 in a environment with more than 40 databases, 10,000
118 tables, of which more than 500 have more than 7 million rows. This is
119 about 50G of mission critical data.
121 The base upon which MySQL is built is a set of routines that have been
122 used in a highly demanding production environment for many years.
123 While MySQL is still in development, it already offers a rich and
124 highly useful function set.
127 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
128 multi-taches. Le langage SQL est le langage de bases de donnees le
129 plus populaire au monde. MySQL est une implementation client/serveur
130 qui consiste en un serveur (mysqld) et differents
131 programmes/bibliotheques clientes.
133 Les objectifs principaux de MySQL sont: vitesse, robustesse et
134 facilite d'utilisation. MySQL fut originalement developpe parce que
135 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
136 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
137 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
138 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
139 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
140 millions de lignes. Ceci represente environ 50G de donnees critiques.
142 A la base de la conception de MySQL, on retrouve une serie de routines
143 qui ont ete utilisees dans un environnement de production pendant
144 plusieurs annees. Meme si MySQL est encore en developpement, il offre
145 deja une riche et utile serie de fonctions.
148 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
149 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
150 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
151 mysqld i wielu ró¿nych programów i bibliotek klienckich.
153 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
154 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
155 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
156 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
157 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
158 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
159 50GB krytycznych danych.
161 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
162 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
163 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
164 i u¿yteczny zbiór funkcji.
167 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
168 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
169 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
170 einem Primärschlüssel versehen werden. Es ist aber keine Definition
171 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
172 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
173 Daten verantwortlich. Allein durch die Nutzung externer
174 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
175 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
177 %description -l pt_BR
178 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
179 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
180 dados no mundo. O MySQL é uma implementação cliente/servidor que
181 consiste de um servidor chamado mysqld e diversos
182 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
183 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
184 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
185 pudesse lidar com grandes bases de dados e com uma velocidade muito
186 maior do que a que qualquer vendedor podia nos oferecer. Estamos
187 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
188 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
189 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
190 A base da construção do MySQL é uma série de rotinas que foram usadas
191 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
192 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
193 funções muito ricas e úteis. Veja a documentação para maiores
197 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
198 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
199 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
203 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
204 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
205 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
209 Summary: MySQL - character sets definitions
210 Summary(pl): MySQL - definicje kodowañ znaków
211 Group: Applications/Databases
213 %description charsets
214 This package contains character sets definitions needed by both client
217 %description charsets -l pl
218 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
222 Summary: MySQL additional utilities
223 Summary(pl): Dodatkowe narzêdzia do MySQL
224 Group: Applications/Databases
225 Requires: %{name}-libs = %{version}-%{release}
228 MySQL additional utilities except Perl scripts (they may be found in
229 %{name}-extras-perl package).
231 %description extras -l pl
232 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
233 pakiecie %{name}-extras-perl).
236 Summary: MySQL additional utilities written in Perl
237 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
238 Group: Applications/Databases
239 Requires: %{name}-extras = %{version}-%{release}
240 Requires: perl(DBD::mysql)
242 %description extras-perl
243 MySQL additional utilities written in Perl.
245 %description extras-perl -l pl
246 Dodatkowe narzêdzia do MySQL napisane w Perlu.
249 Summary: MySQL - Client
250 Summary(pl): MySQL - Klient
251 Summary(pt): MySQL - Cliente
252 Summary(ru): MySQL ËÌÉÅÎÔ
253 Summary(uk): MySQL Ë̦¤ÎÔ
254 Group: Applications/Databases
255 Requires: %{name}-charsets = %{version}-%{release}
256 Requires: %{name}-libs = %{version}-%{release}
257 Obsoletes: MySQL-client
260 This package contains the standard MySQL clients.
262 %description client -l fr
263 Ce package contient les clients MySQL standards.
265 %description client -l pl
266 Standardowe programy klienckie MySQL.
268 %description client -l pt_BR
269 Este pacote contém os clientes padrão para o MySQL.
271 %description client -l ru
272 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
274 %description client -l uk
275 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
278 Summary: Shared libraries for MySQL
279 Summary(pl): Biblioteki dzielone MySQL
281 Obsoletes: libmysql10
282 Obsoletes: mysql-doc < 4.1.12
285 Shared libraries for MySQL.
287 %description libs -l pl
288 Biblioteki dzielone MySQL.
291 Summary: MySQL - Development header files and libraries
292 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
293 Summary(pt): MySQL - Medições de desempenho
294 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
295 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
296 Group: Development/Libraries
297 Requires: %{name}-libs = %{version}-%{release}
298 %{?with_ssl:Requires: openssl-devel}
300 Obsoletes: MySQL-devel
301 Obsoletes: libmysql10-devel
304 This package contains the development header files and libraries
305 necessary to develop MySQL client applications.
307 %description devel -l fr
308 Ce package contient les fichiers entetes et les librairies de
309 developpement necessaires pour developper des applications clientes
312 %description devel -l pl
313 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
316 %description devel -l pt_BR
317 Este pacote contém os arquivos de cabeçalho (header files) e
318 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
320 %description devel -l ru
321 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
322 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
324 %description devel -l uk
325 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
326 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
329 Summary: MySQL static libraries
330 Summary(pl): Biblioteki statyczne MySQL
331 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
332 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
333 Group: Development/Libraries
334 Requires: %{name}-devel = %{version}-%{release}
335 Obsoletes: MySQL-static
338 MySQL static libraries.
340 %description static -l pl
341 Biblioteki statyczne MySQL.
343 %description static -l ru
344 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
345 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
347 %description static -l uk
348 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
349 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
352 Summary: MySQL - Benchmarks
353 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
354 Summary(pt): MySQL - Medições de desempenho
355 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
356 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
357 Group: Applications/Databases
358 Requires: %{name} = %{version}-%{release}
359 Requires: %{name}-client
360 Requires: perl(DBD::mysql)
361 Obsoletes: MySQL-bench
364 This package contains MySQL benchmark scripts and data.
366 %description bench -l pl
367 Programy testuj±ce szybko¶æ serwera MySQL.
369 %description bench -l pt_BR
370 Este pacote contém medições de desempenho de scripts e dados do MySQL.
372 %description bench -l ru
373 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
376 %description bench -l uk
377 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
380 Summary: MySQL manual
381 Summary(pl): Podrêcznik u¿ytkownika MySQL
382 Group: Applications/Databases
385 This package contains manual in HTML format.
387 %description doc -l pl
388 Podrêcznik MySQL-a w formacie HTML.
391 Summary: MySQL - NDB Storage Engine Daemon
392 Summary(pl): MySQL - demon silnika przechowywania danych NDB
393 Group: Applications/Databases
394 Requires: %{name}-libs = %{version}-%{release}
397 This package contains the standard MySQL NDB Storage Engine Daemon.
399 %description ndb -l pl
400 Ten pakiet zawiera standardowego demona silnika przechowywania danych
404 Summary: MySQL - NDB Clients
405 Summary(pl): MySQL - programy klienckie NDB
406 Group: Applications/Databases
407 Requires: %{name}-libs = %{version}-%{release}
409 %description ndb-client
410 This package contains the standard MySQL NDB Clients.
412 %description ndb-client -l pl
413 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
416 Summary: MySQL - NDB Management Daemon
417 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
418 Group: Applications/Databases
419 Requires: %{name}-libs = %{version}-%{release}
422 This package contains the standard MySQL NDB Management Daemon.
424 %description ndb-mgm -l pl
425 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
428 Summary: MySQL - NDB CPC Daemon
429 Summary(pl): MySQL - demon NDB CPC
430 Group: Applications/Databases
431 Requires: %{name}-libs = %{version}-%{release}
434 This package contains the standard MySQL NDB CPC Daemon.
436 %description ndb-cpc -l pl
437 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
440 %setup -q %{?_snap:-n %{name}-%{version}-nightly-%{_snap}} %{?with_sphinx:-a100}
443 mv sphinx-*/mysqlse sql/sphinx
449 # this is strange: mysqld functions for UDF modules are not explicitly defined,
450 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
451 # in objects compiled without -fPIC
473 # The compiler flags are as per their "official" spec ;)
474 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
475 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
477 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
478 # and therefore do not add BR on these. These are here just to satisfy
483 FIND_PROC='/bin/ps p $$PID' \
485 CHECK_PID='/bin/kill -0 $$PID' \
487 --enable-largefile=yes \
490 --enable-thread-safe-client \
491 --with%{!?with_bdb:out}-berkeley-db \
492 --with%{!?with_innodb:out}-innodb \
493 --with%{!?with_raid:out}-raid \
494 --with%{!?with_ssl:out}-openssl \
495 --with%{!?with_tcpd:out}-libwrap \
496 %{?with_big_tables:--with-big-tables} \
497 --with-comment="PLD Linux Distribution MySQL RPM" \
498 --with%{!?debug:out}-debug \
499 --with%{!?debug:out}-ndb-debug \
500 --with-embedded-server \
501 --with-extra-charsets=all \
503 --with-mysqld-user=mysql \
504 --with-named-curses-libs="-lncurses" \
505 --with-named-thread-libs="-lpthread" \
506 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
507 --with-archive-storage-engine \
508 %{?with_sphinx:--with-sphinx-storage-engine} \
509 %{?with_federated:--with-federated-storage-engine} \
516 # --with-ndb-test --with-ndb-docs
518 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
519 # (it defaults to first cluster but user may change it to whatever
522 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
525 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
527 %{__make} -C Docs mysql.info
530 rm -rf $RPM_BUILD_ROOT
531 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql} \
532 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
533 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
536 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
541 DESTDIR=$RPM_BUILD_ROOT \
542 benchdir=%{_datadir}/sql-bench \
544 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
546 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
548 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
549 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
550 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
551 # This is template for configuration file which is created after 'service mysql init'
552 install %{SOURCE4} mysqld.conf
553 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
554 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
556 # remove innodb directives from mysqld.conf if mysqld is configured without
558 echo "BASE_TABLETYPE=MyISAM" >> $RPM_BUILD_ROOT/etc/sysconfig/mysql
559 cp mysqld.conf mysqld.tmp
560 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
563 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
565 cp mysqld.conf mysqld.tmp
566 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
569 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
570 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
573 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
574 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
575 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
576 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
577 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
578 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
579 # remove .txt variants for .sys messages
580 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
582 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
583 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
585 # remove known unpackaged files
586 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
588 # rename not to be so generic name
589 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
590 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
591 mv $RPM_BUILD_ROOT%{_mandir}/man1/{,mysql_}resolve_stack_dump.1
592 mv $RPM_BUILD_ROOT%{_mandir}/man1/{,mysql_}comp_err.1
594 # not useful without -debug build
595 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
596 %{!?debug:rm -f $RPM_BUILD_ROOT%{_mandir}/man1/mysql_resolve_stack_dump.1}
597 # generate symbols file, so one can generate backtrace using it
598 # mysql_resolve_stack_dump -s %{_datadir}/mysql/mysqld.sym -n mysqld.stack.
599 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
600 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
602 # functionality in initscript / rpm / other os
603 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
604 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
605 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
606 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
607 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
608 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
609 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
610 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
611 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
612 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
613 rm $RPM_BUILD_ROOT%{_mandir}/man1/safe_mysqld*
614 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
615 rm $RPM_BUILD_ROOT%{_mandir}/man1/make_win_bin_dist.1
616 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_install_db.1
617 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_waitpid.1
618 rm $RPM_BUILD_ROOT%{_mandir}/man1/make_win_src_distribution.1
620 # no package for tests
621 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql-stress-test.pl.1
622 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql-test-run.pl.1
623 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_client_test_embedded.1
626 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
629 rm -rf $RPM_BUILD_ROOT
632 %groupadd -g 89 mysql
633 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
636 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
637 /sbin/chkconfig --add mysql
638 %service mysql restart
641 if [ "$1" = "0" ]; then
642 %service -q mysql stop
643 /sbin/chkconfig --del mysql
647 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
648 if [ "$1" = "0" ]; then
654 /sbin/chkconfig --add mysql-ndb
655 %service mysql-ndb restart "mysql NDB engine"
658 if [ "$1" = "0" ]; then
659 %service mysql-ndb stop
660 /sbin/chkconfig --del mysql-ndb
664 /sbin/chkconfig --add mysql-ndb-mgm
665 %service mysql-ndb-mgm restart "mysql NDB management node"
668 if [ "$1" = "0" ]; then
669 %service mysql-ndb-mgm stop
670 /sbin/chkconfig --del mysql-ndb-mgm
674 /sbin/chkconfig --add mysql-ndb-cpc
675 %service mysql-ndb-cpc restart "mysql NDB CPC"
678 if [ "$1" = "0" ]; then
679 %service mysql-ndb-cpc stop
680 /sbin/chkconfig --del mysql-ndb-cpc
683 %post libs -p /sbin/ldconfig
684 %postun libs -p /sbin/ldconfig
686 %triggerpostun -- mysql <= 4.0.20-2
687 # For clusters in /etc/mysql/clusters.conf
688 if [ -f "/etc/sysconfig/mysql" ]; then
689 . /etc/sysconfig/mysql
690 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
691 for i in "$MYSQL_DB_CLUSTERS"; do
692 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
694 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
695 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
696 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
697 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
701 %triggerpostun -- mysql <= 4.1.1
702 # For better compatibility with prevoius versions:
703 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
704 if echo "$config" | grep -q '^/'; then
705 config_file="$config"
706 elif [ -f "/etc/mysql/$config" ]; then
707 config_file=/etc/mysql/$config
709 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
710 if [ -z "$clusterdir" ]; then
711 echo >&2 "Can't find cluster dir for $config!"
712 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
715 config_file="$clusterdir/mysqld.conf"
718 if [ ! -f "$config_file" ]; then
719 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
722 echo "Adding option old-passwords to config: $config_file"
723 echo "If you want to use new, better passwords - remove it"
725 # sed magic to add 'old-passwords' to [mysqld] section
726 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
728 a; Compatibility options:
734 %banner -e %{name}-4.1.x <<-EOF
735 If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
736 mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
741 %defattr(644,root,root,755)
742 %doc support-files/*.cnf support-files/*.ini
743 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
744 %attr(754,root,root) /etc/rc.d/init.d/mysql
745 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
746 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
747 %attr(755,root,root) %{_bindir}/innochecksum
748 %attr(755,root,root) %{_bindir}/myisamchk
749 %attr(755,root,root) %{_bindir}/myisamlog
750 %attr(755,root,root) %{_bindir}/myisampack
751 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
752 %attr(755,root,root) %{_bindir}/my_print_defaults
753 %attr(755,root,root) %{_bindir}/mysql_upgrade
754 %attr(755,root,root) %{_bindir}/mysql_upgrade_shell
755 %attr(755,root,root) %{_sbindir}/mysqld
756 %{_mandir}/man1/mysql_fix_privilege_tables.1*
757 %{_mandir}/man1/my_print_defaults.1*
758 %{_mandir}/man1/myisamchk.1*
759 %{_mandir}/man1/myisamlog.1*
760 %{_mandir}/man1/myisampack.1*
761 %{_mandir}/man1/mysql_upgrade.1*
762 %{_mandir}/man1/innochecksum.1*
763 %{_mandir}/man8/mysqld.8*
766 %attr(755,root,root) %{_bindir}/*resolve_stack_dump
767 %{_datadir}/mysql/mysqld.sym
768 %{_mandir}/man1/*resolve_stack_dump.1*
771 %attr(700,mysql,mysql) %{_mysqlhome}
772 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
773 %attr(751,root,root) /var/lib/mysql
774 %attr(750,mysql,mysql) %dir /var/log/mysql
775 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
776 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
778 %{_infodir}/mysql.info*
779 # This is template for configuration file which is created after 'service mysql init'
780 %{_datadir}/mysql/mysqld.conf
782 %{_datadir}/mysql/fill_help_tables.sql
783 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
784 %{_datadir}/mysql/mysql_system_tables.sql
785 %{_datadir}/mysql/mysql_system_tables_data.sql
786 %{_datadir}/mysql/mysql_test_data_timezone.sql
788 %{_datadir}/mysql/english
789 %lang(cs) %{_datadir}/mysql/czech
790 %lang(da) %{_datadir}/mysql/danish
791 %lang(de) %{_datadir}/mysql/german
792 %lang(el) %{_datadir}/mysql/greek
793 %lang(es) %{_datadir}/mysql/spanish
794 %lang(et) %{_datadir}/mysql/estonian
795 %lang(fr) %{_datadir}/mysql/french
796 %lang(hu) %{_datadir}/mysql/hungarian
797 %lang(it) %{_datadir}/mysql/italian
798 %lang(ja) %{_datadir}/mysql/japanese
799 %lang(ko) %{_datadir}/mysql/korean
800 %lang(nl) %{_datadir}/mysql/dutch
801 %lang(nb) %{_datadir}/mysql/norwegian
802 %lang(nn) %{_datadir}/mysql/norwegian-ny
803 %lang(pl) %{_datadir}/mysql/polish
804 %lang(pt) %{_datadir}/mysql/portuguese
805 %lang(ro) %{_datadir}/mysql/romanian
806 %lang(ru) %{_datadir}/mysql/russian
807 %lang(sr) %{_datadir}/mysql/serbian
808 %lang(sk) %{_datadir}/mysql/slovak
809 %lang(sv) %{_datadir}/mysql/swedish
810 %lang(uk) %{_datadir}/mysql/ukrainian
813 %defattr(644,root,root,755)
814 %dir %{_datadir}/mysql
815 %{_datadir}/mysql/charsets
818 %defattr(644,root,root,755)
819 %attr(755,root,root) %{_bindir}/msql2mysql
820 %attr(755,root,root) %{_bindir}/myisam_ftdump
821 %attr(755,root,root) %{_bindir}/mysql_secure_installation
822 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
823 %attr(755,root,root) %{_bindir}/mysqlcheck
824 %attr(755,root,root) %{_bindir}/perror
825 %attr(755,root,root) %{_bindir}/replace
826 %attr(755,root,root) %{_bindir}/resolveip
827 %{_mandir}/man1/msql2mysql.1*
828 %{_mandir}/man1/myisam_ftdump.1*
829 %{_mandir}/man1/mysql_secure_installation.1*
830 %{_mandir}/man1/mysql_tzinfo_to_sql.1*
831 %{_mandir}/man1/mysqlcheck.1*
832 %{_mandir}/man1/perror.1*
833 %{_mandir}/man1/replace.1*
834 %{_mandir}/man1/resolveip.1*
837 %defattr(644,root,root,755)
838 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
839 %attr(755,root,root) %{_bindir}/mysql_explain_log
840 %attr(755,root,root) %{_bindir}/mysql_find_rows
841 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
842 %attr(755,root,root) %{_bindir}/mysql_setpermission
843 %attr(755,root,root) %{_bindir}/mysql_tableinfo
844 %attr(755,root,root) %{_bindir}/mysql_zap
845 %attr(755,root,root) %{_bindir}/mysqlaccess
846 %attr(755,root,root) %{_bindir}/mysqldumpslow
847 %attr(755,root,root) %{_bindir}/mysqlhotcopy
848 %{_mandir}/man1/mysql_explain_log.1*
849 %{_mandir}/man1/mysql_zap.1*
850 %{_mandir}/man1/mysqlaccess.1*
851 %{_mandir}/man1/mysqlhotcopy.1*
852 %{_mandir}/man1/mysql_setpermission.1*
853 %{_mandir}/man1/mysql_tableinfo.1*
854 %{_mandir}/man1/mysql_fix_extensions.1*
855 %{_mandir}/man1/mysql_find_rows.1*
856 %{_mandir}/man1/mysql_convert_table_format.1*
859 %defattr(644,root,root,755)
860 %attr(755,root,root) %{_bindir}/mysql
861 %attr(755,root,root) %{_bindir}/mysqlbug
862 %attr(755,root,root) %{_bindir}/mysqldump
863 %attr(755,root,root) %{_bindir}/mysqlimport
864 %attr(755,root,root) %{_sbindir}/mysqlmanager*
865 %attr(755,root,root) %{_bindir}/mysqlshow
866 %attr(755,root,root) %{_bindir}/mysqlbinlog
867 %attr(755,root,root) %{_bindir}/mysqladmin
868 %{_mandir}/man1/mysql.1*
869 %{_mandir}/man1/mysqladmin.1*
870 %{_mandir}/man1/mysqldump.1*
871 %{_mandir}/man1/mysqlshow.1*
872 %{_mandir}/man1/mysqlbinlog.1*
873 %{_mandir}/man1/mysqlimport.1*
874 %{_mandir}/man1/mysqlmanager*.1*
875 %{_mandir}/man8/mysqlmanager.8*
878 %defattr(644,root,root,755)
879 %doc EXCEPTIONS-CLIENT
880 %attr(755,root,root) %{_libdir}/lib*.so.*.*
881 %attr(751,root,root) %dir %{_sysconfdir}/mysql
882 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
885 %defattr(644,root,root,755)
886 %attr(755,root,root) %{_bindir}/mysql_config
887 %attr(755,root,root) %{_libdir}/lib*.so
888 %attr(755,root,root) %{_bindir}/*comp_err
890 %{_libdir}/lib*[!tr].a
892 %{_mandir}/man1/mysql_config.1*
893 %{_mandir}/man1/*comp_err.1*
896 %defattr(644,root,root,755)
897 %{_libdir}/lib*[tr].a
900 %defattr(644,root,root,755)
901 %attr(755,root,root) %{_bindir}/mysqltest
902 %attr(755,root,root) %{_bindir}/mysql_client_test
903 %dir %{_datadir}/sql-bench
904 %{_datadir}/sql-bench/[CDRl]*
905 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
907 %{_datadir}/mysql/mi_test_all.res
908 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
909 %{_mandir}/man1/mysqltest*.1*
910 %{_mandir}/man1/mysql_client_test.1*
913 #%defattr(644,root,root,755)
914 #%doc Docs/manual.html Docs/manual_toc.html
917 %defattr(644,root,root,755)
918 %attr(755,root,root) %{_sbindir}/ndbd
919 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
920 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
921 %{_mandir}/man1/ndbd.1*
924 %defattr(644,root,root,755)
925 %attr(755,root,root) %{_bindir}/ndb_*
926 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
927 %{_mandir}/man1/ndb_*.1*
928 %exclude %{_mandir}/man1/ndb_mgmd.1*
929 %exclude %{_mandir}/man1/ndb_cpcd.1*
932 %defattr(644,root,root,755)
933 %attr(755,root,root) %{_sbindir}/ndb_mgmd
934 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
935 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
936 %{_mandir}/man1/ndb_mgmd.1*
939 %defattr(644,root,root,755)
940 %attr(755,root,root) %{_sbindir}/ndb_cpcd
941 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
942 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
943 %{_mandir}/man1/ndb_cpcd.1*