2 # - trigger that prepares system from pre-cluster into cluster
3 # - trigger /etc/mysqld.conf into /etc/mysql/mysqld.conf. Solve possible
4 # conflict with /var/lib/mysql/mysqld.conf
5 # - package man1/mysqlman.1, and make programs without manpage '.so mysqlman'
6 # - alpha build failure:
7 #alpha-pld-linux-gcc -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DDATADIR="\"/var/lib/mysql\"" -DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I.. -I../innobase/include -I../ndb/include -I../ndb/include/ndbapi -I../include -I../include -I../regex -I. -DDBUG_OFF -O2 -mieee -fomit-frame-pointer -MT stacktrace.o -MD -MP -MF .deps/stacktrace.Tpo -c -o stacktrace.o stacktrace.c
8 #stacktrace.c: In function `print_stacktrace':
9 #stacktrace.c:189: error: `SIGRETURN_FRAME_COUNT' undeclared (first use in this function)
10 #stacktrace.c:189: error: (Each undeclared identifier is reported only once
11 #stacktrace.c:189: error: for each function it appears in.)
12 #make[4]: *** [stacktrace.o] Error 1
15 %bcond_with bdb # Berkeley DB support
16 %bcond_without innodb # Without InnoDB support
17 %bcond_without isam # Without ISAM table format (used in mysql 3.22)
18 %bcond_without raid # Without raid
19 %bcond_without ssl # Without OpenSSL
20 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
21 %bcond_with big_tables # enable '--with-big-tables', some performance loss on 32bit arch, but can do >= 4GB database tables.
23 %include /usr/lib/rpm/macros.perl
24 Summary: MySQL: a very fast and reliable SQL database engine
25 Summary(de): MySQL: ist eine SQL-Datenbank
26 Summary(fr): MySQL: un serveur SQL rapide et fiable
27 Summary(pl): MySQL: bardzo szybka i niezawodna baza danych (SQL)
28 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
29 Summary(ru): MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
30 Summary(uk): MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
31 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
35 License: GPL + MySQL FLOSS Exception
36 Group: Applications/Databases
37 Source0: http://mysql.dataphone.se/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
38 # Source0-md5: 37b4479951fa0cf052269d27c41ca200
40 Source2: %{name}.sysconfig
41 Source3: %{name}.logrotate
42 Source4: %{name}d.conf
43 Source5: %{name}-clusters.conf
44 Source6: %{name}.monitrc
45 Source7: %{name}-ndb.init
46 Source8: %{name}-ndb.sysconfig
47 Source9: %{name}-ndb-mgm.init
48 Source10: %{name}-ndb-mgm.sysconfig
49 Source11: %{name}-ndb-cpc.init
50 Source12: %{name}-ndb-cpc.sysconfig
51 Source13: %{name}-client.conf
52 Patch0: %{name}-libs.patch
53 Patch1: %{name}-libwrap.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 URL: http://www.mysql.com/
62 #BuildRequires: ORBit-devel
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.228
76 BuildRequires: texinfo
77 BuildRequires: zlib-devel
78 Requires(post,preun): /sbin/chkconfig
79 Requires(postun): /usr/sbin/groupdel
80 Requires(postun): /usr/sbin/userdel
81 Requires(pre): /bin/id
82 Requires(pre): /usr/bin/getgid
83 Requires(pre): /usr/sbin/groupadd
84 Requires(pre): /usr/sbin/useradd
85 Requires(triggerpostun): sed >= 4.0
86 Requires: /usr/bin/setsid
87 Requires: rc-scripts >= 0.2.0
88 Provides: MySQL-server
89 Provides: group(mysql)
93 Obsoletes: mysql-server
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define _libexecdir %{_sbindir}
97 %define _localstatedir /var/lib/mysql
98 %define _mysqlhome /home/services/mysql
100 %define _noautoreqdep 'perl(DBD::mysql)'
102 # innodb confcache has different CFLAGS
103 %undefine configure_cache
106 MySQL is a true multi-user, multi-threaded SQL (Structured Query
107 Language) database server. SQL is the most popular database language
108 in the world. MySQL is a client/server implementation that consists of
109 a server daemon mysqld and many different client programs/libraries.
111 The main goals of MySQL are speed, robustness and easy to use. MySQL
112 was originally developed because we at Tcx needed a SQL server that
113 could handle very big databases with magnitude higher speed than what
114 any database vendor could offer to us. We have now been using MySQL
115 since 1996 in a environment with more than 40 databases, 10,000
116 tables, of which more than 500 have more than 7 million rows. This is
117 about 50G of mission critical data.
119 The base upon which MySQL is built is a set of routines that have been
120 used in a highly demanding production environment for many years.
121 While MySQL is still in development, it already offers a rich and
122 highly useful function set.
125 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
126 multi-taches. Le langage SQL est le langage de bases de donnees le
127 plus populaire au monde. MySQL est une implementation client/serveur
128 qui consiste en un serveur (mysqld) et differents
129 programmes/bibliotheques clientes.
131 Les objectifs principaux de MySQL sont: vitesse, robustesse et
132 facilite d'utilisation. MySQL fut originalement developpe parce que
133 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
134 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
135 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
136 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
137 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
138 millions de lignes. Ceci represente environ 50G de donnees critiques.
140 A la base de la conception de MySQL, on retrouve une serie de routines
141 qui ont ete utilisees dans un environnement de production pendant
142 plusieurs annees. Meme si MySQL est encore en developpement, il offre
143 deja une riche et utile serie de fonctions.
146 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
147 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
148 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
149 mysqld i wielu ró¿nych programów i bibliotek klienckich.
151 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
152 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
153 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
154 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
155 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
156 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
157 50GB krytycznych danych.
159 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
160 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
161 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
162 i u¿yteczny zbiór funkcji.
165 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
166 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
167 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
168 einem Primärschlüssel versehen werden. Es ist aber keine Definition
169 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
170 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
171 Daten verantwortlich. Allein durch die Nutzung externer
172 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
173 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
175 %description -l pt_BR
176 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
177 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
178 dados no mundo. O MySQL é uma implementação cliente/servidor que
179 consiste de um servidor chamado mysqld e diversos
180 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
181 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
182 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
183 pudesse lidar com grandes bases de dados e com uma velocidade muito
184 maior do que a que qualquer vendedor podia nos oferecer. Estamos
185 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
186 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
187 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
188 A base da construção do MySQL é uma série de rotinas que foram usadas
189 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
190 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
191 funções muito ricas e úteis. Veja a documentação para maiores
195 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
196 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
197 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
201 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
202 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
203 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
207 Summary: MySQL additional utilities
208 Summary(pl): Dodatkowe narzêdzia do MySQL
209 Group: Applications/Databases
210 Requires: %{name}-libs = %{version}-%{release}
213 MySQL additional utilities except Perl scripts (they may be found in
214 %{name}-extras-perl package).
216 %description extras -l pl
217 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
218 pakiecie %{name}-extras-perl).
221 Summary: MySQL additional utilities written in Perl
222 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
223 Group: Applications/Databases
224 Requires: %{name}-extras = %{version}-%{release}
225 Requires: perl(DBD::mysql)
227 %description extras-perl
228 MySQL additional utilities written in Perl.
230 %description extras-perl -l pl
231 Dodatkowe narzêdzia do MySQL napisane w Perlu.
234 Summary: MySQL - Client
235 Summary(pl): MySQL - Klient
236 Summary(pt): MySQL - Cliente
237 Summary(ru): MySQL ËÌÉÅÎÔ
238 Summary(uk): MySQL Ë̦¤ÎÔ
239 Group: Applications/Databases
240 Requires: %{name}-libs = %{version}-%{release}
241 Obsoletes: MySQL-client
244 This package contains the standard MySQL clients.
246 %description client -l fr
247 Ce package contient les clients MySQL standards.
249 %description client -l pl
250 Standardowe programy klienckie MySQL.
252 %description client -l pt_BR
253 Este pacote contém os clientes padrão para o MySQL.
255 %description client -l ru
256 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
258 %description client -l uk
259 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
262 Summary: Shared libraries for MySQL
263 Summary(pl): Biblioteki dzielone MySQL
264 Group: Applications/Databases
265 Obsoletes: libmysql10
266 Obsoletes: mysql-doc < 4.1.12
269 Shared libraries for MySQL.
271 %description libs -l pl
272 Biblioteki dzielone MySQL.
275 Summary: MySQL - Development header files and libraries
276 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
277 Summary(pt): MySQL - Medições de desempenho
278 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
279 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
280 Group: Development/Libraries
281 Requires: %{name}-libs = %{version}-%{release}
282 %{?with_ssl:Requires: openssl-devel}
284 Obsoletes: MySQL-devel
285 Obsoletes: libmysql10-devel
288 This package contains the development header files and libraries
289 necessary to develop MySQL client applications.
291 %description devel -l fr
292 Ce package contient les fichiers entetes et les librairies de
293 developpement necessaires pour developper des applications clientes
296 %description devel -l pl
297 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
300 %description devel -l pt_BR
301 Este pacote contém os arquivos de cabeçalho (header files) e
302 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
304 %description devel -l ru
305 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
306 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
308 %description devel -l uk
309 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
310 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
313 Summary: MySQL static libraries
314 Summary(pl): Biblioteki statyczne MySQL
315 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
316 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
317 Group: Development/Libraries
318 Requires: %{name}-devel = %{version}-%{release}
319 Obsoletes: MySQL-static
322 MySQL static libraries.
324 %description static -l pl
325 Biblioteki statyczne MySQL.
327 %description static -l ru
328 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
329 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
331 %description static -l uk
332 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
333 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
336 Summary: MySQL - Benchmarks
337 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
338 Summary(pt): MySQL - Medições de desempenho
339 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
340 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
341 Group: Applications/Databases
342 Requires: %{name} = %{version}-%{release}
343 Requires: %{name}-client
344 Requires: perl(DBD::mysql)
345 Obsoletes: MySQL-bench
348 This package contains MySQL benchmark scripts and data.
350 %description bench -l pl
351 Programy testuj±ce szybko¶æ serwera MySQL.
353 %description bench -l pt_BR
354 Este pacote contém medições de desempenho de scripts e dados do MySQL.
356 %description bench -l ru
357 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
360 %description bench -l uk
361 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
364 Summary: MySQL manual
365 Summary(pl): Podrêcznik u¿ytkownika MySQL
366 Group: Applications/Databases
369 This package contains manual in HTML format.
371 %description doc -l pl
372 Podrêcznik MySQL-a w formacie HTML.
375 Summary: MySQL - NDB Storage Engine Daemon
376 Summary(pl): MySQL - demon silnika przechowywania danych NDB
377 Group: Applications/Databases
378 Requires: %{name}-libs = %{version}-%{release}
381 This package contains the standard MySQL NDB Storage Engine Daemon.
383 %description ndb -l pl
384 Ten pakiet zawiera standardowego demona silnika przechowywania danych
388 Summary: MySQL - NDB Clients
389 Summary(pl): MySQL - programy klienckie NDB
390 Group: Applications/Databases
391 Requires: %{name}-libs = %{version}-%{release}
393 %description ndb-client
394 This package contains the standard MySQL NDB Clients.
396 %description ndb-client -l pl
397 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
400 Summary: MySQL - NDB Management Daemon
401 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
402 Group: Applications/Databases
403 Requires: %{name}-libs = %{version}-%{release}
406 This package contains the standard MySQL NDB Management Daemon.
408 %description ndb-mgm -l pl
409 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
412 Summary: MySQL - NDB CPC Daemon
413 Summary(pl): MySQL - demon NDB CPC
414 Group: Applications/Databases
415 Requires: %{name}-libs = %{version}-%{release}
418 This package contains the standard MySQL NDB CPC Daemon.
420 %description ndb-cpc -l pl
421 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
426 %{?with_tcpd:%patch1 -p1}
430 # this is strange: mysqld functions for UDF modules are not explicitly defined,
431 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
432 # in objects compiled without -fPIC
440 %{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
447 # The compiler flags are as per their "official" spec ;)
448 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
449 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
451 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
452 # and therefore do not add BR on these. These are here just to satisfy
456 FIND_PROC='/bin/ps p $$PID' \
458 CHECK_PID='/bin/kill -0 $$PID' \
462 --enable-thread-safe-client \
463 --with%{!?with_bdb:out}-berkeley-db \
464 --with%{!?with_innodb:out}-innodb \
465 --with%{!?with_isam:out}-isam \
466 --with%{!?with_raid:out}-raid \
467 --with%{!?with_ssl:out}-openssl \
468 --with%{!?with_tcpd:out}-libwrap \
469 %{?with_big_tables:--with-big-tables} \
470 --with-comment="PLD Linux Distribution MySQL RPM" \
471 --with%{!?debug:out}-debug \
472 --with-embedded-server \
473 --with-extra-charsets=all \
475 --with-mysqld-user=mysql \
476 --with-named-curses-libs="-lncurses" \
477 --with-named-thread-libs="-lpthread" \
478 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
479 --with-archive-storage-engine \
486 # --with-ndb-test --with-ndb-docs
488 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
489 # (it defaults to first cluster but user may change it to whatever
492 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
495 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
497 %{__make} -C Docs mysql.info
500 rm -rf $RPM_BUILD_ROOT
501 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql,monit} \
502 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
503 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
506 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
511 DESTDIR=$RPM_BUILD_ROOT \
512 benchdir=%{_datadir}/sql-bench \
514 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
516 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
518 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
519 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
520 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
521 # This is template for configuration file which is created after 'service mysql init'
522 install %{SOURCE4} mysqld.conf
523 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
524 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/monit
525 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
527 # remove innodb directives from mysqld.conf if mysqld is configured without
528 %if %{without innodb}
529 cp mysqld.conf mysqld.tmp
530 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
533 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
535 cp mysqld.conf mysqld.tmp
536 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
539 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
540 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
543 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
544 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
545 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
546 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
547 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
548 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
550 # remove .txt variants for .sys messages
551 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
553 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
554 %{__perl} -pi -e 's,%{_libdir}/mysql,%{_libdir},;' $RPM_BUILD_ROOT%{_libdir}/libmysqlclient.la
556 # remove known unpackaged files
557 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
559 # rename not to be so generic name
560 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
561 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
563 # functionality in initscript / rpm
564 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
565 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
566 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
567 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
568 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
569 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/fill_help_tables.sql
570 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
571 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
572 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
573 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
574 rm $RPM_BUILD_ROOT%{_mandir}/man1/{mysql.server,safe_mysqld}*
577 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
580 rm -rf $RPM_BUILD_ROOT
583 %groupadd -g 89 mysql
584 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
587 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
588 /sbin/chkconfig --add mysql
590 if [ "$1" = 1 ]; then
591 %banner -e %{name}-4.1.x <<-EOF
592 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
593 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
598 %service mysql restart || :
601 if [ "$1" = "0" ]; then
602 %service -q mysql stop
603 /sbin/chkconfig --del mysql
607 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
608 if [ "$1" = "0" ]; then
614 /sbin/chkconfig --add mysql-ndb
615 if [ -f /var/lock/subsys/mysql-ndb ]; then
616 /etc/rc.d/init.d/mysql-ndb restart >&2
618 echo "Run \"/etc/rc.d/init.d/mysql-ndb start\" to start mysql NDB engine." >&2
622 if [ "$1" = "0" ]; then
623 if [ -f /var/lock/subsys/mysql-ndb ]; then
624 /etc/rc.d/init.d/mysql-ndb stop
626 /sbin/chkconfig --del mysql-ndb
630 /sbin/chkconfig --add mysql-ndb-mgm
631 if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
632 /etc/rc.d/init.d/mysql-ndb-mgm restart >&2
634 echo "Run \"/etc/rc.d/init.d/mysql-ndb-mgm start\" to start mysql NDB management node." >&2
638 if [ "$1" = "0" ]; then
639 if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
640 /etc/rc.d/init.d/mysql-ndb-mgm stop
642 /sbin/chkconfig --del mysql-ndb-mgm
646 /sbin/chkconfig --add mysql-ndb-cpc
647 if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
648 /etc/rc.d/init.d/mysql-ndb-cpc restart >&2
650 echo "Run \"/etc/rc.d/init.d/mysql-ndb-cpc start\" to start mysql NDB CPC." >&2
654 if [ "$1" = "0" ]; then
655 if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
656 /etc/rc.d/init.d/mysql-ndb-cpc stop
658 /sbin/chkconfig --del mysql-ndb-cpc
661 %post libs -p /sbin/ldconfig
662 %postun libs -p /sbin/ldconfig
664 %triggerpostun -- mysql <= 4.0.20-2
665 # For clusters in /etc/mysql/clusters.conf
666 if [ -f "/etc/sysconfig/mysql" ]; then
667 . /etc/sysconfig/mysql
668 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
669 for i in "$MYSQL_DB_CLUSTERS"; do
670 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
672 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
673 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
674 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
675 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
679 %triggerpostun -- mysql <= 4.1.1
680 # For better compatibility with prevoius versions:
681 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
682 if echo "$config" | grep -q '^/'; then
683 config_file="$config"
684 elif [ -f "/etc/mysql/$config" ]; then
685 config_file=/etc/mysql/$config
687 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
688 if [ -z "$clusterdir" ]; then
689 echo >&2 "Can't find cluster dir for $config!"
690 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
693 config_file="$clusterdir/mysqld.conf"
696 if [ ! -f "$config_file" ]; then
697 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
700 echo "Adding option old-passwords to config: $config_file"
701 echo "If you want to use new, better passwords - remove it"
703 # sed magic to add 'old-passwords' to [mysqld] section
704 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
706 a; Compatibility options:
712 %banner -e %{name}-4.1.x <<-EOF
713 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
714 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
719 %defattr(644,root,root,755)
720 %doc support-files/*.cnf support-files/*.ini scripts/fill_help_tables.sql
721 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
722 %attr(754,root,root) /etc/rc.d/init.d/mysql
723 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
724 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
725 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
726 %attr(755,root,root) %{_bindir}/isamchk
727 %attr(755,root,root) %{_bindir}/isamlog
728 %attr(755,root,root) %{_bindir}/myisamchk
729 %attr(755,root,root) %{_bindir}/myisamlog
730 %attr(755,root,root) %{_bindir}/myisampack
731 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
732 %attr(755,root,root) %{_bindir}/pack_isam
733 %attr(755,root,root) %{_bindir}/my_print_defaults
734 %attr(755,root,root) %{_sbindir}/mysqld
735 %{_mandir}/man1/isamchk.1*
736 %{_mandir}/man1/isamlog.1*
737 %{_mandir}/man1/mysql_fix_privilege_tables.1*
738 %{_mandir}/man1/mysqld.1*
739 %{_mandir}/man1/myisamchk.1*
740 %{_mandir}/man1/myisamlog.1*
741 %{_mandir}/man1/myisampack.1*
742 %{_mandir}/man1/pack_isam.1*
743 %{_mandir}/man8/mysqld.8*
745 %attr(700,mysql,mysql) %{_mysqlhome}
746 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
747 %attr(751,root,root) /var/lib/mysql
748 %attr(750,mysql,mysql) %dir /var/log/mysql
749 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
750 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
752 %{_infodir}/mysql.info*
753 %dir %{_datadir}/mysql
754 # This is template for configuration file which is created after 'service mysql init'
755 %{_datadir}/mysql/mysqld.conf
756 %{_datadir}/mysql/charsets
757 %{_datadir}/mysql/english
758 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
759 %lang(cs) %{_datadir}/mysql/czech
760 %lang(da) %{_datadir}/mysql/danish
761 %lang(de) %{_datadir}/mysql/german
762 %lang(el) %{_datadir}/mysql/greek
763 %lang(es) %{_datadir}/mysql/spanish
764 %lang(et) %{_datadir}/mysql/estonian
765 %lang(fr) %{_datadir}/mysql/french
766 %lang(hu) %{_datadir}/mysql/hungarian
767 %lang(it) %{_datadir}/mysql/italian
768 %lang(ja) %{_datadir}/mysql/japanese
769 %lang(ja) %{_datadir}/mysql/japanese-sjis
770 %lang(ko) %{_datadir}/mysql/korean
771 %lang(nl) %{_datadir}/mysql/dutch
772 %lang(nb) %{_datadir}/mysql/norwegian
773 %lang(nn) %{_datadir}/mysql/norwegian-ny
774 %lang(pl) %{_datadir}/mysql/polish
775 %lang(pt) %{_datadir}/mysql/portuguese
776 %lang(ro) %{_datadir}/mysql/romanian
777 %lang(ru) %{_datadir}/mysql/russian
778 %lang(sr) %{_datadir}/mysql/serbian
779 %lang(sk) %{_datadir}/mysql/slovak
780 %lang(sv) %{_datadir}/mysql/swedish
781 %lang(uk) %{_datadir}/mysql/ukrainian
784 %defattr(644,root,root,755)
785 %attr(755,root,root) %{_bindir}/msql2mysql
786 %attr(755,root,root) %{_bindir}/perror
787 %attr(755,root,root) %{_bindir}/replace
788 %attr(755,root,root) %{_bindir}/resolveip
789 %attr(755,root,root) %{_bindir}/myisam_ftdump
790 %attr(755,root,root) %{_bindir}/mysql_secure_installation
791 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
792 %attr(755,root,root) %{_bindir}/mysqlcheck
793 %{_mandir}/man1/perror.1*
794 %{_mandir}/man1/replace.1*
795 %{_mandir}/man1/msql2mysql*
796 %{_mandir}/man1/myisam_ftdump.1*
797 %{_mandir}/man1/mysqlcheck.1*
800 %defattr(644,root,root,755)
801 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
802 %attr(755,root,root) %{_bindir}/mysqldumpslow
803 %attr(755,root,root) %{_bindir}/mysqlhotcopy
804 %attr(755,root,root) %{_bindir}/mysql_setpermission
805 %attr(755,root,root) %{_bindir}/mysql_zap
806 %attr(755,root,root) %{_bindir}/mysql_find_rows
807 %attr(755,root,root) %{_bindir}/mysqlaccess
808 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
809 %attr(755,root,root) %{_bindir}/mysql_explain_log
810 %attr(755,root,root) %{_bindir}/mysql_tableinfo
811 %{_mandir}/man1/mysql_zap.1*
812 %{_mandir}/man1/mysqlaccess.1*
813 %{_mandir}/man1/mysqlhotcopy.1*
814 %{_mandir}/man1/mysql_explain_log.1*
817 %defattr(644,root,root,755)
818 %attr(755,root,root) %{_bindir}/mysql
819 %attr(755,root,root) %{_bindir}/mysqlbug
820 %attr(755,root,root) %{_bindir}/mysqldump
821 %attr(755,root,root) %{_bindir}/mysqlimport
822 %attr(755,root,root) %{_bindir}/mysqlmanager*
823 %attr(755,root,root) %{_bindir}/mysqlshow
824 %attr(755,root,root) %{_bindir}/mysqlbinlog
825 %attr(755,root,root) %{_bindir}/mysqladmin
826 %{_mandir}/man1/mysql.1*
827 %{_mandir}/man1/mysqlman.1*
828 %{_mandir}/man1/mysqladmin.1*
829 %{_mandir}/man1/mysqldump.1*
830 %{_mandir}/man1/mysqlshow.1*
831 %{_mandir}/man1/mysqlbinlog.1*
832 %{_mandir}/man1/mysqlimport.1*
835 %defattr(644,root,root,755)
836 %doc EXCEPTIONS-CLIENT
837 %attr(755,root,root) %{_libdir}/lib*.so.*.*
838 %attr(751,root,root) %dir %{_sysconfdir}/mysql
839 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
842 %defattr(644,root,root,755)
843 %attr(755,root,root) %{_bindir}/mysql_config
844 %attr(755,root,root) %{_libdir}/lib*.so
845 %attr(755,root,root) %{_bindir}/*comp_err
846 %attr(755,root,root) %{_bindir}/*resolve_stack_dump
848 %{_libdir}/lib*[!tr].a
850 %{_mandir}/man1/mysql_config.1*
853 %defattr(644,root,root,755)
854 %{_libdir}/lib*[tr].a
857 %defattr(644,root,root,755)
858 %attr(755,root,root) %{_bindir}/mysqltest
859 %attr(755,root,root) %{_bindir}/mysql_client_test
860 %dir %{_datadir}/sql-bench
861 %{_datadir}/sql-bench/[CDRl]*
862 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
864 %{_datadir}/mysql/mi_test_all.res
865 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
868 #%defattr(644,root,root,755)
869 #%doc Docs/manual.html Docs/manual_toc.html
872 %defattr(644,root,root,755)
873 %attr(755,root,root) %{_sbindir}/ndbd
874 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
875 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
878 %defattr(644,root,root,755)
879 %attr(755,root,root) %{_bindir}/ndb_*
880 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
883 %defattr(644,root,root,755)
884 %attr(755,root,root) %{_sbindir}/ndb_mgmd
885 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
886 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
889 %defattr(644,root,root,755)
890 %attr(755,root,root) %{_sbindir}/ndb_cpcd
891 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
892 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc