From: Ivan Suzdal Date: Thu, 1 Oct 2015 08:27:38 +0000 (+0300) Subject: Add mysql-client Provides. X-Git-Tag: mos-9.0~5 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F12348%2F6;p=packages%2Fcentos7%2FMySQL-wsrep.git Add mysql-client Provides. Move useradd/groupadd up. Change-Id: I3817e2140559a4fb188d4c194b503b4e90cf4b9e --- diff --git a/mysql.spec b/mysql.spec index 0c73592..8b1e92f 100644 --- a/mysql.spec +++ b/mysql.spec @@ -200,7 +200,7 @@ Name: MySQL%{product_suffix} Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases Version: 5.6.23_wsrep_25.10 -Release: %{release}%{?dist}~mos8.0.2 +Release: %{release}%{?dist}~mos8.0.3 # Distribution: %{distro_description} License: Copyright (c) 2000, 2015, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field. Source: mysql-5.6.23.tar.gz @@ -338,6 +338,7 @@ Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl Provides: mysql = %{version}-%{release} Provides: mysql%{?_isa} = %{version}-%{release} Provides: MySQL-client-wsrep +Provides: mysql-client = %{version}-%{release} %description -n mysql-wsrep-client%{product_suffix} This package contains the standard MySQL clients and administration tools. @@ -425,6 +426,7 @@ and applications need to dynamically load and use MySQL. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 #wsrep_apply_patch_tag ############################################################################## %build @@ -554,6 +556,8 @@ install -d $RBR%{_includedir} install -d $RBR%{_libdir} install -d $RBR%{_mandir} install -d $RBR%{_sbindir} +install -d $RBR%{_var}/log/mysql +install -d $RBR%{_var}/run/mysqld mkdir -p $RBR%{_sysconfdir}/my.cnf.d @@ -582,9 +586,9 @@ ln -sf wsrep_sst_rsync $RBR%{_bindir}/wsrep_sst_rsync_wan # Touch the place where the my.cnf config file might be located # Just to make sure it's in the file list and marked as a config file -touch $RBR%{_sysconfdir}/my.cnf +#touch $RBR%{_sysconfdir}/my.cnf touch $RBR%{_sysconfdir}/wsrep.cnf - +install -m 660 $MBD/packaging/rpm-uln/my.cnf $RBR%{_sysconfdir}/my.cnf # Install SELinux files in datadir install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ @@ -612,6 +616,18 @@ install -m 644 "%{malloc_lib_source}" \ # ATTENTION: Parts of this are duplicated in the "triggerpostun" ! +# ---------------------------------------------------------------------- +# Create a MySQL user and group. Do not report any problems if it already +# exists. +# ---------------------------------------------------------------------- +getent group %{mysqld_group} || groupadd -r %{mysqld_group} +getent passwd %{mysqld_user} || \ +useradd -M -r -d %{mysqldatadir} -s /bin/bash -c "MySQL server" \ + -g %{mysqld_group} %{mysqld_user} +# The user may already exist, make sure it has the proper group nevertheless +# (BUG#12823) +usermod -g %{mysqld_group} %{mysqld_user} + # There are users who deviate from the default file system layout. # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] @@ -835,17 +851,6 @@ elif [ -x /sbin/insserv ] ; then /sbin/insserv %{_sysconfdir}/init.d/mysql fi -# ---------------------------------------------------------------------- -# Create a MySQL user and group. Do not report any problems if it already -# exists. -# ---------------------------------------------------------------------- -groupadd -r %{mysqld_group} 2> /dev/null || true -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \ - -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true -# The user may already exist, make sure it has the proper group nevertheless -# (BUG#12823) -usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true - # ---------------------------------------------------------------------- # Change permissions so that the user that will run the MySQL daemon # owns all database files. @@ -915,8 +920,8 @@ if [ -f /etc/redhat-release ] \ echo fi -if [ -x sbin/restorecon ] ; then - sbin/restorecon -R var/lib/mysql +if [ -x /sbin/restorecon ] ; then + /sbin/restorecon -R /var/lib/mysql fi # Was the server running before the upgrade? If so, restart the new one. @@ -1094,8 +1099,10 @@ echo "=====" >> $STATUS_HISTORY %doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1* %doc %attr(644, root, man) %{_mandir}/man1/resolveip.1* -%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf -%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf +#%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf +#%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf +%config %{_sysconfdir}/my.cnf +%config %{_sysconfdir}/wsrep.cnf %dir %{_sysconfdir}/my.cnf.d %attr(755, root, root) %{_bindir}/innochecksum @@ -1146,6 +1153,13 @@ echo "=====" >> $STATUS_HISTORY %attr(755, root, root) %{_datadir}/mysql/ %dir %attr(755, mysql, mysql) /var/lib/mysql +%dir %{_var}/log/mysql +%dir %{_var}/run/mysqld +%attr(755, mysql, mysql) %{_var}/run/mysqld + +#%dir %attr(755, root, root) /var/log/mysql +#%dir %attr(755, mysql, mysql) /var/run/mysqld + # ---------------------------------------------------------------------------- %files -n mysql-wsrep-client%{product_suffix}