From c5bad10817f8c77e59107ec7d8b35629dce33207 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 31 Dec 2023 12:37:33 +0100 Subject: [PATCH] - moved user/group scriptlets to mysql-common, dropped mysql home --- mysql.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mysql.spec b/mysql.spec index 17a16cf..7815a66 100644 --- a/mysql.spec +++ b/mysql.spec @@ -118,7 +118,6 @@ BuildRoot: %{tmpdir}/mysql-%{version}-root-%(id -u -n) %define _libexecdir %{_sbindir} %define _localstatedir /var/lib/%{name} -%define _mysqlhome /home/services/%{name} %define mysqldatadir share/mysql/%{mysqlversion} %define mysqllibdir %{_lib}/mysql/%{mysqlversion} @@ -546,7 +545,6 @@ CPPFLAGS="%{rpmcppflags}" \ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,sysconfig,mysql/%{mysqlversion},skel} \ $RPM_BUILD_ROOT/var/{log/{archive,}/mysql/%{mysqlversion},lib/{mysql,mysql-files}/%{mysqlversion}} \ - $RPM_BUILD_ROOT%{_mysqlhome} \ $RPM_BUILD_ROOT%{_libdir} %{__make} -C build install \ @@ -645,10 +643,6 @@ sed -i -e '/libs/s/-lprobes_mysql//' $RPM_BUILD_ROOT%{_libdir}/mysql/%{mysqlvers %clean rm -rf $RPM_BUILD_ROOT -%pre -%groupadd -g 89 mysql -%useradd -u 89 -d %{_mysqlhome} -s /bin/false -g mysql -c "%{name} Server" mysql - %post /sbin/ldconfig /sbin/chkconfig --add %{name} @@ -721,6 +715,14 @@ if [ "$1" = "0" ]; then update-alternatives --remove mysql_upgrade %{_libdir}/mysql/%{mysqlversion}/sbin/mysql_upgrade || : update-alternatives --remove mysqlcheck %{_libdir}/mysql/%{mysqlversion}/sbin/mysqlcheck || : update-alternatives --remove mysqld %{_libdir}/mysql/%{mysqlversion}/sbin/mysqld || : +fi + +%pre -n mysql-common +%groupadd -g 89 mysql +%useradd -u 89 -d /var/lib/mysql -s /bin/false -g mysql -c "MySQL Server" mysql + +%postun -n mysql-common +if [ "$1" = "0" ]; then %userremove mysql %groupremove mysql fi @@ -1036,7 +1038,6 @@ fi %{_datadir}/mysql/%{mysqlversion}/man/man1/*resolve_stack_dump.1* %endif -%attr(700,mysql,mysql) %{_mysqlhome} %attr(640,mysql,mysql) %ghost /var/log/mysql/%{mysqlversion}/* # This is template for configuration file which is created after 'service mysql init' -- 2.46.0