mirror of
https://abf.rosa.ru/djam/mariadb.git
synced 2025-02-23 22:52:48 +00:00
Use config-based creation of users by systemd-sysusers, get rid of rpm-helper
This commit is contained in:
parent
43b012b17c
commit
fc1d5fbe04
2 changed files with 13 additions and 2 deletions
3
mariadb-sysusers.conf
Normal file
3
mariadb-sysusers.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
u @muser@ - "MySQL DB server" /srv/mysql
|
||||
g @muser@ -
|
||||
m @muser@ @muser@
|
12
mariadb.spec
12
mariadb.spec
|
@ -27,6 +27,7 @@ Source0: https://downloads.mariadb.com/MariaDB/mariadb-%{version}/source/mariadb
|
|||
Source100: mysqld.service
|
||||
Source101: mysqld-prepare-db-dir
|
||||
Source102: mysqld-wait-ready
|
||||
Source103: mariadb-sysusers.conf
|
||||
Source1000: %{name}.rpmlintrc
|
||||
BuildRequires: bison
|
||||
BuildRequires: cmake
|
||||
|
@ -307,14 +308,17 @@ Obsoletes: mysql-server < 5.7
|
|||
Provides: mysql-server = %{EVRD}
|
||||
# for the script mysqld_safe
|
||||
Requires: hostname
|
||||
Requires(post,preun): rpm-helper
|
||||
Requires(pre): /bin/systemd-sysusers
|
||||
|
||||
%description server
|
||||
The MariaDB server. For a full MariaDB database server, install
|
||||
package '%{name}'.
|
||||
|
||||
%pre server
|
||||
%_pre_useradd %{muser} /srv/mysql /sbin/nologin
|
||||
# https://nixtux.ru/1002
|
||||
%{expand:
|
||||
%(echo '%{sysusers_create_package %{name} %{SOURCE103}}' | sed -e 's,@muser@,%{muser},g')
|
||||
}
|
||||
|
||||
%post server
|
||||
%systemd_post mysqld.service
|
||||
|
@ -375,6 +379,7 @@ package '%{name}'.
|
|||
%{_bindir}/wsrep_*
|
||||
%{_sbindir}/mysqld
|
||||
%{_unitdir}/mysqld.service
|
||||
%{_sysusersdir}/%{name}.conf
|
||||
%{_sbindir}/mysqld-prepare-db-dir
|
||||
%{_bindir}/mysqld-wait-ready
|
||||
%doc %{_docdir}/%{name}-%{version}
|
||||
|
@ -615,3 +620,6 @@ rm -f %{buildroot}%{_datadir}/groonga-normalizer-mysql/README.md \
|
|||
%{buildroot}%{_datadir}/groonga/README.md \
|
||||
%{buildroot}%{_datadir}/mysql/mroonga/AUTHORS \
|
||||
%{buildroot}%{_datadir}/mysql/mroonga/COPYING
|
||||
|
||||
mkdir -p %{buildroot}%{_sysusersdir}
|
||||
cat %{SOURCE1033} | sed -e 's,@muser@,%{muser},g' > %{buildroot}%{_sysusersdir}/%{name}.conf
|
||||
|
|
Loading…
Add table
Reference in a new issue