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