]> git.pld-linux.org Git - packages/mysql.git/blob - mysql.spec
- added olddir definitions
[packages/mysql.git] / mysql.spec
1 %include        /usr/lib/rpm/macros.perl
2 %define         __find_requires %{_builddir}/mysql-%{version}/find-perl-requires
3 Summary:        MySQL: a very fast and reliable SQL database engine
4 Summary(fr):    MySQL: un serveur SQL rapide et fiable
5 Summary(pl):    MySQL: bardzo szybka i niezawodna baza danych (SQL)
6 Summary(pt):    MySQL: Um servidor SQL rápido e confiável
7 Name:           mysql
8 Group:          Applications/Databases
9 Group(pl):      Aplikacje/Bazy danych
10 Group(pt):      Aplicações/Banco_de_Dados
11 Version:        3.22.32
12 Release:        7
13 License:        MySQL FREE PUBLIC LICENSE (See the manual)
14 Source0:        http://www.mysql.com/Downloads/MySQL-3.22/%{name}-%{version}.tar.gz
15 Source1:        %{name}.init
16 Source2:        %{name}.sysconfig
17 Source3:        %{name}.logrotate
18 Source4:        %{name}d.conf
19 Patch0:         %{name}-info.patch
20 Patch1:         %{name}-no_libbind.patch
21 Patch2:         %{name}-perldep.patch
22 Patch3:         %{name}-gethostbyname_r_is_in_libc_aka_no_libnsl.patch
23 Icon:           mysql.gif
24 URL:            http://www.mysql.com/
25 Requires:       %{name}-libs = %{version}
26 BuildRequires:  libstdc++-devel
27 BuildRequires:  zlib-devel
28 BuildRequires:  ncurses-devel
29 BuildRequires:  readline-devel
30 BuildRequires:  texinfo
31 BuildRequires:  rpm-perlprov
32 Requires:       rc-scripts >= 0.2.0
33 Prereq:         shadow
34 Provides:       msqlormysql MySQL-server
35 Obsoletes:      MySQL
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %define         _libexecdir     %{_sbindir}
39 %define         _localstatedir  /var/lib/mysql
40
41 %description
42 MySQL is a true multi-user, multi-threaded SQL (Structured Query
43 Language) database server. SQL is the most popular database language
44 in the world. MySQL is a client/server implementation that consists of
45 a server daemon mysqld and many different client programs/libraries.
46
47 The main goals of MySQL are speed, robustness and easy to use. MySQL
48 was originally developed because we at Tcx needed a SQL server that
49 could handle very big databases with magnitude higher speed than what
50 any database vendor could offer to us. We have now been using MySQL
51 since 1996 in a environment with more than 40 databases, 10,000
52 tables, of which more than 500 have more than 7 million rows. This is
53 about 50G of mission critical data.
54
55 The base upon which MySQL is built is a set of routines that have been
56 used in a highly demanding production environment for many years.
57 While MySQL is still in development, it already offers a rich and
58 highly useful function set.
59
60 %description -l fr
61 MySQL est un serveur de bases de donnees SQL vraiment multi-usagers et
62 multi-taches. Le langage SQL est le langage de bases de donnees le
63 plus populaire au monde. MySQL est une implementation client/serveur
64 qui consiste en un serveur (mysqld) et differents
65 programmes/bibliotheques clientes.
66
67 Les objectifs principaux de MySQL sont: vitesse, robustesse et
68 facilite d'utilisation. MySQL fut originalement developpe parce que
69 nous, chez Tcx, avions besoin d'un serveur SQL qui pouvait gerer de
70 tres grandes bases de donnees avec une vitesse d'un ordre de magnitude
71 superieur a ce que n'importe quel vendeur pouvait nous offrir. Nous
72 utilisons MySQL depuis 1996 dans un environnement avec plus de 40
73 bases de donnees, 10000 tables, desquelles plus de 500 ont plus de 7
74 millions de lignes. Ceci represente environ 50G de donnees critiques.
75
76 A la base de la conception de MySQL, on retrouve une serie de routines
77 qui ont ete utilisees dans un environnement de production pendant
78 plusieurs annees. Meme si MySQL est encore en developpement, il offre
79 deja une riche et utile serie de fonctions.
80
81 %description -l pl
82 MySQL to wielow±tkowy serwer baz danych SQL.
83
84 G³ówne zalety MySQL to szybko¶æ, potêga i ³atwo¶æ u¿ytkowania. MySQL
85 jest wykorzystywany m.in. do obs³ugi 40 baz danych, 10 000 tabeli,
86 gdzie ka¿da tabela zawiera 7 milionów pozycji. To ok 50GB danych.
87
88 %description -l pt_BR
89 O MySQL é um servidor de banco de dados SQL realmente multiusuário e
90 multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de
91 dados no mundo. O MySQL é uma implementação cliente/servidor que
92 consiste de um servidor chamado mysqld e diversos
93 programas/bibliotecas clientes. Os principais objetivos do MySQL são:
94 velocidade, robustez e facilidade de uso. O MySQL foi originalmente
95 desenvolvido porque nós na Tcx precisávamos de um servidor SQL que
96 pudesse lidar com grandes bases de dados e com uma velocidade muito
97 maior do que a que qualquer vendedor podia nos oferecer. Estamos
98 usando o MySQL desde 1996 em um ambiente com mais de 40 bases de dados
99 com 10.000 tabelas, das quais mais de 500 têm mais de 7 milhões de
100 linhas. Isto é o equivalente a aproximadamente 50G de dados críticos.
101 A base da construção do MySQL é uma série de rotinas que foram usadas
102 em um ambiente de produção com alta demanda por muitos anos. Mesmo o
103 MySQL estando ainda em desenvolvimento, ele já oferece um conjunto de
104 funções muito ricas e úteis. Veja a documentação para maiores
105 informações.
106
107 %package extras
108 Summary:        MySQL additional utilities 
109 Group:          Applications/Databases
110 Group(pl):      Aplikacje/Bazy danych
111 Group(pt):      Aplicações/Banco_de_Dados
112 Requires:       %{name}-libs = %{version}
113
114 %description extras
115 MySQL additional utilities except Perl scripts (they may be found in
116 %{name}-extras-perl package)
117
118 %package extras-perl
119 Summary:        MySQL additional utilities written in Perl
120 Group:          Applications/Databases
121 Group(pl):      Aplikacje/Bazy danych
122 Group(pt):      Aplicações/Banco_de_Dados
123 Requires:       %{name}-extras = %{version}
124
125 %description extras-perl
126 MySQL additional utilities written in Perl.
127
128 %package client
129 Summary:        MySQL - Client
130 Summary(pl):    MySQL - Klient
131 Summary(pt):    MySQL - Cliente
132 Group:          Applications/Databases
133 Group(pl):      Aplikacje/Bazy danych
134 Group(pt):      Aplicações/Banco_de_Dados
135 Requires:       %{name}-libs = %{version}
136 Obsoletes:      MySQL-client
137
138 %description client
139 This package contains the standard MySQL clients.
140
141 %description -l fr client
142 Ce package contient les clients MySQL standards.
143
144 %description -l pl client
145 Standardowe programy klienckie MySQL.
146
147 %description -l pt_BR client
148 Este pacote contém os clientes padrão para o MySQL.
149
150 %package libs
151 Summary:        Shared libraries for MySQL
152 Group:          Applications/Databases
153 Group(pl):      Aplikacje/Bazy danych
154
155 %description libs
156 Shared libraries for MySQL.
157
158 %package devel
159 Summary:        MySQL - Development header files and libraries
160 Summary(pl):    MySQL - Pliki nag³ówkowe i biblioteki dla programistów
161 Summary(pt):    MySQL - Medições de desempenho
162 Group:          Development/Libraries
163 Group(pl):      Programowanie/Biblioteki
164 Group(fr):      Development/Librairies
165 Requires:       %{name}-libs = %{version}
166 Obsoletes:      MySQL-devel
167
168 %description devel
169 This package contains the development header files and libraries
170 necessary to develop MySQL client applications.
171
172 %description -l pl devel
173 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
174 klienckich MySQL.
175
176 %description devel -l pt_BR
177 Este pacote contém os arquivos de cabeçalho (header files) e
178 bibliotecas necessárias para desenvolver aplicações clientes do MySQL.
179
180 %description -l fr devel
181 Ce package contient les fichiers entetes et les librairies de
182 developpement necessaires pour developper des applications clientes
183 MySQL.
184
185 %package static
186 Summary:        MySQL staic libraris
187 Summary(pl):    Biblioteki statyczne MySQL
188 Group:          Development/Libraries
189 Group(pl):      Programowanie/Biblioteki
190 Group(fr):      Development/Librairies
191 Requires:       %{name}-devel = %{version}
192 Obsoletes:      MySQL-static
193
194 %description static
195 MySQL staic libraris.
196
197 %description -l pl static
198 Biblioteki statyczne MySQL.
199
200 %package bench
201 Summary:        MySQL - Benchmarks
202 Summary(pl):    mySQL - Programy testuj±ce szybko¶æ dzia³ania bazy
203 Summary(pt):    MySQL - Medições de desempenho
204 Group:          Applications/Databases
205 Group(pl):      Aplikacje/Bazy danych
206 Group(pt):      Aplicações/Banco_de_Dados
207 Requires:       %{name} = %{version}
208 Requires:       %{name}-client
209 Obsoletes:      MySQL-bench
210
211 %description bench
212 This package contains MySQL benchmark scripts and data.
213
214 %description -l pl bench
215 Programy testuj±ce szybko¶æ serwera MySQL.
216
217 %description -l pt_BR bench
218 Este pacote contém medições de desempenho de scripts e dados do MySQL.
219
220 %prep
221 %setup  -q
222 %patch0 -p1
223 %patch1 -p1
224 %patch2 -p1
225 %patch3 -p1
226
227 chmod +x find-perl-requires
228
229 %build
230 automake
231 aclocal
232 autoconf
233 LDFLAGS="-s"
234 CXXFLAGS="$RPM_OPT_FLAGS -fno-rtti -fno-exceptions"
235 export LDFLAGS CXXFLAGS
236 %configure \
237         --without-debug \
238         --enable-shared \
239         --enable-static \
240         --with-pthread \
241         --with-named-curses-libs="-lncurses" \
242         --enable-assembler \
243         --with-charset=latin2 \
244         --with-mysqld-user=mysql \
245         --with-unix-socket-path=/var/lib/mysql/mysql.sock \
246         --with-comment='Polish Linux Distribution MySQL RPM' \
247         --without-readline \
248         --with-low-memory
249 # If you have much RAM you can remove --with-low-memory
250
251 # To build mysqld as static binary add option
252 #       --with-mysqld-ldflags='-all-static' 
253
254 %{__make} benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench
255 (cd Docs; make info manual.texi)
256
257 %install
258 rm -rf $RPM_BUILD_ROOT
259 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{logrotate.d,rc.d/init.d,sysconfig} \
260         $RPM_BUILD_ROOT/var/{log/mysql,lib/mysql}
261
262 # Make install
263 %{__make} install DESTDIR=$RPM_BUILD_ROOT benchdir=%{_datadir}/sql-bench
264
265 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql
266 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
267 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
268 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mysqld.conf
269 touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog}
270
271 find Docs -type f ! -name \*.gif ! -name \*.html -exec rm -f {} \;
272 find . -name ./CVS -exec rm -rf {} \;
273 # remove mysqld's *.po files
274 find . $RPM_BUILD_ROOT%{_datadir}/mysql -name \*.txt | xargs -n 100 rm -f
275
276 mv $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir}
277 strip --strip-unneeded $RPM_BUILD_ROOT%{_libdir}/lib*.so*.*
278
279 gzip -9nf $RPM_BUILD_ROOT{%{_mandir}/man1/*,%{_infodir}/mysql.info*}
280
281 %pre
282 if [ -n "`getgid mysql`" ]; then
283         if [ "`getgid mysql`" != "89" ]; then
284                 echo "Warning:group mysql haven't gid=89. Corect this before install mysql" 1>&2
285                 exit 1
286         fi
287 else
288         /usr/sbin/groupadd -g 89 -r -f mysql
289         if [ -f /var/db/group.db ]; then
290                 /usr/bin/update-db 1>&2
291         fi
292 fi
293 if [ -n "`id -u mysql 2>/dev/null`" ]; then
294         if [ "`id -u mysql`" != "89" ]; then
295                 echo "Warning:user mysql haven't uid=89. Corect this before install mysql" 1>&2
296                 exit 1
297         fi
298 else
299         /usr/sbin/useradd -u 89 -r -d /var/lib/mysql -s /bin/false -c "MySQL User" -g mysql mysql 1>&2
300         if [ -f /var/db/passwd.db ]; then
301                 /usr/bin/update-db 1>&2
302         fi
303 fi
304
305 %post
306 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
307 /sbin/chkconfig --add mysql
308 if [ -f /var/lock/subsys/mysql ]; then
309         /etc/rc.d/init.d/mysql restart >&2
310 else
311         echo "Run \"/etc/rc.d/init.d/mysql start\" to start mysql." >&2
312 fi
313
314 %preun
315 if [ "$1" = "0" ]; then
316         if [ -f /var/lock/subsys/mysql ]; then
317                 /etc/rc.d/init.d/mysql stop
318         fi
319         /sbin/chkconfig --del mysql
320 fi
321
322 %postun
323 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
324 if [ "$1" = "0" ]; then
325         /usr/sbin/userdel mysql
326         if [ -f /var/db/passwd.db ]; then
327                 /usr/bin/update-db
328         fi
329         /usr/sbin/groupdel mysql
330         if [ -f /var/db/group.db ]; then
331                 /usr/bin/update-db
332         fi
333 fi
334
335 %post   libs -p /sbin/ldconfig
336 %postun libs -p /sbin/ldconfig
337
338 %clean
339 rm -rf $RPM_BUILD_ROOT
340
341 %files
342 %defattr(644,root,root,755)
343 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/logrotate.d/mysql
344 %attr(754,root,root) /etc/rc.d/init.d/mysql
345 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/mysql
346 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/mysqld.conf
347 %attr(755,root,root) %{_bindir}/isamchk
348 %attr(755,root,root) %{_bindir}/isamlog
349 %attr(755,root,root) %{_bindir}/mysqladmin
350 %attr(755,root,root) %{_bindir}/mysqlbug
351 %attr(755,root,root) %{_sbindir}/mysqld
352
353 %attr(751,mysql,mysql) %dir /var/lib/mysql
354 %attr(750,mysql,mysql) %dir /var/log/mysql
355 %attr(640,mysql,mysql) %config(noreplace) %verify(not md5 size mtime) /var/log/mysql/*
356
357 %{_infodir}/mysql.info*
358 %dir %{_datadir}/mysql
359 %{_datadir}/mysql/english
360 %lang(cs) %{_datadir}/mysql/czech
361 %lang(da) %{_datadir}/mysql/danish
362 %lang(nl) %{_datadir}/mysql/dutch
363 %lang(et) %{_datadir}/mysql/estonia
364 %lang(fr) %{_datadir}/mysql/french
365 %lang(de) %{_datadir}/mysql/german
366 %lang(el) %{_datadir}/mysql/greek
367 %lang(hu) %{_datadir}/mysql/hungarian
368 %lang(it) %{_datadir}/mysql/italian
369 %lang(ja) %{_datadir}/mysql/japanese
370 %lang(ko) %{_datadir}/mysql/korean
371 %lang(no) %{_datadir}/mysql/norwegian
372 %lang(no@nynorsk) %{_datadir}/mysql/norwegian-ny
373 %lang(pl) %{_datadir}/mysql/polish
374 %lang(pt) %{_datadir}/mysql/portuguese
375 %lang(ru) %{_datadir}/mysql/russian
376 %lang(sk) %{_datadir}/mysql/slovak
377 %lang(es) %{_datadir}/mysql/spanish
378 %lang(sv) %{_datadir}/mysql/swedish
379
380 %files extras
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_bindir}/msql2mysql
383 %attr(755,root,root) %{_bindir}/mysql_fix_privilege_tables
384 %attr(755,root,root) %{_bindir}/perror
385 %attr(755,root,root) %{_bindir}/print_defaults
386 %attr(755,root,root) %{_bindir}/replace
387 %attr(755,root,root) %{_bindir}/resolveip
388
389 %files extras-perl
390 %defattr(644,root,root,755)
391 %attr(755,root,root) %{_bindir}/mysql_setpermission
392 %attr(755,root,root) %{_bindir}/mysql_zap
393 %attr(755,root,root) %{_bindir}/mysql_find_rows
394 %attr(755,root,root) %{_bindir}/mysqlaccess
395
396 %files client
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_bindir}/mysql
399 %attr(755,root,root) %{_bindir}/mysqlbug
400 %attr(755,root,root) %{_bindir}/mysqldump
401 %attr(755,root,root) %{_bindir}/mysqlimport
402 %attr(755,root,root) %{_bindir}/mysqlshow
403 %{_mandir}/man1/mysql.1*
404
405 %files libs
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_libdir}/lib*.so.*.*
408
409 %files devel
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_libdir}/lib*.la
412 %attr(755,root,root) %{_libdir}/lib*.so
413 %{_includedir}/mysql
414
415 %files static
416 %defattr(644,root,root,755)
417 %{_libdir}/lib*.a
418
419 %files bench
420 %defattr(644,root,root,755)
421 %attr(-,root,root) %{_datadir}/sql-bench
This page took 0.056294 seconds and 3 git commands to generate.