]> 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 8d609bd42af8e29faf372f25c9d1a3cadd98de55..8ff7142994b827d0fef7c59bc14b0fc76c2a2754 100644 (file)
@@ -23,11 +23,11 @@ Summary(uk):        MySQL - 
 Summary(zh_CN):        MySQLÊý¾Ý¿â·þÎñÆ÷
 Name:          mysql
 Group:         Applications/Databases
-Version:       4.1.12
-Release:       1.4
+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
@@ -65,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
@@ -85,7 +85,6 @@ Provides:     msqlormysql
 Provides:      user(mysql)
 Obsoletes:     MySQL
 Obsoletes:     mysql-server
-Obsoletes:     mysql-doc < 4.1.12
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _libexecdir     %{_sbindir}
@@ -255,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.
@@ -550,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
@@ -565,7 +559,7 @@ 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
@@ -581,17 +575,20 @@ rm -rf $RPM_BUILD_ROOT
 %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
 
@@ -677,8 +674,18 @@ for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
                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"
 
@@ -691,9 +698,15 @@ for config in $(awk -F= '!/^#/ && /=/{print $1}' /etc/mysql/clusters.conf); do
        ' $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
@@ -718,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
This page took 0.028017 seconds and 4 git commands to generate.