]> git.pld-linux.org Git - packages/mysql.git/blobdiff - mysql.spec
- ignore error from mysql restart in %post. it doesn't give any value not having...
[packages/mysql.git] / mysql.spec
index 70bbc781721b713d55cd2d0c562339793e98cc24..8ff7142994b827d0fef7c59bc14b0fc76c2a2754 100644 (file)
@@ -2,7 +2,6 @@
 # - 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
@@ -11,6 +10,7 @@
 %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
@@ -23,11 +23,11 @@ Summary(uk):        MySQL - 
 Summary(zh_CN):        MySQLÊý¾Ý¿â·þÎñÆ÷
 Name:          mysql
 Group:         Applications/Databases
-Version:       4.1.12
-Release:       0.2
+Version:       4.1.14
+Release:       2
 License:       GPL + MySQL FLOSS Exception
 Source0:       http://mysql.dataphone.se/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
-# Source0-md5: 56a6f5cacd97ae290e07bbe19f279af1
+# Source0-md5: 98ba9caea24b0a48ee06bb242ff2e37f
 Source1:       %{name}.init
 Source2:       %{name}.sysconfig
 Source3:       %{name}.logrotate
@@ -40,6 +40,7 @@ Source9:      %{name}-ndb-mgm.init
 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
@@ -48,6 +49,7 @@ Patch4:               %{name}-sql-cxx-pic.patch
 Patch5:                %{name}-noproc.patch
 Patch6:                %{name}-fix_privilege_tables.patch
 Patch7:                %{name}-align.patch
+Patch8:                %{name}-client-config.patch
 Icon:          mysql.gif
 URL:           http://www.mysql.com/
 #BuildRequires:        ORBit-devel
@@ -63,7 +65,7 @@ BuildRequires:        perl-DBI
 BuildRequires: perl-devel >= 1:5.6.1
 BuildRequires: readline-devel >= 4.2
 BuildRequires: rpm-perlprov >= 4.1-13
-BuildRequires: rpmbuild(macros) >= 1.202
+BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: texinfo
 BuildRequires: zlib-devel
 PreReq:                rc-scripts >= 0.2.0
@@ -74,6 +76,7 @@ Requires(pre):        /usr/sbin/useradd
 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
@@ -251,6 +254,7 @@ Summary:    Shared libraries for MySQL
 Summary(pl):   Biblioteki dzielone MySQL
 Group:         Applications/Databases
 Obsoletes:     libmysql10
+Obsoletes:     mysql-doc < 4.1.12
 
 %description libs
 Shared libraries for MySQL.
@@ -422,6 +426,7 @@ Ten pakiet zawiera standardowego demona MySQL NDB CPC.
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 %{__perl} -pi -e 's@(ndb_bin_am_ldflags)="-static"@$1=""@' configure.in
 
@@ -452,6 +457,7 @@ CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
        --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 \
@@ -459,13 +465,15 @@ CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
        --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
@@ -519,6 +527,7 @@ touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
 %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
@@ -541,12 +550,6 @@ rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test
 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}comp_err
 mv $RPM_BUILD_ROOT%{_bindir}/{,mysql_}resolve_stack_dump
 
-# not our OS
-rm $RPM_BUILD_ROOT%{_bindir}/make_win_*_distribution
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.plist
-# unuseful stuff
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.spec
-
 # functionality in initscript / rpm
 rm $RPM_BUILD_ROOT%{_bindir}/mysql_create_system_tables
 rm $RPM_BUILD_ROOT%{_bindir}/mysql_install_db
@@ -556,14 +559,14 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/mysqld_{multi,safe}*
 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/fill_help_tables.sql
 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql-log-rotate
 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/mysql.server
-rm $RPM_BUILD_ROOT%{_datadir}/%{name}/{pre,post}install
+rm $RPM_BUILD_ROOT%{_datadir}/%{name}/binary-configure
 rm $RPM_BUILD_ROOT%{_bindir}/mysql_waitpid
 
 # in %doc
 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
 
 %clean
-#rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 
 %pre
 %groupadd -g 89 mysql
@@ -572,17 +575,20 @@ rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.{ini,cnf}
 %post
 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
 /sbin/chkconfig --add mysql
-if [ -f /var/lock/subsys/mysql ]; then
-       /etc/rc.d/init.d/mysql restart >&2
-else
-       echo "Run \"/etc/rc.d/init.d/mysql start\" to start mysql." >&2
+
+if [ "$1" = 1 ]; then
+       %banner -e %{name}-4.1.x <<-EOF
+       If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
+       zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
+EOF
+#'
 fi
 
+%service mysql restart || :
+
 %preun
 if [ "$1" = "0" ]; then
-       if [ -f /var/lock/subsys/mysql ]; then
-               /etc/rc.d/init.d/mysql stop
-       fi
+       %service -q mysql stop
        /sbin/chkconfig --del mysql
 fi
 
@@ -661,27 +667,49 @@ fi
 
 %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)
+               if [ -z "$clusterdir" ]; then
+                       echo >&2 "Can't find cluster dir for $config!"
+                       echo >&2 "Please remove extra (leading) spaces from /etc/mysql/clusters.conf"
+                       exit 1
+               fi
                config_file="$clusterdir/mysqld.conf"
        fi
+
+       if [ ! -f "$config_file" ]; then
+                       echo >&2 "Lost myself! Please report this (with above errors, if any) to http://bugs.pld-linux.org/"
+                       exit 1
+       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
 
+%banner -e %{name}-4.1.x <<-EOF
+       If you want to use new help tables in mysql 4.1.x then you'll need to import the help data:
+       zcat %{_docdir}/%{name}-%{version}/fill_help_tables.sql.gz | mysql mysql
+EOF
+#'
+
 %files
 %defattr(644,root,root,755)
-%doc support-files/*.cnf support-files/*.ini
+%doc support-files/*.cnf support-files/*.ini scripts/fill_help_tables.sql
 %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
@@ -703,7 +731,7 @@ done
 %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 mtime size) /var/log/mysql/*
+%attr(640,mysql,mysql) %ghost /var/log/mysql/*
 
 %{_infodir}/mysql.info*
 %dir %{_datadir}/mysql
@@ -745,7 +773,6 @@ done
 %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*
@@ -784,6 +811,8 @@ done
 %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)
@@ -802,6 +831,7 @@ done
 %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]*
This page took 0.038076 seconds and 4 git commands to generate.