]> git.pld-linux.org Git - packages/mysql.git/blob - mysql.spec
- merge from AC-branch: bconds, CXXFLAGS optimize
[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 # - what's the libwrapper constistent bcond name? I see in specs 'libwrap', 'tcpd', 'tcp_wrappers'
6 #
7 # Conditional build:
8 %bcond_with     bdb     # Berkeley DB support
9 %bcond_without  innodb  # Without InnoDB support
10 %bcond_without  isam    # Without ISAM table format (used in mysql 3.22)
11 %bcond_without  raid    # Without raid
12 %bcond_without  ssl     # Without OpenSSL
13 %bcond_without  tcpd    # Without libwrap (tcp_wrappers) support
14 #
15 %include        /usr/lib/rpm/macros.perl
16 Summary:        MySQL: a very fast and reliable SQL database engine
17 Summary(fr):    MySQL: un serveur SQL rapide et fiable
18 Summary(pl):    MySQL: bardzo szybka i niezawodna baza danych (SQL)
19 Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável
20 Summary(ru):    MySQL - ÂÙÓÔÒÙÊ SQL-ÓÅÒ×ÅÒ
21 Summary(uk):    MySQL - Û×ÉÄËÉÊ SQL-ÓÅÒ×ÅÒ
22 Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
23 Name:           mysql
24 Group:          Applications/Databases
25 Version:        4.1.10
26 Release:        0.2
27 License:        GPL + MySQL FLOSS Exception
28 Source0:        http://mysql.mirror.anlx.net/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
29 # Source0-md5:  27b27b74f430aaeb77fb8d4e6f32ac4d
30 Source1:        %{name}.init
31 Source2:        %{name}.sysconfig
32 Source3:        %{name}.logrotate
33 Source4:        %{name}d.conf
34 Source5:        %{name}-clusters.conf
35 Source6:        %{name}.monitrc
36 Source7:        %{name}-ndb.init
37 Source8:        %{name}-ndb.sysconfig
38 Source9:        %{name}-ndb-mgm.init
39 Source10:       %{name}-ndb-mgm.sysconfig
40 Source11:       %{name}-ndb-cpc.init
41 Source12:       %{name}-ndb-cpc.sysconfig
42 Patch0:         %{name}-libs.patch
43 Patch1:         %{name}-libwrap.patch
44 Patch2:         %{name}-c++.patch
45 Patch3:         %{name}-info.patch
46 Patch4:         %{name}-sql-cxx-pic.patch
47 Patch5:         %{name}-noproc.patch
48 Patch6:         %{name}-fix_privilege_tables.patch
49 Patch7:         %{name}-nptl.patch
50 Icon:           mysql.gif
51 URL:            http://www.mysql.com/
52 #BuildRequires: ORBit-devel
53 BuildRequires:  /bin/ps
54 BuildRequires:  autoconf
55 BuildRequires:  automake
56 %{?with_bdb:BuildRequires:      db3-devel}
57 BuildRequires:  libstdc++-devel >= 5:3.0
58 BuildRequires:  libtool
59 %{?with_tcpd:BuildRequires:     libwrap-devel}
60 BuildRequires:  ncurses-devel >= 4.2
61 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7d}
62 BuildRequires:  perl-DBI
63 BuildRequires:  perl-devel >= 1:5.6.1
64 BuildRequires:  readline-devel >= 4.2
65 BuildRequires:  rpm-perlprov >= 4.1-13
66 BuildRequires:  rpmbuild(macros) >= 1.159
67 BuildRequires:  texinfo
68 BuildRequires:  zlib-devel
69 PreReq:         rc-scripts >= 0.2.0
70 Requires(pre):  /usr/bin/getgid
71 Requires(pre):  /bin/id
72 Requires(pre):  /usr/sbin/groupadd
73 Requires(pre):  /usr/sbin/useradd
74 Requires(postun):       /usr/sbin/userdel
75 Requires(postun):       /usr/sbin/groupdel
76 Requires(post,preun):   /sbin/chkconfig
77 Requires:       %{name}-libs = %{version}-%{release}
78 Requires:       /usr/bin/setsid
79 Provides:       MySQL-server
80 Provides:       group(mysql)
81 Provides:       msqlormysql
82 Provides:       user(mysql)
83 Obsoletes:      MySQL
84 Obsoletes:      mysql-server
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %define         _libexecdir     %{_sbindir}
88 %define         _localstatedir  /var/lib/mysql
89 %define         _mysqlhome      /home/services/mysql
90
91 %define         _noautoreqdep   'perl(DBD::mysql)'
92 # workaround for buggy gcc 3.3.1
93 %define         specflags_alpha  -mno-explicit-relocs
94
95 %description
96 MySQL is a true multi-user, multi-threaded SQL (Structured Query
97 Language) database server. SQL is the most popular database language
98 in the world. MySQL is a client/server implementation that consists of
99 a server daemon mysqld and many different client programs/libraries.
100
101 The main goals of MySQL are speed, robustness and easy to use. MySQL
102 was originally developed because we at Tcx needed a SQL server that
103 could handle very big databases with magnitude higher speed than what
104 any database vendor could offer to us. We have now been using MySQL
105 since 1996 in a environment with more than 40 databases, 10,000
106 tables, of which more than 500 have more than 7 million rows. This is
107 about 50G of mission critical data.
108
109 The base upon which MySQL is built is a set of routines that have been
110 used in a highly demanding production environment for many years.
111 While MySQL is still in development, it already offers a rich and
112 highly useful function set.
113
114 %description -l fr
115 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
116 multi-taches. Le langage SQL est le langage de bases de donnees le
117 plus populaire au monde. MySQL est une implementation client/serveur
118 qui consiste en un serveur (mysqld) et differents
119 programmes/bibliotheques clientes.
120
121 Les objectifs principaux de MySQL sont: vitesse, robustesse et
122 facilite d'utilisation. MySQL fut originalement developpe parce que
123 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
124 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
125 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
126 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
127 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
128 millions de lignes. Ceci represente environ 50G de donnees critiques.
129
130 A la base de la conception de MySQL, on retrouve une serie de routines
131 qui ont ete utilisees dans un environnement de production pendant
132 plusieurs annees. Meme si MySQL est encore en developpement, il offre
133 deja une riche et utile serie de fonctions.
134
135 %description -l pl
136 MySQL to prawdziwie wielou¿ytkownikowy, wielow±tkowy serwer baz danych
137 SQL. SQL jest najpopularniejszym na ¶wiecie jêzykiem u¿ywanym do baz
138 danych. MySQL to implementacja klient/serwer sk³adaj±ca siê z demona
139 mysqld i wielu ró¿nych programów i bibliotek klienckich.
140
141 G³ównymi celami MySQL-a s± szybko¶æ, potêga i ³atwo¶æ u¿ytkowania.
142 MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
143 serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
144 wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
145 od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
146 których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
147 50GB krytycznych danych.
148
149 Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
150 które by³y u¿ywane w bardzo wymagaj±cym ¶rodowisku produkcyjnym przez
151 wiele lat. Pomimo, ¿e MySQL jest ci±gle rozwijany, ju¿ oferuje bogaty
152 i u¿yteczny zbiór funkcji.
153
154 %description -l pt_BR
155 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
156 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
157 dados no mundo. O MySQL é uma implementação cliente/servidor que
158 consiste de um servidor chamado mysqld e diversos
159 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
160 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
161 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
162 pudesse lidar com grandes bases de dados e com uma velocidade muito
163 maior do que a que qualquer vendedor podia nos oferecer. Estamos
164 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
165 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
166 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
167 A base da construção do MySQL é uma série de rotinas que foram usadas
168 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
169 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
170 funções muito ricas e úteis. Veja a documentação para maiores
171 informações.
172
173 %description -l ru
174 MySQL - ÜÔÏ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÙ ÄÁÎÎÙÈ. MySQL
175 ÂÙÌÁ ÎÁÐÉÓÁÎÁ Michael'ÏÍ (monty) Widenius'ÏÍ. óÍ. ÆÁÊÌ CREDITS ×
176 ÄÉÓÔÒÉÂÕÔÉ×Å ÎÁ ÐÒÅÄÍÅÔ ÄÒÕÇÉÈ ÕÞÁÓÔÎÉËÏ× ÐÒÏÅËÔÁ É ÐÒÏÞÅÊ ÉÎÆÏÒÍÁÃÉÉ
177 Ï MySQL.
178
179 %description -l uk
180 MySQL - ÃÅ SQL (Structured Query Language) ÓÅÒ×ÅÒ ÂÁÚÉ ÄÁÎÉÈ. MySQL
181 ÂÕÌÏ ÎÁÐÉÓÁÎÏ Michael'ÏÍ (monty) Widenius'ÏÍ. äÉ×. ÆÁÊÌ CREDITS ×
182 ÄÉÓÔÒÉÂÕÔÉצ ÄÌÑ ¦ÎÆÏÒÍÁ槠ÐÒÏ ¦ÎÛÉÈ ÕÞÁÓÎÉ˦נÐÒÏÅËÔÕ ÔÁ ¦ÎÛϧ
183 ¦ÎÆÏÒÍÁæ§.
184
185 %package extras
186 Summary:        MySQL additional utilities
187 Summary(pl):    Dodatkowe narzêdzia do MySQL
188 Group:          Applications/Databases
189 Requires:       %{name}-libs = %{version}-%{release}
190
191 %description extras
192 MySQL additional utilities except Perl scripts (they may be found in
193 %{name}-extras-perl package).
194
195 %description extras -l pl
196 Dodatkowe narzêdzia do MySQL - z wyj±tkiem skryptów Perla (które s± w
197 pakiecie %{name}-extras-perl).
198
199 %package extras-perl
200 Summary:        MySQL additional utilities written in Perl
201 Summary(pl):    Dodatkowe narzêdzia do MySQL napisane w Perlu
202 Group:          Applications/Databases
203 Requires:       %{name}-extras = %{version}-%{release}
204 Requires:       perl(DBD::mysql)
205
206 %description extras-perl
207 MySQL additional utilities written in Perl.
208
209 %description extras-perl -l pl
210 Dodatkowe narzêdzia do MySQL napisane w Perlu.
211
212 %package client
213 Summary:        MySQL - Client
214 Summary(pl):    MySQL - Klient
215 Summary(pt):    MySQL - Cliente
216 Summary(ru):    MySQL ËÌÉÅÎÔ
217 Summary(uk):    MySQL Ë̦¤ÎÔ
218 Group:          Applications/Databases
219 Requires:       %{name}-libs = %{version}-%{release}
220 Obsoletes:      MySQL-client
221
222 %description client
223 This package contains the standard MySQL clients.
224
225 %description client -l fr
226 Ce package contient les clients MySQL standards.
227
228 %description client -l pl
229 Standardowe programy klienckie MySQL.
230
231 %description client -l pt_BR
232 Este pacote contém os clientes padrão para o MySQL.
233
234 %description client -l ru
235 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÔÏÌØËÏ ËÌÉÅÎÔ MySQL.
236
237 %description client -l uk
238 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ Ô¦ÌØËÉ Ë̦¤ÎÔÁ MySQL.
239
240 %package libs
241 Summary:        Shared libraries for MySQL
242 Summary(pl):    Biblioteki dzielone MySQL
243 Group:          Applications/Databases
244 Obsoletes:      libmysql10
245
246 %description libs
247 Shared libraries for MySQL.
248
249 %description libs -l pl
250 Biblioteki dzielone MySQL.
251
252 %package devel
253 Summary:        MySQL - Development header files and libraries
254 Summary(pl):    MySQL - Pliki nag³ówkowe i biblioteki dla programistów
255 Summary(pt):    MySQL - Medições de desempenho
256 Summary(ru):    MySQL - ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ
257 Summary(uk):    MySQL - ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
258 Group:          Development/Libraries
259 Requires:       %{name}-libs = %{version}-%{release}
260 %{?with_ssl:Requires:   openssl-devel}
261 Requires:       zlib-devel
262 Obsoletes:      MySQL-devel
263 Obsoletes:      libmysql10-devel
264
265 %description devel
266 This package contains the development header files and libraries
267 necessary to develop MySQL client applications.
268
269 %description devel -l fr
270 Ce package contient les fichiers entetes et les librairies de
271 developpement necessaires pour developper des applications clientes
272 MySQL.
273
274 %description devel -l pl
275 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
276 klienckich MySQL.
277
278 %description devel -l pt_BR
279 Este pacote contém os arquivos de cabeçalho (header files) e
280 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
281
282 %description devel -l ru
283 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÈÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ
284 ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
285
286 %description devel -l uk
287 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÈÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
288 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
289
290 %package static
291 Summary:        MySQL static libraries
292 Summary(pl):    Biblioteki statyczne MySQL
293 Summary(ru):    MySQL - ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ
294 Summary(uk):    MySQL - ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ
295 Group:          Development/Libraries
296 Requires:       %{name}-devel = %{version}-%{release}
297 Obsoletes:      MySQL-static
298
299 %description static
300 MySQL static libraries.
301
302 %description static -l pl
303 Biblioteki statyczne MySQL.
304
305 %description static -l ru
306 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÒÁÚÒÁÂÏÔÞÉËÁ, ÎÅÏÂÈÏÄÉÍÙÅ
307 ÄÌÑ ÒÁÚÒÁÂÏÔËÉ ËÌÉÅÎÔÓËÉÈ ÐÒÉÌÏÖÅÎÉÊ.
308
309 %description static -l uk
310 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÓÔÁÔÉÞΦ Â¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ, ÎÅÏÂȦÄΦ ÄÌÑ
311 ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ-Ë̦¤ÎÔ¦×.
312
313 %package bench
314 Summary:        MySQL - Benchmarks
315 Summary(pl):    MySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
316 Summary(pt):    MySQL - Medições de desempenho
317 Summary(ru):    MySQL - ÂÅÎÞÍÁÒËÉ
318 Summary(uk):    MySQL - ÂÅÎÞÍÁÒËÉ
319 Group:          Applications/Databases
320 Requires:       %{name} = %{version}-%{release}
321 Requires:       %{name}-client
322 Requires:       perl(DBD::mysql)
323 Obsoletes:      MySQL-bench
324
325 %description bench
326 This package contains MySQL benchmark scripts and data.
327
328 %description bench -l pl
329 Programy testuj±ce szybko¶æ serwera MySQL.
330
331 %description bench -l pt_BR
332 Este pacote contém medições de desempenho de scripts e dados do MySQL.
333
334 %description bench -l ru
335 üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓËÒÉÐÔÙ É ÄÁÎÎÙÅ ÄÌÑ ÏÃÅÎËÉ ÐÒÏÉÚ×ÏÄÉÔÅÌØÎÏÓÔÉ
336 MySQL.
337
338 %description bench -l uk
339 ãÅÊ ÐÁËÅԠͦÓÔÉÔØ ÓËÒÉÐÔÉ ÔÁ ÄÁΦ ÄÌÑ ÏæÎËÉ ÐÒÏÄÕËÔÉ×ÎÏÓÔ¦ MySQL.
340
341 %package doc
342 Summary:        MySQL manual
343 Summary(pl):    Podrêcznik u¿ytkownika MySQL
344 Group:          Applications/Databases
345
346 %description doc
347 This package contains manual in HTML format.
348
349 %description doc -l pl
350 Podrêcznik MySQL-a w formacie HTML.
351
352 %package ndb
353 Summary:        MySQL - NDB Storage Engine Daemon
354 Summary(pl):    MySQL - demon silnika przechowywania danych NDB
355 Group:          Applications/Databases
356 Requires:       %{name}-libs = %{version}-%{release}
357
358 %description ndb
359 This package contains the standard MySQL NDB Storage Engine Daemon.
360
361 %description ndb -l pl
362 Ten pakiet zawiera standardowego demona silnika przechowywania danych
363 NDB.
364
365 %package ndb-client
366 Summary:        MySQL - NDB Clients
367 Summary(pl):    MySQL - programy klienckie NDB
368 Group:          Applications/Databases
369 Requires:       %{name}-libs = %{version}-%{release}
370
371 %description ndb-client
372 This package contains the standard MySQL NDB Clients.
373
374 %description ndb-client -l pl
375 Ten pakiet zawiera standardowe programy klienckie MySQL NDB.
376
377 %package ndb-mgm
378 Summary:        MySQL - NDB Management Daemon
379 Summary(pl):    MySQL - demon zarz±dzaj±cy NDB
380 Group:          Applications/Databases
381 Requires:       %{name}-libs = %{version}-%{release}
382
383 %description ndb-mgm
384 This package contains the standard MySQL NDB Management Daemon.
385
386 %description ndb-mgm -l pl
387 Ten pakiet zawiera standardowego demona zarz±dzaj±cego MySQL NDB.
388
389 %package ndb-cpc
390 Summary:        MySQL - NDB CPC Daemon
391 Summary(pl):    MySQL - demon NDB CPC
392 Group:          Applications/Databases
393 Requires:       %{name}-libs = %{version}-%{release}
394
395 %description ndb-cpc
396 This package contains the standard MySQL NDB CPC Daemon.
397
398 %description ndb-cpc -l pl
399 Ten pakiet zawiera standardowego demona MySQL NDB CPC.
400
401 %prep
402 %setup -q
403 %patch0 -p1
404 %{?with_tcpd:%patch1 -p1}
405 %patch2 -p1
406 %patch3 -p1
407 %ifarch alpha
408 # this is strange: mysqld functions for UDF modules are not explicitly defined,
409 # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
410 # in objects compiled without -fPIC
411 %patch4 -p1
412 %endif
413 %patch5 -p1
414 %patch6 -p1
415 %patch7 -p1
416
417 %{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
418
419 %build
420 %{__libtoolize}
421 %{__aclocal}
422 %{__automake}
423 %{__autoconf}
424 # The compiler flags are as per their "official" spec ;)
425 CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
426 CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
427 %configure \
428         PS='/bin/ps' \
429         FIND_PROC='/bin/ps p $$PID' \
430         KILL='/bin/kill' \
431         CHECK_PID='/bin/kill -0 $$PID' \
432         --enable-assembler \
433         --enable-shared \
434         --enable-static \
435         --enable-thread-safe-client \
436         --with%{!?with_bdb:out}-berkeley-db \
437         --with%{!?with_innodb:out}-innodb \
438         --with%{!?with_isam:out}-isam \
439         --with%{!?with_raid:out}-raid \
440         --with%{!?with_ssl:out}-openssl \
441         --with%{!?with_tcpd:out}-libwrap \
442         --with-comment="PLD Linux Distribution MySQL RPM" \
443         --with%{!?debug:out}-debug \
444         --with-embedded-server \
445         --with-extra-charsets=all \
446         --with-low-memory \
447         --with-mysqld-user=mysql \
448         --with-named-curses-libs="-lncurses" \
449         --with-pthread \
450         --with-unix-socket-path=/var/lib/mysql/mysql.sock \
451         --with-vio \
452         --with-ndbcluster \
453         --without-readline \
454         --without-docs
455 #       --with-mysqlfs
456
457 # NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
458 # (it defaults to first cluster but user may change it to whatever
459 #  cluster it wants)
460
461 echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile
462
463 %{__make} \
464         benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
465
466 %{__make} -C Docs mysql.info
467
468 %install
469 rm -rf $RPM_BUILD_ROOT
470 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql,monit} \
471            $RPM_BUILD_ROOT/var/{log/{archiv,}/mysql,lib/mysql} \
472            $RPM_BUILD_ROOT{%{_infodir},%{_mysqlhome}}
473
474 %if %{with bdb}
475 install -d $RPM_BUILD_ROOT/var/lib/mysql/bdb/{log,tmp}
476 %endif
477
478 # Make install
479 %{__make} install \
480         DESTDIR=$RPM_BUILD_ROOT \
481         benchdir=%{_datadir}/sql-bench \
482         libsdir=/tmp
483 # libsdir is to avoid installing innodb static libs in $RPM_BUILD_ROOT../libs
484
485 install Docs/mysql.info $RPM_BUILD_ROOT%{_infodir}
486
487 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
488 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
489 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
490 # This is template for configuration file which is created after 'service mysql init'
491 install %{SOURCE4} mysqld.conf
492 install %{SOURCE5} $RPM_BUILD_ROOT/etc/mysql/clusters.conf
493 install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit
494 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
495
496 # remove innodb directives from mysqld.conf if mysqld is configured without
497 %if %{without innodb}
498         cp mysqld.conf mysqld.tmp
499         awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
500 %endif
501
502 # remove berkeley-db directives from mysqld.conf if mysqld is configured without
503 %if %{without bdb}
504         cp mysqld.conf mysqld.tmp
505         awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
506 %endif
507
508 install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
509
510 # NDB
511 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
512 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
513 install %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-mgm
514 install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-mgm
515 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb-cpc
516 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb-cpc
517
518 # remove mysqld's *.po files
519 find . $RPM_BUILD_ROOT%{_datadir}/%{name} -name \*.txt | xargs -n 100 rm -f
520 mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
521 %{__perl} -pi -e 's,%{_libdir}/mysql,%{_libdir},;' $RPM_BUILD_ROOT%{_libdir}/libmysqlclient.la
522
523 rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
524
525 %clean
526 rm -rf $RPM_BUILD_ROOT
527
528 %pre
529 if [ -n "`/usr/bin/getgid mysql`" ]; then
530         if [ "`/usr/bin/getgid mysql`" != "89" ]; then
531                 echo "Error: group mysql doesn't have gid=89. Correct this before installing mysql." 1>&2
532                 exit 1
533         fi
534 else
535         /usr/sbin/groupadd -g 89 mysql
536 fi
537 if [ -n "`/bin/id -u mysql 2>/dev/null`" ]; then
538         if [ "`/bin/id -u mysql`" != "89" ]; then
539                 echo "Error: user mysql doesn't have uid=89. Correct this before installing mysql." 1>&2
540                 exit 1
541         fi
542 else
543         /usr/sbin/useradd -u 89 \
544                         -d %{_mysqlhome} -s /bin/sh -g mysql \
545                         -c "MySQL Server" mysql 1>&2
546 fi
547
548 %post
549 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
550 /sbin/chkconfig --add mysql
551 if [ -f /var/lock/subsys/mysql ]; then
552         /etc/rc.d/init.d/mysql restart >&2
553 else
554         echo "Run \"/etc/rc.d/init.d/mysql start\" to start mysql." >&2
555 fi
556
557 %preun
558 if [ "$1" = "0" ]; then
559         if [ -f /var/lock/subsys/mysql ]; then
560                 /etc/rc.d/init.d/mysql stop
561         fi
562         /sbin/chkconfig --del mysql
563 fi
564
565 %postun
566 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
567 if [ "$1" = "0" ]; then
568         %userremove mysql
569         %groupremove mysql
570 fi
571
572 %post ndb
573 /sbin/chkconfig --add mysql-ndb
574 if [ -f /var/lock/subsys/mysql-ndb ]; then
575         /etc/rc.d/init.d/mysql-ndb restart >&2
576 else
577         echo "Run \"/etc/rc.d/init.d/mysql-ndb start\" to start mysql NDB engine." >&2
578 fi
579
580 %preun ndb
581 if [ "$1" = "0" ]; then
582         if [ -f /var/lock/subsys/mysql-ndb ]; then
583                 /etc/rc.d/init.d/mysql-ndb stop
584         fi
585         /sbin/chkconfig --del mysql-ndb
586 fi
587
588 %post ndb-mgm
589 /sbin/chkconfig --add mysql-ndb-mgm
590 if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
591         /etc/rc.d/init.d/mysql-ndb-mgm restart >&2
592 else
593         echo "Run \"/etc/rc.d/init.d/mysql-ndb-mgm start\" to start mysql NDB management node." >&2
594 fi
595
596 %preun ndb-mgm
597 if [ "$1" = "0" ]; then
598         if [ -f /var/lock/subsys/mysql-ndb-mgm ]; then
599                 /etc/rc.d/init.d/mysql-ndb-mgm stop
600         fi
601         /sbin/chkconfig --del mysql-ndb-mgm
602 fi
603
604 %post ndb-cpc
605 /sbin/chkconfig --add mysql-ndb-cpc
606 if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
607         /etc/rc.d/init.d/mysql-ndb-cpc restart >&2
608 else
609         echo "Run \"/etc/rc.d/init.d/mysql-ndb-cpc start\" to start mysql NDB CPC." >&2
610 fi
611
612 %preun ndb-cpc
613 if [ "$1" = "0" ]; then
614         if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
615                 /etc/rc.d/init.d/mysql-ndb-cpc stop
616         fi
617         /sbin/chkconfig --del mysql-ndb-cpc
618 fi
619
620 %post   libs -p /sbin/ldconfig
621 %postun libs -p /sbin/ldconfig
622
623 %triggerpostun -- mysql <= 4.0.20-2
624 # For clusters in /etc/mysql/clusters.conf
625 if [ -f "/etc/sysconfig/mysql" ]; then
626         . /etc/sysconfig/mysql
627         if [ -n "$MYSQL_DB_CLUSTERS" ]; then
628                 for i in "$MYSQL_DB_CLUSTERS"; do
629                         echo "$i/mysqld.conf=$i" >> /etc/mysql/clusters.conf
630                 done
631                 echo "# Do not use **obsolete** option MYSQL_DB_CLUSTERS" >> /etc/sysconfig/mysql
632                 echo "# USE /etc/mysql/clusters.conf instead" >> /etc/sysconfig/mysql
633                 echo "Converted clusters from MYSQL_DB_CLUSTERS to /etc/mysql/clusters.conf."
634                 echo "You NEED to fix your /etc/sysconfig/mysql and verify /etc/mysql/clusters.conf."
635         fi
636 fi
637
638 %files
639 %defattr(644,root,root,755)
640 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
641 %attr(754,root,root) /etc/rc.d/init.d/mysql
642 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
643 %attr(751,root,root) %dir /etc/mysql
644 %attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) /etc/mysql/clusters.conf
645 %attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/*.monitrc
646 %attr(755,root,root) %{_bindir}/isamchk
647 %attr(755,root,root) %{_bindir}/isamlog
648 %attr(755,root,root) %{_bindir}/myisamchk
649 %attr(755,root,root) %{_bindir}/myisamlog
650 %attr(755,root,root) %{_bindir}/myisampack
651 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
652 %attr(755,root,root) %{_bindir}/pack_isam
653 %attr(755,root,root) %{_sbindir}/mysqld
654 %{_mandir}/man1/isamchk.1*
655 %{_mandir}/man1/isamlog.1*
656 %{_mandir}/man1/mysql_fix_privilege_tables.1*
657 %{_mandir}/man1/mysqld.1*
658
659 %attr(700,mysql,mysql) %{_mysqlhome}
660 # root:root is proper here for AC mysql.rpm while mysql:mysql is potential security hole
661 %attr(751,root,root) /var/lib/mysql
662 %attr(750,mysql,mysql) %dir /var/log/mysql
663 %attr(750,mysql,mysql) %dir /var/log/archiv/mysql
664 %attr(640,mysql,mysql) %config(noreplace) %verify(not md5 mtime size) /var/log/mysql/*
665
666 %{_infodir}/mysql.info*
667 %dir %{_datadir}/mysql
668 # This is template for configuration file which is created after 'service mysql init'
669 %{_datadir}/mysql/mysqld.conf
670 %{_datadir}/mysql/charsets
671 %{_datadir}/mysql/english
672 %{_datadir}/mysql/mysql_fix_privilege_tables.sql
673 %lang(cs) %{_datadir}/mysql/czech
674 %lang(da) %{_datadir}/mysql/danish
675 %lang(de) %{_datadir}/mysql/german
676 %lang(el) %{_datadir}/mysql/greek
677 %lang(es) %{_datadir}/mysql/spanish
678 %lang(et) %{_datadir}/mysql/estonian
679 %lang(fr) %{_datadir}/mysql/french
680 %lang(hu) %{_datadir}/mysql/hungarian
681 %lang(it) %{_datadir}/mysql/italian
682 %lang(ja) %{_datadir}/mysql/japanese
683 %lang(ko) %{_datadir}/mysql/korean
684 %lang(nl) %{_datadir}/mysql/dutch
685 %lang(nb) %{_datadir}/mysql/norwegian
686 %lang(nn) %{_datadir}/mysql/norwegian-ny
687 %lang(pl) %{_datadir}/mysql/polish
688 %lang(pt) %{_datadir}/mysql/portuguese
689 %lang(ro) %{_datadir}/mysql/romanian
690 %lang(ru) %{_datadir}/mysql/russian
691 %lang(sr) %{_datadir}/mysql/serbian
692 %lang(sk) %{_datadir}/mysql/slovak
693 %lang(sv) %{_datadir}/mysql/swedish
694 %lang(uk) %{_datadir}/mysql/ukrainian
695
696 %files extras
697 %defattr(644,root,root,755)
698 %attr(755,root,root) %{_bindir}/msql2mysql
699 %attr(755,root,root) %{_bindir}/perror
700 %attr(755,root,root) %{_bindir}/my_print_defaults
701 %attr(755,root,root) %{_bindir}/replace
702 %attr(755,root,root) %{_bindir}/resolveip
703 %{_mandir}/man1/perror.1*
704 %{_mandir}/man1/replace.1*
705
706 %files extras-perl
707 %defattr(644,root,root,755)
708 %attr(755,root,root) %{_bindir}/mysql_convert_table_format
709 %attr(755,root,root) %{_bindir}/mysqldumpslow
710 %attr(755,root,root) %{_bindir}/mysqlhotcopy
711 %attr(755,root,root) %{_bindir}/mysql_setpermission
712 %attr(755,root,root) %{_bindir}/mysql_zap
713 %attr(755,root,root) %{_bindir}/mysql_find_rows
714 %attr(755,root,root) %{_bindir}/mysqlaccess
715 %{_mandir}/man1/mysql_zap.1*
716 %{_mandir}/man1/mysqlaccess.1*
717
718 %files client
719 %defattr(644,root,root,755)
720 %attr(755,root,root) %{_bindir}/mysql
721 %attr(755,root,root) %{_bindir}/mysqlbug
722 %attr(755,root,root) %{_bindir}/mysqldump
723 %attr(755,root,root) %{_bindir}/mysqlimport
724 %attr(755,root,root) %{_bindir}/mysqlmanager*
725 %attr(755,root,root) %{_bindir}/mysqlshow
726 %attr(755,root,root) %{_bindir}/mysqlbinlog
727 %attr(755,root,root) %{_bindir}/mysqladmin
728 %attr(755,root,root) %{_bindir}/mysqltest
729 %{_mandir}/man1/mysql.1*
730 %{_mandir}/man1/mysqladmin.1*
731 %{_mandir}/man1/mysqldump.1*
732 %{_mandir}/man1/mysqlshow.1*
733
734 %files libs
735 %defattr(644,root,root,755)
736 %doc EXCEPTIONS-CLIENT
737 %attr(755,root,root) %{_libdir}/lib*.so.*.*
738
739 %files devel
740 %defattr(644,root,root,755)
741 %attr(755,root,root) %{_bindir}/mysql_config
742 %attr(755,root,root) %{_libdir}/lib*.so
743 %{_libdir}/lib*.la
744 %{_libdir}/lib*[!tr].a
745 %{_includedir}/mysql
746
747 %files static
748 %defattr(644,root,root,755)
749 %{_libdir}/lib*[tr].a
750
751 %files bench
752 %defattr(644,root,root,755)
753 %dir %{_datadir}/sql-bench
754 %{_datadir}/sql-bench/[CDRl]*
755 %attr(755,root,root) %{_datadir}/sql-bench/[bcgrst]*
756
757 %files doc
758 %defattr(644,root,root,755)
759 %doc Docs/manual.html Docs/manual_toc.html
760
761 %files ndb
762 %defattr(644,root,root,755)
763 %attr(755,root,root) %{_sbindir}/ndbd
764 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
765 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
766
767 %files ndb-client
768 %defattr(644,root,root,755)
769 %attr(755,root,root) %{_bindir}/ndb_*
770
771 %files ndb-mgm
772 %defattr(644,root,root,755)
773 %attr(755,root,root) %{_sbindir}/ndb_mgmd
774 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
775 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
776
777 %files ndb-cpc
778 %defattr(644,root,root,755)
779 %attr(755,root,root) %{_sbindir}/ndb_cpcd
780 %attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
781 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc
This page took 0.088642 seconds and 4 git commands to generate.