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_without autodeps # BR packages needed only for resolving deps
13 %bcond_with bdb # Berkeley DB support
14 %bcond_without sphinx # Sphinx storage engine support
15 %bcond_with xtrabackup # XtraBackup
17 %include /usr/lib/rpm/macros.perl
18 #define _snap 20060111
19 Summary: MySQL: a very fast and reliable SQL database engine
20 Summary(de.UTF-8): MySQL: ist eine SQL-Datenbank
21 Summary(fr.UTF-8): MySQL: un serveur SQL rapide et fiable
22 Summary(pl.UTF-8): MySQL: bardzo szybka i niezawodna baza danych (SQL)
23 Summary(pt_BR.UTF-8): MySQL: Um servidor SQL rápido e confiável
24 Summary(ru.UTF-8): MySQL - быстрый SQL-сервер
25 Summary(uk.UTF-8): MySQL - швидкий SQL-сервер
26 Summary(zh_CN.UTF-8): MySQL数据库服务器
30 License: GPL + MySQL FLOSS Exception
31 Group: Applications/Databases
32 #Source0: ftp://ftp.mysql.com/pub/mysql/src/%{name}-%{version}.tar.gz
33 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
34 # Source0-md5: c1f746bfbc8c2cb3ec1e0427a8a88c55
35 #Source0: http://mysql.he.net/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
36 #Source0: http://mirror.provenscaling.com/mysql/enterprise/source/5.0/%{name}-%{version}.tar.gz
37 Source100: http://www.sphinxsearch.com/downloads/sphinx-0.9.9-rc2.tar.gz
38 # Source100-md5: 1ca266613bfdb0e6952d9ca1af93f7cc
40 Source2: %{name}.sysconfig
41 Source3: %{name}.logrotate
42 Source4: %{name}d.conf
43 Source5: %{name}-clusters.conf
44 Source7: %{name}-ndb.init
45 Source8: %{name}-ndb.sysconfig
46 Source9: %{name}-ndb-mgm.init
47 Source10: %{name}-ndb-mgm.sysconfig
48 Source11: %{name}-ndb-cpc.init
49 Source12: %{name}-ndb-cpc.sysconfig
50 Source13: %{name}-client.conf
52 Patch0: %{name}-libs.patch
53 Patch1: %{name}-sphinx.patch
54 Patch2: %{name}-c++.patch
55 Patch3: %{name}-info.patch
56 Patch4: %{name}-sql-cxx-pic.patch
57 Patch5: %{name}-noproc.patch
58 Patch6: %{name}-fix_privilege_tables.patch
59 Patch7: %{name}-align.patch
60 Patch8: %{name}-client-config.patch
61 Patch9: %{name}-build.patch
62 Patch10: %{name}-alpha.patch
63 Patch11: %{name}-ndb-ldflags.patch
64 Patch12: %{name}-bug-20153.patch
65 Patch13: %{name}-bug-34192.patch
66 Patch14: %{name}-bug-16470.patch
67 Patch15: %{name}-system-users.patch
68 Patch16: %{name}-errorlog-no-rename.patch
69 Patch17: %{name}-alpha-stack.patch
70 Patch18: %{name}-xtrabackup.patch
71 Patch19: %{name}-fixes.patch
72 Patch20: %{name}-gcc3.patch
73 Patch21: %{name}-atomic.patch
74 # <percona patches, http://www.percona.com/percona-lab.html>
75 Patch100: %{name}-show_patches.patch
76 Patch101: %{name}-microslow_innodb.patch
77 Patch102: %{name}-profiling_slow.patch
78 Patch103: %{name}-userstatv2.patch
79 Patch104: %{name}-microsec_process.patch
80 Patch105: %{name}-innodb_io_patches.patch
81 Patch106: %{name}-innodb_locks_held.patch
82 Patch107: %{name}-innodb_show_bp.patch
83 Patch108: %{name}-innodb_check_fragmentation.patch
84 Patch109: %{name}-innodb_io_pattern.patch
85 Patch110: %{name}-innodb_fsync_source.patch
86 Patch111: %{name}-innodb_show_hashed_memory.patch
87 Patch112: %{name}-innodb_dict_size_limit.patch
88 Patch113: %{name}-innodb_extra_rseg.patch
89 Patch114: %{name}-innodb_thread_concurrency_timer_based.patch
90 Patch115: %{name}-innodb_use_sys_malloc.patch
91 Patch116: %{name}-innodb_recovery_patches.patch
92 Patch117: %{name}-innodb_split_buf_pool_mutex.patch
93 Patch118: %{name}-innodb_rw_lock.patch
94 Patch119: %{name}-mysql-test.patch
96 URL: http://www.mysql.com/products/database/mysql/community_edition.html
97 BuildRequires: autoconf
98 BuildRequires: automake
100 %{?with_bdb:BuildRequires: db3-devel}
102 BuildRequires: libstdc++-devel >= 5:3.0
103 BuildRequires: libtool
104 %{?with_tcpd:BuildRequires: libwrap-devel}
105 BuildRequires: ncurses-devel >= 4.2
106 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
107 %{?with_autodeps:BuildRequires: perl-DBI}
108 BuildRequires: perl-devel >= 1:5.6.1
109 BuildRequires: readline-devel >= 4.2
110 BuildRequires: rpm-perlprov >= 4.1-13
111 BuildRequires: rpmbuild(macros) >= 1.453
112 BuildRequires: sed >= 4.0
113 BuildRequires: texinfo
114 BuildRequires: zlib-devel
115 Requires(post,preun): /sbin/chkconfig
116 Requires(postun): /usr/sbin/groupdel
117 Requires(postun): /usr/sbin/userdel
118 Requires(pre): /bin/id
119 Requires(pre): /usr/bin/getgid
120 Requires(pre): /usr/sbin/groupadd
121 Requires(pre): /usr/sbin/useradd
122 Requires(triggerpostun): sed >= 4.0
123 Requires: %{name}-charsets = %{version}-%{release}
124 Requires: %{name}-libs = %{version}-%{release}
125 Requires: /usr/bin/setsid
126 Requires: rc-scripts >= 0.2.0
127 Suggests: mysql-client
128 %{?with_tcpd:Suggests: tcp_wrappers}
129 Provides: MySQL-server
130 Provides: group(mysql)
131 Provides: msqlormysql
132 Provides: user(mysql)
134 Obsoletes: mysql-server
135 Conflicts: logrotate < 3.7-4
136 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
138 %define _libexecdir %{_sbindir}
139 %define _localstatedir /var/lib/mysql
140 %define _mysqlhome /home/services/mysql
142 %define _noautoreqdep 'perl(DBD::mysql)'
143 # CFLAGS for innodb are altered
144 %undefine configure_cache
147 MySQL is a true multi-user, multi-threaded SQL (Structured Query
148 Language) database server. SQL is the most popular database language
149 in the world. MySQL is a client/server implementation that consists of
150 a server daemon mysqld and many different client programs/libraries.
152 The main goals of MySQL are speed, robustness and easy to use. MySQL
153 was originally developed because we at Tcx needed a SQL server that
154 could handle very big databases with magnitude higher speed than what
155 any database vendor could offer to us. We have now been using MySQL
156 since 1996 in a environment with more than 40 databases, 10,000
157 tables, of which more than 500 have more than 7 million rows. This is
158 about 50G of mission critical data.
160 The base upon which MySQL is built is a set of routines that have been
161 used in a highly demanding production environment for many years.
162 While MySQL is still in development, it already offers a rich and
163 highly useful function set.
165 %description -l fr.UTF-8
166 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
167 multi-taches. Le langage SQL est le langage de bases de donnees le
168 plus populaire au monde. MySQL est une implementation client/serveur
169 qui consiste en un serveur (mysqld) et differents
170 programmes/bibliotheques clientes.
172 Les objectifs principaux de MySQL sont: vitesse, robustesse et
173 facilite d'utilisation. MySQL fut originalement developpe parce que
174 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
175 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
176 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
177 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
178 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
179 millions de lignes. Ceci represente environ 50G de donnees critiques.
181 A la base de la conception de MySQL, on retrouve une serie de routines
182 qui ont ete utilisees dans un environnement de production pendant
183 plusieurs annees. Meme si MySQL est encore en developpement, il offre
184 deja une riche et utile serie de fonctions.
186 %description -l pl.UTF-8
187 MySQL to prawdziwie wieloużytkownikowy, wielowątkowy serwer baz danych
188 SQL. SQL jest najpopularniejszym na świecie językiem używanym do baz
189 danych. MySQL to implementacja klient/serwer składająca się z demona
190 mysqld i wielu różnych programów i bibliotek klienckich.
192 Głównymi celami MySQL-a są szybkość, potęga i łatwość użytkowania.
193 MySQL oryginalnie był tworzony, ponieważ autorzy w Tcx potrzebowali
194 serwera SQL do obsługi bardzo dużych baz danych z szybkością o wiele
195 większą, niż mogli zaoferować inni producenci baz danych. Używają go
196 od 1996 roku w środowisku z ponad 40 bazami danych, 10 000 tabel, z
197 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie około
198 50GB krytycznych danych.
200 Baza, na której oparty jest MySQL, składa się ze zbioru procedur,
201 które były używane w bardzo wymagającym środowisku produkcyjnym przez
202 wiele lat. Pomimo, że MySQL jest ciągle rozwijany, już oferuje bogaty
203 i użyteczny zbiór funkcji.
205 %description -l de.UTF-8
206 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
207 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
208 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
209 einem Primärschlüssel versehen werden. Es ist aber keine Definition
210 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
211 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
212 Daten verantwortlich. Allein durch die Nutzung externer
213 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
214 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
216 %description -l pt_BR.UTF-8
217 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
218 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
219 dados no mundo. O MySQL é uma implementação cliente/servidor que
220 consiste de um servidor chamado mysqld e diversos
221 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
222 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
223 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
224 pudesse lidar com grandes bases de dados e com uma velocidade muito
225 maior do que a que qualquer vendedor podia nos oferecer. Estamos
226 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
227 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
228 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
229 A base da construção do MySQL é uma série de rotinas que foram usadas
230 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
231 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
232 funções muito ricas e úteis. Veja a documentação para maiores
235 %description -l ru.UTF-8
236 MySQL - это SQL (Structured Query Language) сервер базы данных. MySQL
237 была написана Michael'ом (monty) Widenius'ом. См. файл CREDITS в
238 дистрибутиве на предмет других участников проекта и прочей информации
241 %description -l uk.UTF-8
242 MySQL - це SQL (Structured Query Language) сервер бази даних. MySQL
243 було написано Michael'ом (monty) Widenius'ом. Див. файл CREDITS в
244 дистрибутиві для інформації про інших учасників проекту та іншої
248 Summary: MySQL - character sets definitions
249 Summary(pl.UTF-8): MySQL - definicje kodowań znaków
250 Group: Applications/Databases
252 %description charsets
253 This package contains character sets definitions needed by both client
256 %description charsets -l pl.UTF-8
257 Ten pakiet zawiera definicje kodowań znaków potrzebne dla serwera i
260 %package -n mysqlhotcopy
261 Summary: mysqlhotcopy - A MySQL database backup program
262 Group: Applications/Databases
263 Requires: %{name}-libs = %{version}-%{release}
264 Requires: perl-DBD-mysql
266 %description -n mysqlhotcopy
267 mysqlhotcopy uses LOCK TABLES, FLUSH TABLES, and cp or scp to make a
268 database backup quickly. It is the fastest way to make a backup of the
269 database or single tables, but it can be run only on the same machine
270 where the database directories are located. mysqlhotcopy works only
271 for backing up MyISAM and ARCHIVE tables.
273 See innobackup package to backup InnoDB tables.
276 Summary: MySQL additional utilities
277 Summary(pl.UTF-8): Dodatkowe narzędzia do MySQL
278 Group: Applications/Databases
279 Requires: %{name}-libs = %{version}-%{release}
282 MySQL additional utilities except Perl scripts (they may be found in
283 %{name}-extras-perl package).
285 %description extras -l pl.UTF-8
286 Dodatkowe narzędzia do MySQL - z wyjątkiem skryptów Perla (które są w
287 pakiecie %{name}-extras-perl).
290 Summary: MySQL additional utilities written in Perl
291 Summary(pl.UTF-8): Dodatkowe narzędzia do MySQL napisane w Perlu
292 Group: Applications/Databases
293 Requires: %{name}-extras = %{version}-%{release}
294 # this is just for the sake of smooth upgrade, not to break systems
295 Requires: mysqlhotcopy = %{version}-%{release}
296 Requires: perl(DBD::mysql)
298 %description extras-perl
299 MySQL additional utilities written in Perl.
301 %description extras-perl -l pl.UTF-8
302 Dodatkowe narzędzia do MySQL napisane w Perlu.
305 Summary: MySQL - Client
306 Summary(pl.UTF-8): MySQL - Klient
307 Summary(pt.UTF-8): MySQL - Cliente
308 Summary(ru.UTF-8): MySQL клиент
309 Summary(uk.UTF-8): MySQL клієнт
310 Group: Applications/Databases
311 Requires: %{name}-charsets = %{version}-%{release}
312 Requires: %{name}-libs = %{version}-%{release}
313 Obsoletes: MySQL-client
316 This package contains the standard MySQL clients.
318 %description client -l fr.UTF-8
319 Ce package contient les clients MySQL standards.
321 %description client -l pl.UTF-8
322 Standardowe programy klienckie MySQL.
324 %description client -l pt_BR.UTF-8
325 Este pacote contém os clientes padrão para o MySQL.
327 %description client -l ru.UTF-8
328 Этот пакет содержит только клиент MySQL.
330 %description client -l uk.UTF-8
331 Цей пакет містить тільки клієнта MySQL.
334 Summary: Shared libraries for MySQL
335 Summary(pl.UTF-8): Biblioteki dzielone MySQL
337 Obsoletes: libmysql10
338 Obsoletes: mysql-doc < 4.1.12
341 Shared libraries for MySQL.
343 %description libs -l pl.UTF-8
344 Biblioteki dzielone MySQL.
347 Summary: MySQL - Development header files and libraries
348 Summary(pl.UTF-8): MySQL - Pliki nagłówkowe i biblioteki dla programistów
349 Summary(pt.UTF-8): MySQL - Medições de desempenho
350 Summary(ru.UTF-8): MySQL - хедеры и библиотеки разработчика
351 Summary(uk.UTF-8): MySQL - хедери та бібліотеки програміста
352 Group: Development/Libraries
353 Requires: %{name}-libs = %{version}-%{release}
354 %{?with_ssl:Requires: openssl-devel}
356 Obsoletes: MySQL-devel
357 Obsoletes: libmysql10-devel
360 This package contains the development header files and libraries
361 necessary to develop MySQL client applications.
363 %description devel -l fr.UTF-8
364 Ce package contient les fichiers entetes et les librairies de
365 developpement necessaires pour developper des applications clientes
368 %description devel -l pl.UTF-8
369 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
372 %description devel -l pt_BR.UTF-8
373 Este pacote contém os arquivos de cabeçalho (header files) e
374 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
376 %description devel -l ru.UTF-8
377 Этот пакет содержит хедеры и библиотеки разработчика, необходимые для
378 разработки клиентских приложений.
380 %description devel -l uk.UTF-8
381 Цей пакет містить хедери та бібліотеки програміста, необхідні для
382 розробки програм-клієнтів.
385 Summary: MySQL static libraries
386 Summary(pl.UTF-8): Biblioteki statyczne MySQL
387 Summary(ru.UTF-8): MySQL - статические библиотеки
388 Summary(uk.UTF-8): MySQL - статичні бібліотеки
389 Group: Development/Libraries
390 Requires: %{name}-devel = %{version}-%{release}
391 Obsoletes: MySQL-static
394 MySQL static libraries.
396 %description static -l pl.UTF-8
397 Biblioteki statyczne MySQL.
399 %description static -l ru.UTF-8
400 Этот пакет содержит статические библиотеки разработчика, необходимые
401 для разработки клиентских приложений.
403 %description static -l uk.UTF-8
404 Цей пакет містить статичні бібліотеки програміста, необхідні для
405 розробки програм-клієнтів.
408 Summary: MySQL - Benchmarks
409 Summary(pl.UTF-8): MySQL - Programy testujące szybkość działania bazy
410 Summary(pt.UTF-8): MySQL - Medições de desempenho
411 Summary(ru.UTF-8): MySQL - бенчмарки
412 Summary(uk.UTF-8): MySQL - бенчмарки
413 Group: Applications/Databases
414 Requires: %{name} = %{version}-%{release}
415 Requires: %{name}-client
416 Requires: perl(DBD::mysql)
417 Obsoletes: MySQL-bench
420 This package contains MySQL benchmark scripts and data.
422 %description bench -l pl.UTF-8
423 Programy testujące szybkość serwera MySQL.
425 %description bench -l pt_BR.UTF-8
426 Este pacote contém medições de desempenho de scripts e dados do MySQL.
428 %description bench -l ru.UTF-8
429 Этот пакет содержит скрипты и данные для оценки производительности
432 %description bench -l uk.UTF-8
433 Цей пакет містить скрипти та дані для оцінки продуктивності MySQL.
436 Summary: MySQL manual
437 Summary(pl.UTF-8): Podręcznik użytkownika MySQL
438 Group: Applications/Databases
441 This package contains manual in HTML format.
443 %description doc -l pl.UTF-8
444 Podręcznik MySQL-a w formacie HTML.
447 Summary: MySQL - NDB Storage Engine Daemon
448 Summary(pl.UTF-8): MySQL - demon silnika przechowywania danych NDB
449 Group: Applications/Databases
450 Requires: %{name}-libs = %{version}-%{release}
453 This package contains the standard MySQL NDB Storage Engine Daemon.
455 %description ndb -l pl.UTF-8
456 Ten pakiet zawiera standardowego demona silnika przechowywania danych
460 Summary: MySQL - NDB Clients
461 Summary(pl.UTF-8): MySQL - programy klienckie NDB
462 Group: Applications/Databases
463 Requires: %{name}-libs = %{version}-%{release}
465 %description ndb-client
466 This package contains the standard MySQL NDB Clients.
468 %description ndb-client -l pl.UTF-8
469 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
472 Summary: MySQL - NDB Management Daemon
473 Summary(pl.UTF-8): MySQL - demon zarządzający NDB
474 Group: Applications/Databases
475 Requires: %{name}-libs = %{version}-%{release}
478 This package contains the standard MySQL NDB Management Daemon.
480 %description ndb-mgm -l pl.UTF-8
481 Ten pakiet zawiera standardowego demona zarządzającego MySQL NDB.
484 Summary: MySQL - NDB CPC Daemon
485 Summary(pl.UTF-8): MySQL - demon NDB CPC
486 Group: Applications/Databases
487 Requires: %{name}-libs = %{version}-%{release}
490 This package contains the standard MySQL NDB CPC Daemon.
492 %description ndb-cpc -l pl.UTF-8
493 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
496 %setup -q %{?_snap:-n %{name}-%{version}-nightly-%{_snap}} %{?with_sphinx:-a100}
499 mv sphinx-*/mysqlse sql/sphinx
505 # this is strange: mysqld functions for UDF modules are not explicitly defined,
506 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
507 # in objects compiled without -fPIC
526 %{?with_xtrabackup:%patch18 -p1}
552 %if "%{cxx_version}" < "4.1"
564 # The compiler flags are as per their "official" spec ;)
565 CXXFLAGS="%{rpmcflags} -fno-implicit-templates -fno-exceptions -fno-rtti"
566 CFLAGS="%{rpmcflags}"
567 CPPFLAGS="%{rpmcppflags}"
569 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
570 # and therefore do not add BR on these. These are here just to satisfy
575 FIND_PROC='/bin/ps p $$PID' \
577 CHECK_PID='/bin/kill -0 $$PID' \
579 --enable-largefile=yes \
582 --enable-thread-safe-client \
583 --with%{!?with_bdb:out}-berkeley-db \
584 --with%{!?with_innodb:out}-innodb \
585 --with%{!?with_raid:out}-raid \
586 --with%{!?with_ssl:out}-openssl \
587 --with%{!?with_tcpd:out}-libwrap \
588 %{?with_big_tables:--with-big-tables} \
589 --with-comment="PLD Linux Distribution MySQL RPM" \
590 --with%{!?debug:out}-debug \
591 --with%{!?debug:out}-ndb-debug \
592 --with-embedded-server \
593 --with-extra-charsets=all \
595 --with-mysqld-user=mysql \
596 --with-named-curses-libs="-lncurses" \
597 --with-named-thread-libs="-lpthread" \
598 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
599 --with-archive-storage-engine \
600 %{?with_sphinx:--with-sphinx-storage-engine} \
601 %{?with_federated:--with-federated-storage-engine} \
608 # --with-ndb-test --with-ndb-docs
610 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
611 # (it defaults to first cluster but user may change it to whatever
614 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
617 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
619 %if %{with xtrabackup}
620 %{__make} -C innobase/xtrabackup \
624 %{__make} -C Docs mysql.info
627 rm -rf $RPM_BUILD_ROOT
628 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql,ssl/certs/mysql} \
629 $RPM_BUILD_ROOT/var/{log/{archive,}/mysql,lib/mysql} \
630 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
633 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
638 DESTDIR=$RPM_BUILD_ROOT \
639 benchdir=%{_datadir}/sql-bench \
641 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
643 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
645 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
646 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
647 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
648 # This is template for configuration file which is created after 'service mysql init'
649 install %{SOURCE4} mysqld.conf
650 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
651 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
653 # remove innodb directives from mysqld.conf if mysqld is configured without
654 %if %{without innodb}
655 cp mysqld.conf mysqld.tmp
656 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
659 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
661 cp mysqld.conf mysqld.tmp
662 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
665 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
666 cp -a %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
669 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
670 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
671 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
672 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
673 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
674 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
676 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
677 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
678 sed -i -e '/libs/s/$ldflags//' $RPM_BUILD_ROOT%{_bindir}/mysql_config
680 # remove known unpackaged files
681 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
683 # remove .txt variants for .sys messages
684 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
686 # rename not to be so generic name
687 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
688 mv $RPM_BUILD_ROOT%{_mandir}/man1/{,mysql_}resolve_stack_dump.1
690 # not useful without -debug build
691 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
692 %{!?debug:rm -f $RPM_BUILD_ROOT%{_mandir}/man1/mysql_resolve_stack_dump.1}
693 # generate symbols file, so one can generate backtrace using it
694 # mysql_resolve_stack_dump -s %{_datadir}/mysql/mysqld.sym -n mysqld.stack.
695 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
696 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
698 # do not clobber users $PATH
699 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_upgrade
700 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/innochecksum
701 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamchk
702 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisamlog
703 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/myisampack
704 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysql_fix_privilege_tables
705 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/my_print_defaults
706 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/mysqlcheck
708 # functionality in initscript / rpm
709 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
710 rm $RPM_BUILD_ROOT%{_bindir}/mysql_upgrade_shell
711 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
712 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
713 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
714 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
715 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
716 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
717 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
718 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
719 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
720 rm $RPM_BUILD_ROOT%{_mandir}/man1/safe_mysqld*
721 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
722 rm $RPM_BUILD_ROOT%{_bindir}/resolveip
723 rm $RPM_BUILD_ROOT%{_mandir}/man1/resolveip.1*
724 rm $RPM_BUILD_ROOT%{_bindir}/comp_err
725 rm $RPM_BUILD_ROOT%{_mandir}/man1/comp_err.1
726 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_install_db.1
727 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_waitpid.1
728 rm $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld_multi.server
730 # no package for tests
731 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql-stress-test.pl.1
732 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql-test-run.pl.1
733 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql_client_test_embedded.1
735 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqltest_embedded.1
738 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
741 rm -rf $RPM_BUILD_ROOT
744 %groupadd -g 89 mysql
745 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
748 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
749 /sbin/chkconfig --add mysql
750 %service mysql restart
753 if [ "$1" = "0" ]; then
754 %service -q mysql stop
755 /sbin/chkconfig --del mysql
759 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
760 if [ "$1" = "0" ]; then
766 /sbin/chkconfig --add mysql-ndb
767 %service mysql-ndb restart "mysql NDB engine"
770 if [ "$1" = "0" ]; then
771 %service mysql-ndb stop
772 /sbin/chkconfig --del mysql-ndb
776 /sbin/chkconfig --add mysql-ndb-mgm
777 %service mysql-ndb-mgm restart "mysql NDB management node"
780 if [ "$1" = "0" ]; then
781 %service mysql-ndb-mgm stop
782 /sbin/chkconfig --del mysql-ndb-mgm
786 /sbin/chkconfig --add mysql-ndb-cpc
787 %service mysql-ndb-cpc restart "mysql NDB CPC"
790 if [ "$1" = "0" ]; then
791 %service mysql-ndb-cpc stop
792 /sbin/chkconfig --del mysql-ndb-cpc
795 %post libs -p /sbin/ldconfig
796 %postun libs -p /sbin/ldconfig
798 %triggerpostun -- mysql < 4.0.20-2.4
799 # For clusters in /etc/mysql/clusters.conf
800 if [ -f /etc/sysconfig/mysql ]; then
801 . /etc/sysconfig/mysql
802 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
803 for i in "$MYSQL_DB_CLUSTERS"; do
804 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
806 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
807 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
808 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
809 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
813 %triggerpostun -- mysql < 4.1.1
814 # For better compatibility with prevoius versions:
815 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
816 if echo "$config" | grep -q '^/'; then
817 config_file="$config"
818 elif [ -f "/etc/mysql/$config" ]; then
819 config_file=/etc/mysql/$config
821 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
822 if [ -z "$clusterdir" ]; then
823 echo >&2 "Can't find cluster dir for $config!"
824 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
827 config_file="$clusterdir/mysqld.conf"
830 if [ ! -f "$config_file" ]; then
831 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
834 echo "Adding option old-passwords to config: $config_file"
835 echo "If you want to use new, better passwords - remove it"
837 # sed magic to add 'old-passwords' to [mysqld] section
838 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
840 a; Compatibility options:
846 %banner -e %{name}-4.1.x <<-EOF
847 If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
848 mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
853 %defattr(644,root,root,755)
854 %doc support-files/*.cnf support-files/*.ini ChangeLog
855 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
856 %attr(754,root,root) /etc/rc.d/init.d/mysql
857 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
858 %dir /etc/ssl/certs/mysql
859 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
860 %attr(755,root,root) %{_sbindir}/innochecksum
861 %attr(755,root,root) %{_sbindir}/my_print_defaults
862 %attr(755,root,root) %{_sbindir}/myisamchk
863 %attr(755,root,root) %{_sbindir}/myisamlog
864 %attr(755,root,root) %{_sbindir}/myisampack
865 %attr(755,root,root) %{_sbindir}/mysql_fix_privilege_tables
866 %attr(755,root,root) %{_sbindir}/mysql_upgrade
867 %attr(755,root,root) %{_sbindir}/mysqlcheck
868 %attr(755,root,root) %{_sbindir}/mysqld
869 %{_mandir}/man1/innochecksum.1*
870 %{_mandir}/man1/my_print_defaults.1*
871 %{_mandir}/man1/myisamchk.1*
872 %{_mandir}/man1/myisamlog.1*
873 %{_mandir}/man1/myisampack.1*
874 %{_mandir}/man1/mysql_fix_privilege_tables.1*
875 %{_mandir}/man1/mysql_upgrade.1*
876 %{_mandir}/man1/mysqlcheck.1*
877 %{_mandir}/man8/mysqld.8*
880 %attr(755,root,root) %{_bindir}/*resolve_stack_dump
881 %{_datadir}/mysql/mysqld.sym
882 %{_mandir}/man1/*resolve_stack_dump.1*
885 %attr(700,mysql,mysql) %{_mysqlhome}
886 # root:root is proper here for mysql.rpm while mysql:mysql is potential security hole
887 %attr(751,root,root) /var/lib/mysql
888 %attr(750,mysql,mysql) %dir /var/log/mysql
889 %attr(750,mysql,mysql) %dir /var/log/archive/mysql
890 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
892 %{_infodir}/mysql.info*
893 # This is template for configuration file which is created after 'service mysql init'
894 %{_datadir}/mysql/mysqld.conf
895 %{_datadir}/mysql/mysql_system_tables.sql
896 %{_datadir}/mysql/mysql_system_tables_data.sql
897 %{_datadir}/mysql/mysql_test_data_timezone.sql
899 %{_datadir}/mysql/english
900 %{_datadir}/mysql/fill_help_tables.sql
901 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
902 %lang(cs) %{_datadir}/mysql/czech
903 %lang(da) %{_datadir}/mysql/danish
904 %lang(de) %{_datadir}/mysql/german
905 %lang(el) %{_datadir}/mysql/greek
906 %lang(es) %{_datadir}/mysql/spanish
907 %lang(et) %{_datadir}/mysql/estonian
908 %lang(fr) %{_datadir}/mysql/french
909 %lang(hu) %{_datadir}/mysql/hungarian
910 %lang(it) %{_datadir}/mysql/italian
911 %lang(ja) %{_datadir}/mysql/japanese
912 %lang(ko) %{_datadir}/mysql/korean
913 %lang(nl) %{_datadir}/mysql/dutch
914 %lang(nb) %{_datadir}/mysql/norwegian
915 %lang(nn) %{_datadir}/mysql/norwegian-ny
916 %lang(pl) %{_datadir}/mysql/polish
917 %lang(pt) %{_datadir}/mysql/portuguese
918 %lang(ro) %{_datadir}/mysql/romanian
919 %lang(ru) %{_datadir}/mysql/russian
920 %lang(sr) %{_datadir}/mysql/serbian
921 %lang(sk) %{_datadir}/mysql/slovak
922 %lang(sv) %{_datadir}/mysql/swedish
923 %lang(uk) %{_datadir}/mysql/ukrainian
926 %defattr(644,root,root,755)
927 %dir %{_datadir}/mysql
928 %{_datadir}/mysql/charsets
931 %defattr(644,root,root,755)
932 %attr(755,root,root) %{_bindir}/msql2mysql
933 %attr(755,root,root) %{_bindir}/myisam_ftdump
934 %attr(755,root,root) %{_bindir}/mysql_secure_installation
935 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
936 %attr(755,root,root) %{_bindir}/perror
937 %attr(755,root,root) %{_bindir}/replace
938 %{_mandir}/man1/msql2mysql.1*
939 %{_mandir}/man1/myisam_ftdump.1*
940 %{_mandir}/man1/mysql_secure_installation.1*
941 %{_mandir}/man1/mysql_tzinfo_to_sql.1*
942 %{_mandir}/man1/perror.1*
943 %{_mandir}/man1/replace.1*
945 %files -n mysqlhotcopy
946 %defattr(644,root,root,755)
947 %attr(755,root,root) %{_bindir}/mysqlhotcopy
948 %{_mandir}/man1/mysqlhotcopy.1*
951 %defattr(644,root,root,755)
952 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
953 %attr(755,root,root) %{_bindir}/mysql_explain_log
954 %attr(755,root,root) %{_bindir}/mysql_find_rows
955 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
956 %attr(755,root,root) %{_bindir}/mysql_setpermission
957 %attr(755,root,root) %{_bindir}/mysql_tableinfo
958 %attr(755,root,root) %{_bindir}/mysql_zap
959 %attr(755,root,root) %{_bindir}/mysqlaccess
960 %attr(755,root,root) %{_bindir}/mysqldumpslow
961 %{_mandir}/man1/mysql_convert_table_format.1*
962 %{_mandir}/man1/mysql_explain_log.1*
963 %{_mandir}/man1/mysql_find_rows.1*
964 %{_mandir}/man1/mysql_fix_extensions.1*
965 %{_mandir}/man1/mysql_setpermission.1*
966 %{_mandir}/man1/mysql_tableinfo.1*
967 %{_mandir}/man1/mysql_zap.1*
968 %{_mandir}/man1/mysqlaccess.1*
969 %{_mandir}/man1/mysqldumpslow.1*
972 %defattr(644,root,root,755)
973 %attr(755,root,root) %{_bindir}/mysql
974 %attr(755,root,root) %{_bindir}/mysqladmin
975 %attr(755,root,root) %{_bindir}/mysqlbinlog
976 %attr(755,root,root) %{_bindir}/mysqlbug
977 %attr(755,root,root) %{_bindir}/mysqldump
978 %attr(755,root,root) %{_bindir}/mysqlimport
979 %attr(755,root,root) %{_bindir}/mysqlshow
980 %attr(755,root,root) %{_sbindir}/mysqlmanager
981 %{_mandir}/man1/mysql.1*
982 %{_mandir}/man1/mysqladmin.1*
983 %{_mandir}/man1/mysqlbinlog.1*
984 %{_mandir}/man1/mysqlbug.1*
985 %{_mandir}/man1/mysqldump.1*
986 %{_mandir}/man1/mysqlimport.1*
987 %{_mandir}/man1/mysqlshow.1*
988 %{_mandir}/man8/mysqlmanager.8*
991 %defattr(644,root,root,755)
992 %doc EXCEPTIONS-CLIENT
993 %attr(751,root,root) %dir %{_sysconfdir}/mysql
994 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
995 %attr(755,root,root) %{_libdir}/libmysqlclient.so.*.*
996 %attr(755,root,root) %ghost %{_libdir}/libmysqlclient.so.15
997 %attr(755,root,root) %{_libdir}/libmysqlclient_r.so.*.*
998 %attr(755,root,root) %ghost %{_libdir}/libmysqlclient_r.so.15
999 %attr(755,root,root) %{_libdir}/libndbclient.so.*.*
1000 %attr(755,root,root) %ghost %{_libdir}/libndbclient.so.2
1003 %defattr(644,root,root,755)
1004 %attr(755,root,root) %{_bindir}/mysql_config
1005 %attr(755,root,root) %{_libdir}/libmysqlclient.so
1006 %attr(755,root,root) %{_libdir}/libmysqlclient_r.so
1007 %attr(755,root,root) %{_libdir}/libndbclient.so
1008 %{_libdir}/libmysqlclient.la
1009 %{_libdir}/libmysqlclient_r.la
1010 %{_libdir}/libndbclient.la
1012 %{_libdir}/libdbug.a
1013 %{_libdir}/libheap.a
1014 %{_libdir}/libmyisam.a
1015 %{_libdir}/libmyisammrg.a
1016 %{_libdir}/libmysqld.a
1017 %{_libdir}/libmystrings.a
1018 %{_libdir}/libmysys.a
1020 %{_includedir}/mysql
1021 %{_mandir}/man1/mysql_config.1*
1024 %defattr(644,root,root,755)
1025 %{_libdir}/libmysqlclient.a
1026 %{_libdir}/libmysqlclient_r.a
1027 %{_libdir}/libndbclient.a
1030 %defattr(644,root,root,755)
1031 %attr(755,root,root) %{_bindir}/mysql_client_test
1032 %attr(755,root,root) %{_bindir}/mysqltest
1033 %attr(755,root,root) %{_bindir}/mysqltestmanager
1034 %attr(755,root,root) %{_bindir}/mysqltestmanager-pwgen
1035 %attr(755,root,root) %{_bindir}/mysqltestmanagerc
1036 %dir %{_datadir}/sql-bench
1037 %{_datadir}/sql-bench/[CDRl]*
1038 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
1040 %{_datadir}/mysql/mi_test_all.res
1041 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
1042 %{_mandir}/man1/mysql_client_test.1*
1043 %{_mandir}/man1/mysqltest.1*
1046 #%defattr(644,root,root,755)
1047 #%doc Docs/manual.html Docs/manual_toc.html
1050 %defattr(644,root,root,755)
1051 %attr(755,root,root) %{_sbindir}/ndbd
1052 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
1053 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
1054 %{_mandir}/man8/ndbd.8*
1057 %defattr(644,root,root,755)
1058 %attr(755,root,root) %{_bindir}/ndb_config
1059 %attr(755,root,root) %{_bindir}/ndb_delete_all
1060 %attr(755,root,root) %{_bindir}/ndb_desc
1061 %attr(755,root,root) %{_bindir}/ndb_drop_index
1062 %attr(755,root,root) %{_bindir}/ndb_drop_table
1063 %attr(755,root,root) %{_bindir}/ndb_error_reporter
1064 %attr(755,root,root) %{_bindir}/ndb_mgm
1065 %attr(755,root,root) %{_bindir}/ndb_restore
1066 %attr(755,root,root) %{_bindir}/ndb_select_all
1067 %attr(755,root,root) %{_bindir}/ndb_select_count
1068 %attr(755,root,root) %{_bindir}/ndb_show_tables
1069 %attr(755,root,root) %{_bindir}/ndb_size.pl
1070 %attr(755,root,root) %{_bindir}/ndb_test_platform
1071 %attr(755,root,root) %{_bindir}/ndb_waiter
1072 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
1073 %{_mandir}/man1/ndb_config.1*
1074 %{_mandir}/man1/ndb_delete_all.1*
1075 %{_mandir}/man1/ndb_desc.1*
1076 %{_mandir}/man1/ndb_drop_index.1*
1077 %{_mandir}/man1/ndb_drop_table.1*
1078 %{_mandir}/man1/ndb_error_reporter.1*
1079 %{_mandir}/man1/ndb_mgm.1*
1080 %{_mandir}/man1/ndb_restore.1*
1081 %{_mandir}/man1/ndb_select_all.1*
1082 %{_mandir}/man1/ndb_select_count.1*
1083 %{_mandir}/man1/ndb_show_tables.1*
1084 %{_mandir}/man1/ndb_size.pl.1*
1085 %{_mandir}/man1/ndb_waiter.1*
1088 %defattr(644,root,root,755)
1089 %attr(755,root,root) %{_sbindir}/ndb_mgmd
1090 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
1091 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
1092 %{_mandir}/man8/ndb_mgmd.8*
1095 %defattr(644,root,root,755)
1096 %attr(755,root,root) %{_sbindir}/ndb_cpcd
1097 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
1098 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
1099 %{_mandir}/man1/ndb_cpcd.1*