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