# - 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 raid # Without raid
%bcond_without ssl # Without OpenSSL
%bcond_without tcpd # Without libwrap (tcp_wrappers) support
+%bcond_with big_tables # enable '--with-big-tables', some performance loss on 32bit arch, but can do >= 4GB database tables.
#
%include /usr/lib/rpm/macros.perl
Summary: MySQL: a very fast and reliable SQL database engine
Name: mysql
Group: Applications/Databases
Version: 4.1.12
-Release: 0.2
+Release: 1.4
License: GPL + MySQL FLOSS Exception
Source0: http://mysql.dataphone.se/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
# Source0-md5: 56a6f5cacd97ae290e07bbe19f279af1
Source10: %{name}-ndb-mgm.sysconfig
Source11: %{name}-ndb-cpc.init
Source12: %{name}-ndb-cpc.sysconfig
+Source13: %{name}-client.conf
Patch0: %{name}-libs.patch
Patch1: %{name}-libwrap.patch
Patch2: %{name}-c++.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
+Patch7: %{name}-align.patch
+Patch8: %{name}-client-config.patch
Icon: mysql.gif
URL: http://www.mysql.com/
#BuildRequires: ORBit-devel
Requires(postun): /usr/sbin/userdel
Requires(postun): /usr/sbin/groupdel
Requires(post,preun): /sbin/chkconfig
+Requires(triggerpostun): sed >= 4.0
Requires: %{name}-libs = %{version}-%{release}
Requires: /usr/bin/setsid
Provides: MySQL-server
%endif
%patch5 -p1
%patch6 -p1
-#%patch7 -p1
+%patch7 -p1
%patch8 -p1
%{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
--with%{!?with_raid:out}-raid \
--with%{!?with_ssl:out}-openssl \
--with%{!?with_tcpd:out}-libwrap \
+ %{?with_big_tables:--with-big-tables} \
--with-comment="PLD Linux Distribution MySQL RPM" \
--with%{!?debug:out}-debug \
--with-embedded-server \
--with-low-memory \
--with-mysqld-user=mysql \
--with-named-curses-libs="-lncurses" \
- --with-named-thread-libs="-lpthread" --with-pthread \
+ --with-named-thread-libs="-lpthread" \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-vio \
--with-ndbcluster \
--without-readline \
+ --without-libedit \
--without-docs
# --with-mysqlfs
+# --with-ndb-test --with-ndb-docs
# NOTE that /var/lib/mysql/mysql.sock is symlink to real sock file
# (it defaults to first cluster but user may change it to whatever
%endif
install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
+install %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/mysql/mysql-client.conf
# NDB
install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
%clean
-#rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
%pre
%groupadd -g 89 mysql
%triggerpostun -- mysql <= 4.1.1
# For better compatibility with prevoius versions:
-for config in `grep -v "^#" /etc/mysql/clusters.conf | cut -d"=" -f 1`; do
+for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
if echo "$config" | grep -q '^/'; then
config_file="$config"
elif [ -f "/etc/mysql/$config" ]; then
config_file=/etc/mysql/$config
else
+ clusterdir=$(awk -F= "/^$config/{print \$2}" /etc/mysql/clusters.conf)
config_file="$clusterdir/mysqld.conf"
fi
echo "Adding option old-passwords to config: $config_file"
echo "If you want to use new, better passwords - remove it"
- echo "# Compatibility options:" >> $config_file
- echo "old-passwords" >> $config_file
+
+ # sed magic to add 'old-passwords' to [mysqld] section
+ sed -i -e '/./{H;$!d;};x;/\[mysqld\]/{
+ a
+ a; Compatibility options:
+ aold-passwords
+ }
+ ' $config_file
done
%files
%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 mtime size) /etc/sysconfig/mysql
-%attr(751,root,root) %dir %{_sysconfdir}/mysql
%attr(640,root,mysql) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/clusters.conf
%attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
%attr(755,root,root) %{_bindir}/isamchk
%lang(hu) %{_datadir}/mysql/hungarian
%lang(it) %{_datadir}/mysql/italian
%lang(ja) %{_datadir}/mysql/japanese
-%lang(ja_JP.SJIS) %{_datadir}/mysql/japanese-sjis
+%lang(ja) %{_datadir}/mysql/japanese-sjis
%lang(ko) %{_datadir}/mysql/korean
%lang(nl) %{_datadir}/mysql/dutch
%lang(nb) %{_datadir}/mysql/norwegian
%attr(755,root,root) %{_bindir}/myisam_ftdump
%attr(755,root,root) %{_bindir}/mysql_secure_installation
%attr(755,root,root) %{_bindir}/mysql_tzinfo_to_sql
-%attr(755,root,root) %{_bindir}/mysql_client_test
%attr(755,root,root) %{_bindir}/mysqlcheck
%{_mandir}/man1/perror.1*
%{_mandir}/man1/replace.1*
%attr(755,root,root) %{_bindir}/mysqlshow
%attr(755,root,root) %{_bindir}/mysqlbinlog
%attr(755,root,root) %{_bindir}/mysqladmin
-%attr(755,root,root) %{_bindir}/mysqltest
%{_mandir}/man1/mysql.1*
%{_mandir}/man1/mysqladmin.1*
%{_mandir}/man1/mysqldump.1*
%defattr(644,root,root,755)
%doc EXCEPTIONS-CLIENT
%attr(755,root,root) %{_libdir}/lib*.so.*.*
+%attr(751,root,root) %dir %{_sysconfdir}/mysql
+%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysql/mysql-client.conf
%files devel
%defattr(644,root,root,755)
%files bench
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/mysqltest
+%attr(755,root,root) %{_bindir}/mysql_client_test
%dir %{_datadir}/sql-bench
%{_datadir}/sql-bench/[CDRl]*
%attr(755,root,root) %{_datadir}/sql-bench/[bcgirst]*