# TODO:
-# - init/sysconfig for NDB subpackages
-# - fix ndb linking with static libstdc++
-#
# - trigger that prepares system from pre-cluster into cluster
# - trigger /etc/mysqld.conf into /etc/mysql/mysqld.conf. Solve possible
# conflict with /var/lib/mysql/mysqld.conf
+# - what's the libwrapper constistent bcond name? I see in specs 'libwrap', 'tcpd', 'tcp_wrappers'
#
# Conditional build:
%bcond_with bdb # Berkeley DB support
+%bcond_without innodb # Without InnoDB support
+%bcond_without isam # Without ISAM table format (used in mysql 3.22)
+%bcond_without raid # Without raid
+%bcond_without ssl # Without OpenSSL
+%bcond_without tcpd # Without libwrap (tcp_wrappers) support
#
%include /usr/lib/rpm/macros.perl
Summary: MySQL: a very fast and reliable SQL database engine
Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷
Name: mysql
Group: Applications/Databases
-Version: 4.1.8
-Release: 0.1
+Version: 4.1.10
+Release: 1
License: GPL + MySQL FLOSS Exception
-Source0: http://mysql.mirror.anlx.net/Downloads/MySQL-4.1/mysql-%{version}.tar.gz
-# Source0-md5: d1b3e84d1d49366e2692f453e7bf8879
+Source0: http://mysql.mirror.anlx.net/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
+# Source0-md5: 27b27b74f430aaeb77fb8d4e6f32ac4d
Source1: %{name}.init
Source2: %{name}.sysconfig
Source3: %{name}.logrotate
Patch0: %{name}-libs.patch
Patch1: %{name}-libwrap.patch
Patch2: %{name}-c++.patch
-Patch3: %{name}-_r-link.patch
-Patch4: %{name}-info.patch
-Patch5: %{name}-sql-cxx-pic.patch
-Patch6: %{name}-noproc.patch
-Patch7: %{name}-fix_privilege_tables.patch
-Patch8: %{name}-nptl.patch
+Patch3: %{name}-info.patch
+Patch4: %{name}-sql-cxx-pic.patch
+Patch5: %{name}-noproc.patch
+Patch6: %{name}-fix_privilege_tables.patch
+Patch7: %{name}-nptl.patch
+Patch8: %{name}-align.patch
Icon: mysql.gif
URL: http://www.mysql.com/
#BuildRequires: ORBit-devel
%{?with_bdb:BuildRequires: db3-devel}
BuildRequires: libstdc++-devel >= 5:3.0
BuildRequires: libtool
-BuildRequires: libwrap-devel
+%{?with_tcpd:BuildRequires: libwrap-devel}
BuildRequires: ncurses-devel >= 4.2
-BuildRequires: openssl-devel >= 0.9.7d
+%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
BuildRequires: perl-DBI
BuildRequires: perl-devel >= 1:5.6.1
BuildRequires: readline-devel >= 4.2
%define _mysqlhome /home/services/mysql
%define _noautoreqdep 'perl(DBD::mysql)'
-# workaround for buggy gcc 3.3.1
-%define specflags_alpha -mno-explicit-relocs
%description
MySQL is a true multi-user, multi-threaded SQL (Structured Query
MySQL oryginalnie by³ tworzony, poniewa¿ autorzy w Tcx potrzebowali
serwera SQL do obs³ugi bardzo du¿ych baz danych z szybko¶ci± o wiele
wiêksz±, ni¿ mogli zaoferowaæ inni producenci baz danych. U¿ywaj± go
-od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel,
-z których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
+od 1996 roku w ¶rodowisku z ponad 40 bazami danych, 10 000 tabel, z
+których ponad 500 zawiera ponad 7 milionów rekordów - w sumie oko³o
50GB krytycznych danych.
Baza, na której oparty jest MySQL, sk³ada siê ze zbioru procedur,
Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
-Requires: openssl-devel
+%{?with_ssl:Requires: openssl-devel}
Requires: zlib-devel
Obsoletes: MySQL-devel
Obsoletes: libmysql10-devel
This package contains the standard MySQL NDB Storage Engine Daemon.
%description ndb -l pl
-Ten pakiet zawiera standardowego demona silnika przechowywania
-danych NDB.
+Ten pakiet zawiera standardowego demona silnika przechowywania danych
+NDB.
%package ndb-client
Summary: MySQL - NDB Clients
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
+%{?with_tcpd:%patch1 -p1}
%patch2 -p1
%patch3 -p1
-%patch4 -p1
%ifarch alpha
# this is strange: mysqld functions for UDF modules are not explicitly defined,
# so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables
# in objects compiled without -fPIC
-%patch5 -p1
+%patch4 -p1
%endif
+%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%{__aclocal}
%{__automake}
%{__autoconf}
-CXXFLAGS="%{rpmcflags} -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
+# The compiler flags are as per their "official" spec ;)
+CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
%configure \
PS='/bin/ps' \
--enable-shared \
--enable-static \
--enable-thread-safe-client \
- %{?with_bdb:--with-berkeley-db} \
+ --with%{!?with_bdb:out}-berkeley-db \
+ --with%{!?with_innodb:out}-innodb \
+ --with%{!?with_isam:out}-isam \
+ --with%{!?with_raid:out}-raid \
+ --with%{!?with_ssl:out}-openssl \
+ --with%{!?with_tcpd:out}-libwrap \
--with-comment="PLD Linux Distribution MySQL RPM" \
--with%{!?debug:out}-debug \
--with-embedded-server \
--with-extra-charsets=all \
- --with-libwrap \
--with-low-memory \
--with-mysqld-user=mysql \
--with-named-curses-libs="-lncurses" \
- --with-openssl \
--with-pthread \
- --with-raid \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-vio \
--with-ndbcluster \
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
# This is template for configuration file which is created after 'service mysql init'
-install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
+install %{SOURCE4} mysqld.conf
install %{SOURCE5} $RPM_BUILD_ROOT/etc/mysql/clusters.conf
install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit
touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
+# remove innodb directives from mysqld.conf if mysqld is configured without
+%if %{without innodb}
+ cp mysqld.conf mysqld.tmp
+ awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
+%endif
+
+# remove berkeley-db directives from mysqld.conf if mysqld is configured without
+%if %{without bdb}
+ cp mysqld.conf mysqld.tmp
+ awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
+%endif
+
+install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
+
# NDB
install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb
%files
%defattr(644,root,root,755)
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/logrotate.d/mysql
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql
%attr(754,root,root) /etc/rc.d/init.d/mysql
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/mysql
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql
%attr(751,root,root) %dir /etc/mysql
-%attr(640,root,mysql) %config(noreplace) %verify(not md5 size mtime) /etc/mysql/clusters.conf
-%attr(750,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/monit/*.monitrc
+%attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) /etc/mysql/clusters.conf
+%attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/*.monitrc
%attr(755,root,root) %{_bindir}/isamchk
%attr(755,root,root) %{_bindir}/isamlog
%attr(755,root,root) %{_bindir}/myisamchk
%attr(751,root,root) /var/lib/mysql
%attr(750,mysql,mysql) %dir /var/log/mysql
%attr(750,mysql,mysql) %dir /var/log/archiv/mysql
-%attr(640,mysql,mysql) %config(noreplace) %verify(not md5 size mtime) /var/log/mysql/*
+%attr(640,mysql,mysql) %config(noreplace) %verify(not md5 mtime size) /var/log/mysql/*
%{_infodir}/mysql.info*
%dir %{_datadir}/mysql
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/ndbd
%attr(754,root,root) /etc/rc.d/init.d/mysql-ndb
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/mysql-ndb
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb
%files ndb-client
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/ndb_mgmd
%attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-mgm
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/mysql-ndb-mgm
-
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-mgm
%files ndb-cpc
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/ndb_cpcd
%attr(754,root,root) /etc/rc.d/init.d/mysql-ndb-cpc
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/mysql-ndb-cpc
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-ndb-cpc