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'
8 %bcond_with bdb # Berkeley DB support
9 %bcond_without innodb # Without InnoDB support
10 %bcond_without isam # Without ISAM table format (used in mysql 3.22)
11 %bcond_without raid # Without raid
12 %bcond_without ssl # Without OpenSSL
13 %bcond_without tcpd # Without libwrap (tcp_wrappers) support
14 %bcond_with big_tables # enable '--with-big-tables', some performance loss on 32bit arch, but can do >= 4GB database tables.
16 %include /usr/lib/rpm/macros.perl
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: http://mysql.dataphone.se/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
31 # Source0-md5: a1dc5375f6580db5073d542200a9ad5b
33 Source2: %{name}.sysconfig
34 Source3: %{name}.logrotate
35 Source4: %{name}d.conf
36 Source5: %{name}-clusters.conf
37 Source6: %{name}.monitrc
38 Source7: %{name}-ndb.init
39 Source8: %{name}-ndb.sysconfig
40 Source9: %{name}-ndb-mgm.init
41 Source10: %{name}-ndb-mgm.sysconfig
42 Source11: %{name}-ndb-cpc.init
43 Source12: %{name}-ndb-cpc.sysconfig
44 Source13: %{name}-client.conf
45 Patch0: %{name}-libs.patch
46 Patch1: %{name}-libwrap.patch
47 Patch2: %{name}-c++.patch
48 Patch3: %{name}-info.patch
49 Patch4: %{name}-sql-cxx-pic.patch
50 Patch5: %{name}-noproc.patch
51 Patch6: %{name}-fix_privilege_tables.patch
52 Patch7: %{name}-align.patch
53 Patch8: %{name}-client-config.patch
54 URL: http://www.mysql.com/
55 #BuildRequires: ORBit-devel
56 BuildRequires: autoconf
57 BuildRequires: automake
58 %{?with_bdb:BuildRequires: db3-devel}
59 BuildRequires: libstdc++-devel >= 5:3.0
60 BuildRequires: libtool
61 %{?with_tcpd:BuildRequires: libwrap-devel}
62 BuildRequires: ncurses-devel >= 4.2
63 %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
64 BuildRequires: perl-DBI
65 BuildRequires: perl-devel >= 1:5.6.1
66 BuildRequires: readline-devel >= 4.2
67 BuildRequires: rpm-perlprov >= 4.1-13
68 BuildRequires: rpmbuild(macros) >= 1.228
69 BuildRequires: texinfo
70 BuildRequires: zlib-devel
71 Requires(post,preun): /sbin/chkconfig
72 Requires(postun): /usr/sbin/groupdel
73 Requires(postun): /usr/sbin/userdel
74 Requires(pre): /bin/id
75 Requires(pre): /usr/bin/getgid
76 Requires(pre): /usr/sbin/groupadd
77 Requires(pre): /usr/sbin/useradd
78 Requires(triggerpostun): sed >= 4.0
79 Requires: /usr/bin/setsid
80 Requires: rc-scripts >= 0.2.0
81 Provides: MySQL-server
82 Provides: group(mysql)
86 Obsoletes: mysql-server
87 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89 %define _libexecdir %{_sbindir}
90 %define _localstatedir /var/lib/mysql
91 %define _mysqlhome /home/services/mysql
93 %define _noautoreqdep 'perl(DBD::mysql)'
95 # innodb confcache has different CFLAGS
96 %undefine configure_cache
99 MySQL is a true multi-user, multi-threaded SQL (Structured Query
100 Language) database server. SQL is the most popular database language
101 in the world. MySQL is a client/server implementation that consists of
102 a server daemon mysqld and many different client programs/libraries.
104 The main goals of MySQL are speed, robustness and easy to use. MySQL
105 was originally developed because we at Tcx needed a SQL server that
106 could handle very big databases with magnitude higher speed than what
107 any database vendor could offer to us. We have now been using MySQL
108 since 1996 in a environment with more than 40 databases, 10,000
109 tables, of which more than 500 have more than 7 million rows. This is
110 about 50G of mission critical data.
112 The base upon which MySQL is built is a set of routines that have been
113 used in a highly demanding production environment for many years.
114 While MySQL is still in development, it already offers a rich and
115 highly useful function set.
118 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
119 multi-taches. Le langage SQL est le langage de bases de donnees le
120 plus populaire au monde. MySQL est une implementation client/serveur
121 qui consiste en un serveur (mysqld) et differents
122 programmes/bibliotheques clientes.
124 Les objectifs principaux de MySQL sont: vitesse, robustesse et
125 facilite d'utilisation. MySQL fut originalement developpe parce que
126 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
127 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
128 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
129 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
130 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
131 millions de lignes. Ceci represente environ 50G de donnees critiques.
133 A la base de la conception de MySQL, on retrouve une serie de routines
134 qui ont ete utilisees dans un environnement de production pendant
135 plusieurs annees. Meme si MySQL est encore en developpement, il offre
136 deja une riche et utile serie de fonctions.
139 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
140 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
141 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
142 mysqld i wielu ró¿nych programów i bibliotek klienckich.
144 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
145 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
146 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
147 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
148 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
149 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
150 50GB krytycznych danych.
152 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
153 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
154 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
155 i u¿yteczny zbiór funkcji.
158 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
159 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
160 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
161 einem Primärschlüssel versehen werden. Es ist aber keine Definition
162 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
163 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
164 Daten verantwortlich. Allein durch die Nutzung externer
165 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
166 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
168 %description -l pt_BR
169 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
170 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
171 dados no mundo. O MySQL é uma implementação cliente/servidor que
172 consiste de um servidor chamado mysqld e diversos
173 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
174 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
175 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
176 pudesse lidar com grandes bases de dados e com uma velocidade muito
177 maior do que a que qualquer vendedor podia nos oferecer. Estamos
178 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
179 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
180 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
181 A base da construção do MySQL é uma série de rotinas que foram usadas
182 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
183 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
184 funções muito ricas e úteis. Veja a documentação para maiores
188 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
189 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
190 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
194 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
195 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
196 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉË¦× ÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
200 Summary: MySQL additional utilities
201 Summary(pl): Dodatkowe narzêdzia do MySQL
202 Group: Applications/Databases
203 Requires: %{name}-libs = %{version}-%{release}
206 MySQL additional utilities except Perl scripts (they may be found in
207 %{name}-extras-perl package).
209 %description extras -l pl
210 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
211 pakiecie %{name}-extras-perl).
214 Summary: MySQL additional utilities written in Perl
215 Summary(pl): Dodatkowe narzêdzia do MySQL napisane w Perlu
216 Group: Applications/Databases
217 Requires: %{name}-extras = %{version}-%{release}
218 Requires: perl(DBD::mysql)
220 %description extras-perl
221 MySQL additional utilities written in Perl.
223 %description extras-perl -l pl
224 Dodatkowe narzêdzia do MySQL napisane w Perlu.
227 Summary: MySQL - Client
228 Summary(pl): MySQL - Klient
229 Summary(pt): MySQL - Cliente
230 Summary(ru): MySQL ËÌÉÅÎÔ
231 Summary(uk): MySQL Ë̦¤ÎÔ
232 Group: Applications/Databases
233 Requires: %{name}-libs = %{version}-%{release}
234 Obsoletes: MySQL-client
237 This package contains the standard MySQL clients.
239 %description client -l fr
240 Ce package contient les clients MySQL standards.
242 %description client -l pl
243 Standardowe programy klienckie MySQL.
245 %description client -l pt_BR
246 Este pacote contém os clientes padrão para o MySQL.
248 %description client -l ru
249 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
251 %description client -l uk
252 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
255 Summary: Shared libraries for MySQL
256 Summary(pl): Biblioteki dzielone MySQL
257 Group: Applications/Databases
258 Obsoletes: libmysql10
259 Obsoletes: mysql-doc < 4.1.12
262 Shared libraries for MySQL.
264 %description libs -l pl
265 Biblioteki dzielone MySQL.
268 Summary: MySQL - Development header files and libraries
269 Summary(pl): MySQL - Pliki nag³ówkowe i biblioteki dla programistów
270 Summary(pt): MySQL - Medições de desempenho
271 Summary(ru): MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
272 Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
273 Group: Development/Libraries
274 Requires: %{name}-libs = %{version}-%{release}
275 %{?with_ssl:Requires: openssl-devel}
277 Obsoletes: MySQL-devel
278 Obsoletes: libmysql10-devel
281 This package contains the development header files and libraries
282 necessary to develop MySQL client applications.
284 %description devel -l fr
285 Ce package contient les fichiers entetes et les librairies de
286 developpement necessaires pour developper des applications clientes
289 %description devel -l pl
290 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
293 %description devel -l pt_BR
294 Este pacote contém os arquivos de cabeçalho (header files) e
295 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
297 %description devel -l ru
298 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
299 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
301 %description devel -l uk
302 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
303 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
306 Summary: MySQL static libraries
307 Summary(pl): Biblioteki statyczne MySQL
308 Summary(ru): MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
309 Summary(uk): MySQL - ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ
310 Group: Development/Libraries
311 Requires: %{name}-devel = %{version}-%{release}
312 Obsoletes: MySQL-static
315 MySQL static libraries.
317 %description static -l pl
318 Biblioteki statyczne MySQL.
320 %description static -l ru
321 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
322 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
324 %description static -l uk
325 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
326 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
329 Summary: MySQL - Benchmarks
330 Summary(pl): MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
331 Summary(pt): MySQL - Medições de desempenho
332 Summary(ru): MySQL - ÂÅÎÞÍÁÒËÉ
333 Summary(uk): MySQL - ÂÅÎÞÍÁÒËÉ
334 Group: Applications/Databases
335 Requires: %{name} = %{version}-%{release}
336 Requires: %{name}-client
337 Requires: perl(DBD::mysql)
338 Obsoletes: MySQL-bench
341 This package contains MySQL benchmark scripts and data.
343 %description bench -l pl
344 Programy testuj±ce szybko¶æ serwera MySQL.
346 %description bench -l pt_BR
347 Este pacote contém medições de desempenho de scripts e dados do MySQL.
349 %description bench -l ru
350 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
353 %description bench -l uk
354 ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
357 Summary: MySQL manual
358 Summary(pl): Podrêcznik u¿ytkownika MySQL
359 Group: Applications/Databases
362 This package contains manual in HTML format.
364 %description doc -l pl
365 Podrêcznik MySQL-a w formacie HTML.
368 Summary: MySQL - NDB Storage Engine Daemon
369 Summary(pl): MySQL - demon silnika przechowywania danych NDB
370 Group: Applications/Databases
371 Requires: %{name}-libs = %{version}-%{release}
374 This package contains the standard MySQL NDB Storage Engine Daemon.
376 %description ndb -l pl
377 Ten pakiet zawiera standardowego demona silnika przechowywania danych
381 Summary: MySQL - NDB Clients
382 Summary(pl): MySQL - programy klienckie NDB
383 Group: Applications/Databases
384 Requires: %{name}-libs = %{version}-%{release}
386 %description ndb-client
387 This package contains the standard MySQL NDB Clients.
389 %description ndb-client -l pl
390 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
393 Summary: MySQL - NDB Management Daemon
394 Summary(pl): MySQL - demon zarz±dzaj±cy NDB
395 Group: Applications/Databases
396 Requires: %{name}-libs = %{version}-%{release}
399 This package contains the standard MySQL NDB Management Daemon.
401 %description ndb-mgm -l pl
402 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
405 Summary: MySQL - NDB CPC Daemon
406 Summary(pl): MySQL - demon NDB CPC
407 Group: Applications/Databases
408 Requires: %{name}-libs = %{version}-%{release}
411 This package contains the standard MySQL NDB CPC Daemon.
413 %description ndb-cpc -l pl
414 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
419 %{?with_tcpd:%patch1 -p1}
423 # this is strange: mysqld functions for UDF modules are not explicitly defined,
424 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
425 # in objects compiled without -fPIC
433 %{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
440 # The compiler flags are as per their "official" spec ;)
441 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
442 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
444 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
445 # and therefore do not add BR on these. These are here just to satisfy
449 FIND_PROC='/bin/ps p $$PID' \
451 CHECK_PID='/bin/kill -0 $$PID' \
455 --enable-thread-safe-client \
456 --with%{!?with_bdb:out}-berkeley-db \
457 --with%{!?with_innodb:out}-innodb \
458 --with%{!?with_isam:out}-isam \
459 --with%{!?with_raid:out}-raid \
460 --with%{!?with_ssl:out}-openssl \
461 --with%{!?with_tcpd:out}-libwrap \
462 %{?with_big_tables:--with-big-tables} \
463 --with-comment="PLD Linux Distribution MySQL RPM" \
464 --with%{!?debug:out}-debug \
465 --with-embedded-server \
466 --with-extra-charsets=all \
468 --with-mysqld-user=mysql \
469 --with-named-curses-libs="-lncurses" \
470 --with-named-thread-libs="-lpthread" \
471 --with-unix-socket-path=/var/lib/mysql/mysql.sock \
472 --with-archive-storage-engine \
479 # --with-ndb-test --with-ndb-docs
481 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
482 # (it defaults to first cluster but user may change it to whatever
485 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
488 benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
490 %{__make} -C Docs mysql.info
493 rm -rf $RPM_BUILD_ROOT
494 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql,monit} \
495 $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
496 $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
499 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
504 DESTDIR=$RPM_BUILD_ROOT \
505 benchdir=%{_datadir}/sql-bench \
507 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
509 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
511 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
512 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
513 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
514 # This is template for configuration file which is created after 'service mysql init'
515 install %{SOURCE4} mysqld.conf
516 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
517 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/monit
518 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
520 # remove innodb directives from mysqld.conf if mysqld is configured without
521 %if %{without innodb}
522 cp mysqld.conf mysqld.tmp
523 awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
526 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
528 cp mysqld.conf mysqld.tmp
529 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
532 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
533 install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
536 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
537 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
538 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
539 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
540 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
541 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
543 # remove .txt variants for .sys messages
544 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
546 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
547 %{__perl} -pi -e 's,%{_libdir}/mysql,%{_libdir},;' $RPM_BUILD_ROOT%{_libdir}/libmysqlclient.la
549 # remove known unpackaged files
550 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
552 # rename not to be so generic name
553 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
554 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
556 # functionality in initscript / rpm
557 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
558 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
559 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
560 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
561 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
562 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/fill_help_tables.sql
563 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
564 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
565 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
566 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
567 rm $RPM_BUILD_ROOT%{_mandir}/man1/{mysql.server,safe_mysqld}*
570 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
573 rm -rf $RPM_BUILD_ROOT
576 %groupadd -g 89 mysql
577 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
580 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
581 /sbin/chkconfig --add mysql
583 if [ "$1" = 1 ]; then
584 %banner -e %{name}-4.1.x <<-EOF
585 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
586 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
591 %service mysql restart || :
594 if [ "$1" = "0" ]; then
595 %service -q mysql stop
596 /sbin/chkconfig --del mysql
600 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
601 if [ "$1" = "0" ]; then
607 /sbin/chkconfig --add mysql-ndb
608 if [ -f /var/lock/subsys/mysql-ndb ]; then
609 /etc/rc.d/init.d/mysql-ndb restart >&2
611 echo "Run \"/etc/rc.d/init.d/mysql-ndb start\" to start mysql NDB engine." >&2
615 if [ "$1" = "0" ]; then
616 if [ -f /var/lock/subsys/mysql-ndb ]; then
617 /etc/rc.d/init.d/mysql-ndb stop
619 /sbin/chkconfig --del mysql-ndb
623 /sbin/chkconfig --add mysql-ndb-mgm
624 if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
625 /etc/rc.d/init.d/mysql-ndb-mgm restart >&2
627 echo "Run \"/etc/rc.d/init.d/mysql-ndb-mgm start\" to start mysql NDB management node." >&2
631 if [ "$1" = "0" ]; then
632 if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
633 /etc/rc.d/init.d/mysql-ndb-mgm stop
635 /sbin/chkconfig --del mysql-ndb-mgm
639 /sbin/chkconfig --add mysql-ndb-cpc
640 if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
641 /etc/rc.d/init.d/mysql-ndb-cpc restart >&2
643 echo "Run \"/etc/rc.d/init.d/mysql-ndb-cpc start\" to start mysql NDB CPC." >&2
647 if [ "$1" = "0" ]; then
648 if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
649 /etc/rc.d/init.d/mysql-ndb-cpc stop
651 /sbin/chkconfig --del mysql-ndb-cpc
654 %post libs -p /sbin/ldconfig
655 %postun libs -p /sbin/ldconfig
657 %triggerpostun -- mysql <= 4.0.20-2
658 # For clusters in /etc/mysql/clusters.conf
659 if [ -f "/etc/sysconfig/mysql" ]; then
660 . /etc/sysconfig/mysql
661 if [ -n "$MYSQL_DB_CLUSTERS" ]; then
662 for i in "$MYSQL_DB_CLUSTERS"; do
663 echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
665 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
666 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
667 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
668 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
672 %triggerpostun -- mysql <= 4.1.1
673 # For better compatibility with prevoius versions:
674 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
675 if echo "$config" | grep -q '^/'; then
676 config_file="$config"
677 elif [ -f "/etc/mysql/$config" ]; then
678 config_file=/etc/mysql/$config
680 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
681 if [ -z "$clusterdir" ]; then
682 echo >&2 "Can't find cluster dir for $config!"
683 echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
686 config_file="$clusterdir/mysqld.conf"
689 if [ ! -f "$config_file" ]; then
690 echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
693 echo "Adding option old-passwords to config: $config_file"
694 echo "If you want to use new, better passwords - remove it"
696 # sed magic to add 'old-passwords' to [mysqld] section
697 sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
699 a; Compatibility options:
705 %banner -e %{name}-4.1.x <<-EOF
706 If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
707 zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
712 %defattr(644,root,root,755)
713 %doc support-files/*.cnf support-files/*.ini scripts/fill_help_tables.sql
714 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
715 %attr(754,root,root) /etc/rc.d/init.d/mysql
716 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
717 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
718 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
719 %attr(755,root,root) %{_bindir}/isamchk
720 %attr(755,root,root) %{_bindir}/isamlog
721 %attr(755,root,root) %{_bindir}/myisamchk
722 %attr(755,root,root) %{_bindir}/myisamlog
723 %attr(755,root,root) %{_bindir}/myisampack
724 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
725 %attr(755,root,root) %{_bindir}/pack_isam
726 %attr(755,root,root) %{_bindir}/my_print_defaults
727 %attr(755,root,root) %{_sbindir}/mysqld
728 %{_mandir}/man1/isamchk.1*
729 %{_mandir}/man1/isamlog.1*
730 %{_mandir}/man1/mysql_fix_privilege_tables.1*
731 %{_mandir}/man1/mysqld.1*
732 %{_mandir}/man1/myisamchk.1*
733 %{_mandir}/man1/myisamlog.1*
734 %{_mandir}/man1/myisampack.1*
735 %{_mandir}/man1/pack_isam.1*
737 %attr(700,mysql,mysql) %{_mysqlhome}
738 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
739 %attr(751,root,root) /var/lib/mysql
740 %attr(750,mysql,mysql) %dir /var/log/mysql
741 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
742 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
744 %{_infodir}/mysql.info*
745 %dir %{_datadir}/mysql
746 # This is template for configuration file which is created after 'service mysql init'
747 %{_datadir}/mysql/mysqld.conf
748 %{_datadir}/mysql/charsets
749 %{_datadir}/mysql/english
750 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
751 %lang(cs) %{_datadir}/mysql/czech
752 %lang(da) %{_datadir}/mysql/danish
753 %lang(de) %{_datadir}/mysql/german
754 %lang(el) %{_datadir}/mysql/greek
755 %lang(es) %{_datadir}/mysql/spanish
756 %lang(et) %{_datadir}/mysql/estonian
757 %lang(fr) %{_datadir}/mysql/french
758 %lang(hu) %{_datadir}/mysql/hungarian
759 %lang(it) %{_datadir}/mysql/italian
760 %lang(ja) %{_datadir}/mysql/japanese
761 %lang(ja) %{_datadir}/mysql/japanese-sjis
762 %lang(ko) %{_datadir}/mysql/korean
763 %lang(nl) %{_datadir}/mysql/dutch
764 %lang(nb) %{_datadir}/mysql/norwegian
765 %lang(nn) %{_datadir}/mysql/norwegian-ny
766 %lang(pl) %{_datadir}/mysql/polish
767 %lang(pt) %{_datadir}/mysql/portuguese
768 %lang(ro) %{_datadir}/mysql/romanian
769 %lang(ru) %{_datadir}/mysql/russian
770 %lang(sr) %{_datadir}/mysql/serbian
771 %lang(sk) %{_datadir}/mysql/slovak
772 %lang(sv) %{_datadir}/mysql/swedish
773 %lang(uk) %{_datadir}/mysql/ukrainian
776 %defattr(644,root,root,755)
777 %attr(755,root,root) %{_bindir}/msql2mysql
778 %attr(755,root,root) %{_bindir}/perror
779 %attr(755,root,root) %{_bindir}/replace
780 %attr(755,root,root) %{_bindir}/resolveip
781 %attr(755,root,root) %{_bindir}/myisam_ftdump
782 %attr(755,root,root) %{_bindir}/mysql_secure_installation
783 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
784 %attr(755,root,root) %{_bindir}/mysqlcheck
785 %{_mandir}/man1/perror.1*
786 %{_mandir}/man1/replace.1*
787 %{_mandir}/man1/msql2mysql*
788 %{_mandir}/man1/myisam_ftdump.1*
789 %{_mandir}/man1/mysqlcheck.1*
792 %defattr(644,root,root,755)
793 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
794 %attr(755,root,root) %{_bindir}/mysqldumpslow
795 %attr(755,root,root) %{_bindir}/mysqlhotcopy
796 %attr(755,root,root) %{_bindir}/mysql_setpermission
797 %attr(755,root,root) %{_bindir}/mysql_zap
798 %attr(755,root,root) %{_bindir}/mysql_find_rows
799 %attr(755,root,root) %{_bindir}/mysqlaccess
800 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
801 %attr(755,root,root) %{_bindir}/mysql_explain_log
802 %attr(755,root,root) %{_bindir}/mysql_tableinfo
803 %{_mandir}/man1/mysql_zap.1*
804 %{_mandir}/man1/mysqlaccess.1*
805 %{_mandir}/man1/mysqlhotcopy.1*
808 %defattr(644,root,root,755)
809 %attr(755,root,root) %{_bindir}/mysql
810 %attr(755,root,root) %{_bindir}/mysqlbug
811 %attr(755,root,root) %{_bindir}/mysqldump
812 %attr(755,root,root) %{_bindir}/mysqlimport
813 %attr(755,root,root) %{_bindir}/mysqlmanager*
814 %attr(755,root,root) %{_bindir}/mysqlshow
815 %attr(755,root,root) %{_bindir}/mysqlbinlog
816 %attr(755,root,root) %{_bindir}/mysqladmin
817 %{_mandir}/man1/mysql.1*
818 %{_mandir}/man1/mysqladmin.1*
819 %{_mandir}/man1/mysqldump.1*
820 %{_mandir}/man1/mysqlshow.1*
821 %{_mandir}/man1/mysqlbinlog.1*
822 %{_mandir}/man1/mysqlimport.1*
825 %defattr(644,root,root,755)
826 %doc EXCEPTIONS-CLIENT
827 %attr(755,root,root) %{_libdir}/lib*.so.*.*
828 %attr(751,root,root) %dir %{_sysconfdir}/mysql
829 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
832 %defattr(644,root,root,755)
833 %attr(755,root,root) %{_bindir}/mysql_config
834 %attr(755,root,root) %{_libdir}/lib*.so
835 %attr(755,root,root) %{_bindir}/*comp_err
836 %attr(755,root,root) %{_bindir}/*resolve_stack_dump
838 %{_libdir}/lib*[!tr].a
840 %{_mandir}/man1/mysql_config.1*
843 %defattr(644,root,root,755)
844 %{_libdir}/lib*[tr].a
847 %defattr(644,root,root,755)
848 %attr(755,root,root) %{_bindir}/mysqltest
849 %attr(755,root,root) %{_bindir}/mysql_client_test
850 %dir %{_datadir}/sql-bench
851 %{_datadir}/sql-bench/[CDRl]*
852 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
854 %{_datadir}/mysql/mi_test_all.res
855 %attr(755,root,root) %{_datadir}/mysql/mi_test_all
858 #%defattr(644,root,root,755)
859 #%doc Docs/manual.html Docs/manual_toc.html
862 %defattr(644,root,root,755)
863 %attr(755,root,root) %{_sbindir}/ndbd
864 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
865 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
868 %defattr(644,root,root,755)
869 %attr(755,root,root) %{_bindir}/ndb_*
870 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
873 %defattr(644,root,root,755)
874 %attr(755,root,root) %{_sbindir}/ndb_mgmd
875 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
876 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
879 %defattr(644,root,root,755)
880 %attr(755,root,root) %{_sbindir}/ndb_cpcd
881 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
882 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc