From: Marcin Krol Date: Sun, 31 Dec 2023 11:36:17 +0000 (+0100) Subject: - moved user/group scriptlets to mysql-common, dropped mysql home X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=ce7a8d7cec62248f01c6c445ae9c6cad201da090;p=packages%2Fmysql.git - moved user/group scriptlets to mysql-common, dropped mysql home --- diff --git a/mysql.spec b/mysql.spec index ed861ef..ad3da8a 100644 --- a/mysql.spec +++ b/mysql.spec @@ -120,7 +120,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} @@ -548,7 +547,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 \ @@ -647,10 +645,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} @@ -723,6 +717,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 @@ -1038,7 +1040,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'