]> git.pld-linux.org Git - packages/mysql.git/blob - mysql.spec
- added fix for bug #24747 (from: http://lists.mysql.com/commits/17414)
[packages/mysql.git] / mysql.spec
1 # TODO:
2 # - trigger that prepares system from pre-cluster into cluster
3 # - C(XX)FLAGS for innodb subdirs are overriden by ./configure!
4 # - http://bugs.mysql.com/bug.php?id=16470
5 # - innodb are dynamic (= as plugins) ?
6 # - missing have_archive, have_merge
7 # - is plugin_dir lib64 safe?
8 # - Using NDB Cluster... could not find sci transporter in /{include, lib}
9 #
10 # Conditional build:
11 %bcond_without  innodb          # Without InnoDB support
12 %bcond_without  raid            # Without raid
13 %bcond_without  ssl             # Without OpenSSL
14 %bcond_without  tcpd            # Without libwrap (tcp_wrappers) support
15 %bcond_without  big_tables      # Support tables with more than 4G rows even on 32 bit platforms
16 #
17 %include        /usr/lib/rpm/macros.perl
18 Summary:        MySQL: a very fast and reliable SQL database engine
19 Summary(de):    MySQL: ist eine SQL-Datenbank
20 Summary(fr):    MySQL: un serveur SQL rapide et fiable
21 Summary(pl):    MySQL: bardzo szybka i niezawodna baza danych (SQL)
22 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
23 Summary(ru):    MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
24 Summary(uk):    MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
25 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
26 Name:           mysql
27 Version:        5.1.14
28 Release:        3
29 License:        GPL + MySQL FLOSS Exception
30 Group:          Applications/Databases
31 Source0:        http://mysql.dataphone.se/Downloads/MySQL-5.1/%{name}-%{version}-beta.tar.gz
32 # Source0-md5:  f02115e98c99558e062adcf2dc305283
33 Source1:        %{name}.init
34 Source2:        %{name}.sysconfig
35 Source3:        %{name}.logrotate
36 Source4:        %{name}d.conf
37 Source5:        %{name}-clusters.conf
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 Source14:       %{name}-init_db.sql
46 Source15:       %{name}-init_db-data.sql
47 Patch0:         %{name}-libs.patch
48 Patch1:         %{name}-libwrap.patch
49 Patch2:         %{name}-c++.patch
50 Patch3:         %{name}-info.patch
51 Patch4:         %{name}-sql-cxx-pic.patch
52 Patch5:         %{name}-noproc.patch
53 Patch6:         %{name}-fix_privilege_tables.patch
54 Patch7:         %{name}-align.patch
55 Patch8:         %{name}-client-config.patch
56 Patch9:         %{name}-build.patch
57 Patch10:        %{name}-alpha.patch
58 Patch11:        %{name}-upgrade.patch
59 Patch12:        %{name}-NDB_CXXFLAGS.patch
60 Patch13:        %{name}-bug-16634.patch
61 Patch14:        %{name}-bug-18156.patch
62 Patch15:        %{name}-bug-22807.patch
63 Patch16:        %{name}-bug-24747.patch
64 URL:            http://www.mysql.com/products/database/mysql/community_edition.html
65 BuildRequires:  autoconf
66 BuildRequires:  automake
67 BuildRequires:  doxygen
68 BuildRequires:  libstdc++-devel >= 5:3.0
69 BuildRequires:  libtool
70 %{?with_tcpd:BuildRequires:     libwrap-devel}
71 BuildRequires:  ncurses-devel >= 4.2
72 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7d}
73 BuildRequires:  perl-DBI
74 BuildRequires:  perl-devel >= 1:5.6.1
75 BuildRequires:  readline-devel >= 4.2
76 BuildRequires:  rpm-perlprov >= 4.1-13
77 BuildRequires:  rpmbuild(macros) >= 1.268
78 BuildRequires:  sed >= 4.0
79 BuildRequires:  texinfo
80 BuildRequires:  zlib-devel
81 Requires(post,postun):  /sbin/ldconfig
82 Requires(post,preun):   /sbin/chkconfig
83 Requires(postun):       /usr/sbin/groupdel
84 Requires(postun):       /usr/sbin/userdel
85 Requires(pre):  /bin/id
86 Requires(pre):  /usr/bin/getgid
87 Requires(pre):  /usr/sbin/groupadd
88 Requires(pre):  /usr/sbin/useradd
89 Requires(triggerpostun):        sed >= 4.0
90 Requires:       %{name}-charsets = %{version}-%{release}
91 Requires:       /usr/bin/setsid
92 Requires:       rc-scripts >= 0.2.0
93 Provides:       MySQL-server
94 Provides:       group(mysql)
95 Provides:       msqlormysql
96 Provides:       user(mysql)
97 Obsoletes:      MySQL
98 Obsoletes:      mysql-server
99 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100
101 %define         _libexecdir     %{_sbindir}
102 %define         _localstatedir  /var/lib/mysql
103 %define         _mysqlhome      /home/services/mysql
104
105 %define         _noautoreqdep   'perl(DBD::mysql)'
106
107 # readline/libedit detection goes wrong
108 %undefine       configure_cache
109
110 %description
111 MySQL is a true multi-user, multi-threaded SQL (Structured Query
112 Language) database server. SQL is the most popular database language
113 in the world. MySQL is a client/server implementation that consists of
114 a server daemon mysqld and many different client programs/libraries.
115
116 The main goals of MySQL are speed, robustness and easy to use. MySQL
117 was originally developed because we at Tcx needed a SQL server that
118 could handle very big databases with magnitude higher speed than what
119 any database vendor could offer to us. We have now been using MySQL
120 since 1996 in a environment with more than 40 databases, 10,000
121 tables, of which more than 500 have more than 7 million rows. This is
122 about 50G of mission critical data.
123
124 The base upon which MySQL is built is a set of routines that have been
125 used in a highly demanding production environment for many years.
126 While MySQL is still in development, it already offers a rich and
127 highly useful function set.
128
129 %description -l fr
130 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
131 multi-taches. Le langage SQL est le langage de bases de donnees le
132 plus populaire au monde. MySQL est une implementation client/serveur
133 qui consiste en un serveur (mysqld) et differents
134 programmes/bibliotheques clientes.
135
136 Les objectifs principaux de MySQL sont: vitesse, robustesse et
137 facilite d'utilisation. MySQL fut originalement developpe parce que
138 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
139 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
140 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
141 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
142 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
143 millions de lignes. Ceci represente environ 50G de donnees critiques.
144
145 A la base de la conception de MySQL, on retrouve une serie de routines
146 qui ont ete utilisees dans un environnement de production pendant
147 plusieurs annees. Meme si MySQL est encore en developpement, il offre
148 deja une riche et utile serie de fonctions.
149
150 %description -l pl
151 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
152 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
153 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
154 mysqld i wielu ró¿nych programów i bibliotek klienckich.
155
156 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
157 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
158 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
159 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
160 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
161 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
162 50GB krytycznych danych.
163
164 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
165 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
166 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
167 i u¿yteczny zbiór funkcji.
168
169 %description -l de
170 MySQL ist eine SQL-Datenbank. Allerdings ist sie im Gegensatz zu
171 Oracle, DB2 oder PostgreSQL keine relationale Datenbank. Die Daten
172 werden zwar in zweidimensionalen Tabellen gespeichert und können mit
173 einem Primärschlüssel versehen werden. Es ist aber keine Definition
174 eines Fremdschlüssels möglich. Der Benutzer ist somit bei einer
175 MySQL-Datenbank völlig allein für die (referenzielle) Integrität der
176 Daten verantwortlich. Allein durch die Nutzung externer
177 Tabellenformate, wie InnoDB bzw Berkeley DB wird eine Relationalität
178 ermöglicht. Diese Projekte sind aber getrennt von MySQL zu betrachten.
179
180 %description -l pt_BR
181 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
182 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
183 dados no mundo. O MySQL é uma implementação cliente/servidor que
184 consiste de um servidor chamado mysqld e diversos
185 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
186 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
187 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
188 pudesse lidar com grandes bases de dados e com uma velocidade muito
189 maior do que a que qualquer vendedor podia nos oferecer. Estamos
190 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
191 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
192 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
193 A base da construção do MySQL é uma série de rotinas que foram usadas
194 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
195 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
196 funções muito ricas e úteis. Veja a documentação para maiores
197 informações.
198
199 %description -l ru
200 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
201 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
202 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
203 Ï MySQL.
204
205 %description -l uk
206 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
207 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
208 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁ槠ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉ˦נÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
209 ¦ÎÆÏÒÍÁæ§.
210
211 %package charsets
212 Summary:        MySQL - character sets definitions
213 Summary(pl):    MySQL - definicje kodowañ znaków
214 Group:          Applications/Databases
215
216 %description charsets
217 This package contains character sets definitions needed by both client
218 and server.
219
220 %description charsets -l pl
221 Ten pakiet zawiera definicje kodowañ znaków potrzebne dla serwera i
222 klienta.
223
224 %package extras
225 Summary:        MySQL additional utilities
226 Summary(pl):    Dodatkowe narzêdzia do MySQL
227 Group:          Applications/Databases
228 Requires:       %{name}-libs = %{version}-%{release}
229
230 %description extras
231 MySQL additional utilities except Perl scripts (they may be found in
232 %{name}-extras-perl package).
233
234 %description extras -l pl
235 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
236 pakiecie %{name}-extras-perl).
237
238 %package extras-perl
239 Summary:        MySQL additional utilities written in Perl
240 Summary(pl):    Dodatkowe narzêdzia do MySQL napisane w Perlu
241 Group:          Applications/Databases
242 Requires:       %{name}-extras = %{version}-%{release}
243 Requires:       perl(DBD::mysql)
244
245 %description extras-perl
246 MySQL additional utilities written in Perl.
247
248 %description extras-perl -l pl
249 Dodatkowe narzêdzia do MySQL napisane w Perlu.
250
251 %package client
252 Summary:        MySQL - Client
253 Summary(pl):    MySQL - Klient
254 Summary(pt):    MySQL - Cliente
255 Summary(ru):    MySQL ËÌÉÅÎÔ
256 Summary(uk):    MySQL Ë̦¤ÎÔ
257 Group:          Applications/Databases
258 Requires:       %{name}-charsets = %{version}-%{release}
259 Requires:       %{name}-libs = %{version}-%{release}
260 Obsoletes:      MySQL-client
261
262 %description client
263 This package contains the standard MySQL clients.
264
265 %description client -l fr
266 Ce package contient les clients MySQL standards.
267
268 %description client -l pl
269 Standardowe programy klienckie MySQL.
270
271 %description client -l pt_BR
272 Este pacote contém os clientes padrão para o MySQL.
273
274 %description client -l ru
275 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
276
277 %description client -l uk
278 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
279
280 %package libs
281 Summary:        Shared libraries for MySQL
282 Summary(pl):    Biblioteki dzielone MySQL
283 Group:          Libraries
284 Obsoletes:      libmysql10
285 Obsoletes:      mysql-doc < 4.1.12
286
287 %description libs
288 Shared libraries for MySQL.
289
290 %description libs -l pl
291 Biblioteki dzielone MySQL.
292
293 %package devel
294 Summary:        MySQL - Development header files and libraries
295 Summary(pl):    MySQL - Pliki nag³ówkowe i biblioteki dla programistów
296 Summary(pt):    MySQL - Medições de desempenho
297 Summary(ru):    MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
298 Summary(uk):    MySQL - ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
299 Group:          Development/Libraries
300 Requires:       %{name}-libs = %{version}-%{release}
301 %{?with_ssl:Requires:   openssl-devel}
302 Requires:       zlib-devel
303 Obsoletes:      MySQL-devel
304 Obsoletes:      libmysql10-devel
305
306 %description devel
307 This package contains the development header files and libraries
308 necessary to develop MySQL client applications.
309
310 %description devel -l fr
311 Ce package contient les fichiers entetes et les librairies de
312 developpement necessaires pour developper des applications clientes
313 MySQL.
314
315 %description devel -l pl
316 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
317 klienckich MySQL.
318
319 %description devel -l pt_BR
320 Este pacote contém os arquivos de cabeçalho (header files) e
321 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
322
323 %description devel -l ru
324 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
325 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
326
327 %description devel -l uk
328 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
329 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
330
331 %package static
332 Summary:        MySQL static libraries
333 Summary(pl):    Biblioteki statyczne MySQL
334 Summary(ru):    MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
335 Summary(uk):    MySQL - ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ
336 Group:          Development/Libraries
337 Requires:       %{name}-devel = %{version}-%{release}
338 Obsoletes:      MySQL-static
339
340 %description static
341 MySQL static libraries.
342
343 %description static -l pl
344 Biblioteki statyczne MySQL.
345
346 %description static -l ru
347 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
348 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
349
350 %description static -l uk
351 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
352 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
353
354 %package bench
355 Summary:        MySQL - Benchmarks
356 Summary(pl):    MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
357 Summary(pt):    MySQL - Medições de desempenho
358 Summary(ru):    MySQL - ÂÅÎÞÍÁÒËÉ
359 Summary(uk):    MySQL - ÂÅÎÞÍÁÒËÉ
360 Group:          Applications/Databases
361 Requires:       %{name} = %{version}-%{release}
362 Requires:       %{name}-client
363 Requires:       perl(DBD::mysql)
364 Obsoletes:      MySQL-bench
365
366 %description bench
367 This package contains MySQL benchmark scripts and data.
368
369 %description bench -l pl
370 Programy testuj±ce szybko¶æ serwera MySQL.
371
372 %description bench -l pt_BR
373 Este pacote contém medições de desempenho de scripts e dados do MySQL.
374
375 %description bench -l ru
376 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
377 MySQL.
378
379 %description bench -l uk
380 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
381
382 %package doc
383 Summary:        MySQL manual
384 Summary(pl):    Podrêcznik u¿ytkownika MySQL
385 Group:          Applications/Databases
386
387 %description doc
388 This package contains manual in HTML format.
389
390 %description doc -l pl
391 Podrêcznik MySQL-a w formacie HTML.
392
393 %package ndb
394 Summary:        MySQL - NDB Storage Engine Daemon
395 Summary(pl):    MySQL - demon silnika przechowywania danych NDB
396 Group:          Applications/Databases
397 Requires:       %{name}-libs = %{version}-%{release}
398
399 %description ndb
400 This package contains the standard MySQL NDB Storage Engine Daemon.
401
402 %description ndb -l pl
403 Ten pakiet zawiera standardowego demona silnika przechowywania danych
404 NDB.
405
406 %package ndb-client
407 Summary:        MySQL - NDB Clients
408 Summary(pl):    MySQL - programy klienckie NDB
409 Group:          Applications/Databases
410 Requires:       %{name}-libs = %{version}-%{release}
411
412 %description ndb-client
413 This package contains the standard MySQL NDB Clients.
414
415 %description ndb-client -l pl
416 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
417
418 %package ndb-mgm
419 Summary:        MySQL - NDB Management Daemon
420 Summary(pl):    MySQL - demon zarz±dzaj±cy NDB
421 Group:          Applications/Databases
422 Requires:       %{name}-libs = %{version}-%{release}
423
424 %description ndb-mgm
425 This package contains the standard MySQL NDB Management Daemon.
426
427 %description ndb-mgm -l pl
428 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
429
430 %package ndb-cpc
431 Summary:        MySQL - NDB CPC Daemon
432 Summary(pl):    MySQL - demon NDB CPC
433 Group:          Applications/Databases
434 Requires:       %{name}-libs = %{version}-%{release}
435
436 %description ndb-cpc
437 This package contains the standard MySQL NDB CPC Daemon.
438
439 %description ndb-cpc -l pl
440 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
441
442 %prep
443 %setup -q -n %{name}-%{version}-beta
444 %patch0 -p1
445 #%{?with_tcpd:%patch1 -p1}  # WHATS PURPOSE OF THIS PATCH?
446 #%patch2 -p1 # NEEDS CHECK, which exact program needs -lc++
447 %patch3 -p1
448 %ifarch alpha
449 # this is strange: mysqld functions for UDF modules are not explicitly defined,
450 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
451 # in objects compiled without -fPIC
452 %patch4 -p1
453 # gcc 3.3.x ICE
454 %patch10 -p1
455 %endif
456 %patch5 -p1
457 %patch6 -p1
458 %patch7 -p1
459 %patch8 -p1
460 %patch9 -p1
461 %patch11 -p1
462 %patch12 -p1
463 %patch13 -p1
464 %patch14 -p1
465 %patch15 -p1
466 %patch16 -p1
467
468 %build
469 %{__libtoolize}
470 %{__aclocal}
471 %{__automake}
472 %{__autoconf}
473
474 # The compiler flags are as per their "official" spec ;)
475 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
476 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
477
478 # NOTE: the PS, FIND_PROC, KILL, CHECK_PID are not used by PLD Linux
479 # and therefore do not add BR on these. These are here just to satisfy
480 # configure.
481
482 %configure \
483         PS='/bin/ps' \
484         FIND_PROC='/bin/ps p $$PID' \
485         KILL='/bin/kill' \
486         CHECK_PID='/bin/kill -0 $$PID' \
487         --enable-assembler \
488         --enable-largefile=yes \
489         --enable-shared \
490         --enable-static \
491         --enable-thread-safe-client \
492         --with%{!?with_innodb:out}-innodb \
493         --with%{!?with_raid:out}-raid \
494         --with%{!?with_ssl:out}-ssl=/usr \
495         --with%{!?with_tcpd:out}-libwrap \
496         %{?with_big_tables:--with-big-tables} \
497         --with-comment="PLD Linux Distribution MySQL RPM" \
498         --with%{!?debug:out}-debug%{?debug:=full} \
499         --with%{!?debug:out}-ndb-debug \
500         --with-embedded-server \
501         --with-extra-charsets=all \
502         --with-low-memory \
503         --with-mysqld-user=mysql \
504         --with-named-curses-libs="-lncurses" \
505         --with-named-thread-libs="-lpthread" \
506         --with-unix-socket-path=/var/lib/mysql/mysql.sock \
507         --with-archive-storage-engine \
508         --with-fast-mutexes \
509         --with-vio \
510         --with-ndbcluster \
511         --without-readline \
512         --without-libedit \
513         --with-ndb-docs \
514         --with-docs
515
516 #--with-error-inject
517
518 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
519 # (it defaults to first cluster but user may change it to whatever
520 # cluster it wants)
521
522 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
523
524 %{__make} \
525         benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
526
527 %{__make} -C Docs mysql.info
528
529 %install
530 rm -rf $RPM_BUILD_ROOT
531 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql} \
532            $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
533            $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
534
535 # Make install
536 %{__make} install \
537         DESTDIR=$RPM_BUILD_ROOT \
538         benchdir=%{_datadir}/sql-bench \
539         libsdir=/tmp
540 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
541
542 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
543
544 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
545 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
546 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
547 # This is template for configuration file which is created after 'service mysql init'
548 install %{SOURCE4} mysqld.conf
549 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/clusters.conf
550 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update}
551
552 # remove innodb directives from mysqld.conf if mysqld is configured without
553 %if %{without innodb}
554         cp mysqld.conf mysqld.tmp
555         awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
556 %endif
557
558 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
559 cp mysqld.conf mysqld.tmp
560 awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
561
562 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
563 cp -a %{SOURCE14} $RPM_BUILD_ROOT%{_datadir}/mysql/init_db.sql
564 cp -a %{SOURCE15} $RPM_BUILD_ROOT%{_datadir}/mysql/init_db-data.sql
565 cp -a %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
566
567 # NDB
568 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
569 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
570 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
571 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
572 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
573 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
574
575 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
576 sed -i -e 's,%{_libdir}/mysql,%{_libdir},' $RPM_BUILD_ROOT{%{_libdir}/libmysqlclient{,_r}.la,%{_bindir}/mysql_config}
577
578 # remove known unpackaged files
579 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
580
581 # remove .txt variants for .sys messages
582 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*.txt
583
584 # rename not to be so generic name
585 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
586
587 # not useful without -debug build
588 %{!?debug:rm -f $RPM_BUILD_ROOT%{_bindir}/mysql_resolve_stack_dump}
589 # generate symbols file, so one can generate backtrace using it
590 # mysql_resolve_stack_dump -s /usr/share/mysql/mysqld.sym -n mysqld.stack.
591 # http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html
592 %{?debug:nm -n $RPM_BUILD_ROOT%{_sbindir}/mysqld > $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.sym}
593
594 # functionality in initscript / rpm
595 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
596 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
597 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_safe
598 rm $RPM_BUILD_ROOT%{_bindir}/mysqld_multi
599 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
600 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
601 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
602 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
603 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/errmsg.txt
604 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
605 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysql.server*
606 rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqlman.1*
607 rm $RPM_BUILD_ROOT%{_bindir}/resolveip
608
609 # we don't package those (we have no -test or -testsuite pkg) and some of them just segfault
610 rm $RPM_BUILD_ROOT%{_bindir}/mysql_client_test
611 rm $RPM_BUILD_ROOT%{_datadir}/mysql/mi_test_all
612 rm $RPM_BUILD_ROOT%{_datadir}/mysql/mi_test_all.res
613
614 # in %doc
615 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
616
617 # afaik not needed
618 rm $RPM_BUILD_ROOT%{_libdir}/mysql/ha_{example,blackhole,federated}.{a,la}
619
620 %clean
621 rm -rf $RPM_BUILD_ROOT
622
623 %pre
624 %groupadd -g 89 mysql
625 %useradd -u 89 -d %{_mysqlhome} -s /bin/sh -g mysql -c "MySQL Server" mysql
626
627 %post
628 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
629 /sbin/ldconfig
630 /sbin/chkconfig --add mysql
631 %service mysql restart
632
633 %preun
634 if [ "$1" = "0" ]; then
635         %service -q mysql stop
636         /sbin/chkconfig --del mysql
637 fi
638
639 %postun
640 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
641 /sbin/ldconfig
642
643 if [ "$1" = "0" ]; then
644         %userremove mysql
645         %groupremove mysql
646 fi
647
648 %post ndb
649 /sbin/chkconfig --add mysql-ndb
650 %service mysql-ndb restart "mysql NDB engine"
651
652 %preun ndb
653 if [ "$1" = "0" ]; then
654         %service mysql-ndb stop
655         /sbin/chkconfig --del mysql-ndb
656 fi
657
658 %post ndb-mgm
659 /sbin/chkconfig --add mysql-ndb-mgm
660 %service mysql-ndb-mgm restart "mysql NDB management node"
661
662 %preun ndb-mgm
663 if [ "$1" = "0" ]; then
664         %service mysql-ndb-mgm stop
665         /sbin/chkconfig --del mysql-ndb-mgm
666 fi
667
668 %post ndb-cpc
669 /sbin/chkconfig --add mysql-ndb-cpc
670 %service mysql-ndb-cpc restart "mysql NDB CPC"
671
672 %preun ndb-cpc
673 if [ "$1" = "0" ]; then
674         %service mysql-ndb-cpc stop
675         /sbin/chkconfig --del mysql-ndb-cpc
676 fi
677
678 %post   libs -p /sbin/ldconfig
679 %postun libs -p /sbin/ldconfig
680
681 %triggerpostun -- mysql <= 4.0.20-2
682 # For clusters in /etc/mysql/clusters.conf
683 if [ -f "/etc/sysconfig/mysql" ]; then
684         . /etc/sysconfig/mysql
685         if [ -n "$MYSQL_DB_CLUSTERS" ]; then
686                 for i in "$MYSQL_DB_CLUSTERS"; do
687                         echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
688                 done
689                 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
690                 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
691                 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
692                 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
693         fi
694 fi
695
696 %triggerpostun -- mysql <= 4.1.1
697 # For better compatibility with prevoius versions:
698 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
699         if echo "$config" | grep -q '^/'; then
700                 config_file="$config"
701         elif [ -f "/etc/mysql/$config" ]; then
702                 config_file=/etc/mysql/$config
703         else
704                 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
705                 if [ -z "$clusterdir" ]; then
706                         echo >&2 "Can't find cluster dir for $config!"
707                         echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
708                         exit 1
709                 fi
710                 config_file="$clusterdir/mysqld.conf"
711         fi
712
713         if [ ! -f "$config_file" ]; then
714                         echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
715                         exit 1
716         fi
717         echo "Adding option old-passwords to config: $config_file"
718         echo "If you want to use new, better passwords - remove it"
719
720         # sed magic to add 'old-passwords' to [mysqld] section
721         sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
722                 a
723                 a; Compatibility options:
724                 aold-passwords
725         }
726         ' $config_file
727 done
728
729 %banner -e %{name}-4.1.x <<-EOF
730         If you want to use new help tables in MySQL 4.1.x then You'll need to import the help data:
731         mysql -u mysql mysql < %{_datadir}/%{name}/fill_help_tables.sql
732 EOF
733 #'
734
735 %triggerpostun -- mysql < 5.1
736 configs=""
737 for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
738         if echo "$config" | grep -q '^/'; then
739                 config_file="$config"
740         elif [ -f "/etc/mysql/$config" ]; then
741                 config_file=/etc/mysql/$config
742         else
743                 clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
744                 if [ -z "$clusterdir" ]; then
745                         echo >&2 "Can't find cluster dir for $config!"
746                         echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
747                         exit 1
748                 fi
749                 config_file="$clusterdir/mysqld.conf"
750         fi
751
752         if [ ! -f "$config_file" ]; then
753                 echo >&2 "ERROR: Can't find real config file for $config! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
754                 continue
755         fi
756         configs="$configs $config_file"
757 done
758
759 (
760 echo 'You should run MySQL upgrade scripts for all MySQL clusters.'
761 echo 'Thus, you should invoke:'
762 for config in $configs; do
763         datadir=$(awk -F= '!/^#/ && $1 ~ /datadir/{print $2}' $config)
764         echo "# mysql_upgrade --datadir=$datadir"
765 done
766 ) | %banner -e %{name}-5.1
767
768 %files
769 %defattr(644,root,root,755)
770 %doc support-files/*.cnf support-files/*.ini
771 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
772 %attr(754,root,root) /etc/rc.d/init.d/mysql
773 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
774 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
775 %attr(755,root,root) %{_bindir}/innochecksum
776 %attr(755,root,root) %{_bindir}/myisamchk
777 %attr(755,root,root) %{_bindir}/myisamlog
778 %attr(755,root,root) %{_bindir}/myisampack
779 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
780 %attr(755,root,root) %{_bindir}/my_print_defaults
781 %attr(755,root,root) %{_bindir}/mysql_upgrade
782 %attr(755,root,root) %{_bindir}/mysqlcheck
783 %attr(755,root,root) %{_sbindir}/mysqld
784 %dir %{_libdir}/mysql
785 %attr(755,root,root) %{_libdir}/mysql/ha_blackhole.so.*.*.*
786 %attr(755,root,root) %{_libdir}/mysql/ha_example.so.*.*.*
787 %attr(755,root,root) %{_libdir}/mysql/ha_federated.so.*.*.*
788 %{_mandir}/man1/mysql_fix_privilege_tables.1*
789 %{_mandir}/man1/mysqld.1*
790 %{_mandir}/man1/myisamchk.1*
791 %{_mandir}/man1/myisamlog.1*
792 %{_mandir}/man1/myisampack.1*
793 %{_mandir}/man1/mysql_upgrade.1*
794 %{_mandir}/man1/mysqlcheck.1*
795 %{_mandir}/man8/mysqld.8*
796
797 %attr(700,mysql,mysql) %{_mysqlhome}
798 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
799 %attr(751,root,root) /var/lib/mysql
800 %attr(750,mysql,mysql) %dir /var/log/mysql
801 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
802 %attr(640,mysql,mysql) %ghost /var/log/mysql/*
803
804 %{_infodir}/mysql.info*
805 # This is template for configuration file which is created after 'service mysql init'
806 %{_datadir}/mysql/mysqld.conf
807 %{_datadir}/mysql/english
808 %{_datadir}/mysql/fill_help_tables.sql
809 %{_datadir}/mysql/init_db-data.sql
810 %{_datadir}/mysql/init_db.sql
811 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
812 %lang(cs) %{_datadir}/mysql/czech
813 %lang(da) %{_datadir}/mysql/danish
814 %lang(de) %{_datadir}/mysql/german
815 %lang(el) %{_datadir}/mysql/greek
816 %lang(es) %{_datadir}/mysql/spanish
817 %lang(et) %{_datadir}/mysql/estonian
818 %lang(fr) %{_datadir}/mysql/french
819 %lang(hu) %{_datadir}/mysql/hungarian
820 %lang(it) %{_datadir}/mysql/italian
821 %lang(ja) %{_datadir}/mysql/japanese
822 %lang(ko) %{_datadir}/mysql/korean
823 %lang(nl) %{_datadir}/mysql/dutch
824 %lang(nb) %{_datadir}/mysql/norwegian
825 %lang(nn) %{_datadir}/mysql/norwegian-ny
826 %lang(pl) %{_datadir}/mysql/polish
827 %lang(pt) %{_datadir}/mysql/portuguese
828 %lang(ro) %{_datadir}/mysql/romanian
829 %lang(ru) %{_datadir}/mysql/russian
830 %lang(sr) %{_datadir}/mysql/serbian
831 %lang(sk) %{_datadir}/mysql/slovak
832 %lang(sv) %{_datadir}/mysql/swedish
833 %lang(uk) %{_datadir}/mysql/ukrainian
834
835 %files charsets
836 %defattr(644,root,root,755)
837 %dir %{_datadir}/mysql
838 %{_datadir}/mysql/charsets
839
840 %files extras
841 %defattr(644,root,root,755)
842 %attr(755,root,root) %{_bindir}/msql2mysql
843 %attr(755,root,root) %{_bindir}/myisam_ftdump
844 %attr(755,root,root) %{_bindir}/mysql_secure_installation
845 %attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
846 %attr(755,root,root) %{_bindir}/perror
847 %attr(755,root,root) %{_bindir}/replace
848 %{_mandir}/man1/msql2mysql.1*
849 %{_mandir}/man1/myisam_ftdump.1*
850 %{_mandir}/man1/perror.1*
851 %{_mandir}/man1/replace.1*
852
853 %files extras-perl
854 %defattr(644,root,root,755)
855 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
856 %attr(755,root,root) %{_bindir}/mysql_find_rows
857 %attr(755,root,root) %{_bindir}/mysql_fix_extensions
858 %attr(755,root,root) %{_bindir}/mysql_setpermission
859 %attr(755,root,root) %{_bindir}/mysql_zap
860 %attr(755,root,root) %{_bindir}/mysqlaccess
861 %attr(755,root,root) %{_bindir}/mysqldumpslow
862 %attr(755,root,root) %{_bindir}/mysqlhotcopy
863 %{_mandir}/man1/mysql_zap.1*
864 %{_mandir}/man1/mysqlaccess.1*
865 %{_mandir}/man1/mysqlhotcopy.1*
866
867 %files client
868 %defattr(644,root,root,755)
869 %attr(755,root,root) %{_bindir}/mysql
870 %attr(755,root,root) %{_bindir}/mysqladmin
871 %attr(755,root,root) %{_bindir}/mysqlbinlog
872 %attr(755,root,root) %{_bindir}/mysqlbug
873 %attr(755,root,root) %{_bindir}/mysqldump
874 %attr(755,root,root) %{_bindir}/mysqlimport
875 %attr(755,root,root) %{_bindir}/mysqlshow
876 %attr(755,root,root) %{_bindir}/mysqlslap
877 %attr(755,root,root) %{_bindir}/mysqltest*
878 %attr(755,root,root) %{_sbindir}/mysqlmanager*
879 %{_mandir}/man1/mysql.1*
880 %{_mandir}/man1/mysqladmin.1*
881 %{_mandir}/man1/mysqlbinlog.1*
882 %{_mandir}/man1/mysqldump.1*
883 %{_mandir}/man1/mysqlimport.1*
884 %{_mandir}/man1/mysqlmanager.1*
885 %{_mandir}/man1/mysqlshow.1*
886 %{_mandir}/man1/mysqlslap.1*
887 %{_mandir}/man8/mysqlmanager.8*
888
889 %files libs
890 %defattr(644,root,root,755)
891 %doc EXCEPTIONS-CLIENT
892 %attr(755,root,root) %{_libdir}/lib*.so.*.*
893 %attr(751,root,root) %dir %{_sysconfdir}/mysql
894 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
895
896 %files devel
897 %defattr(644,root,root,755)
898 %attr(755,root,root) %{_bindir}/mysql_config
899 %attr(755,root,root) %{_libdir}/lib*.so
900 %{?debug:%attr(755,root,root) %{_bindir}/*resolve_stack_dump}
901 %{?debug:%{_datadir}/mysql/mysqld.sym}
902 %{_libdir}/lib*.la
903 %{_libdir}/lib*[!tr].a
904 %{_includedir}/mysql
905 %{_mandir}/man1/mysql_config.1*
906
907 %files static
908 %defattr(644,root,root,755)
909 %{_libdir}/lib*[tr].a
910
911 %files bench
912 %defattr(644,root,root,755)
913 %attr(755,root,root) %{_bindir}/mysqltest
914 %dir %{_datadir}/sql-bench
915 %{_datadir}/sql-bench/[CDRl]*
916 %attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*
917
918 #%files doc
919 #%defattr(644,root,root,755)
920 #%doc Docs/manual.html Docs/manual_toc.html
921
922 %files ndb
923 %defattr(644,root,root,755)
924 %attr(755,root,root) %{_sbindir}/ndbd
925 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
926 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
927
928 %files ndb-client
929 %defattr(644,root,root,755)
930 %attr(755,root,root) %{_bindir}/ndb_*
931 %attr(755,root,root) %{_datadir}/mysql/ndb_size.tmpl
932
933 %files ndb-mgm
934 %defattr(644,root,root,755)
935 %attr(755,root,root) %{_sbindir}/ndb_mgmd
936 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
937 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
938
939 %files ndb-cpc
940 %defattr(644,root,root,755)
941 %attr(755,root,root) %{_sbindir}/ndb_cpcd
942 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
943 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
This page took 0.139215 seconds and 3 git commands to generate.