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