Accepting request 848371 from home:kukuk:container

- Check first if they exist before creating user and group accounts
- Use macro for systemd-tmpfiles call
- Pre-Require shadow if we use it in %pre

OBS-URL: https://build.opensuse.org/request/show/848371
OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot?expand=0&rev=20
This commit is contained in:
Peter Varkoly 2020-11-18 10:13:33 +00:00 committed by Git OBS Bridge
parent 1f749fe696
commit 38124986f4
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Nov 13 14:11:59 UTC 2020 - Thorsten Kukuk <kukuk@suse.com>
- Check first if they exist before creating user and group accounts
-------------------------------------------------------------------
Thu Nov 5 14:33:43 UTC 2020 - Thorsten Kukuk <kukuk@suse.com>
- Use macro for systemd-tmpfiles call
- Pre-Require shadow if we use it in %pre
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 15 14:29:02 UTC 2020 - Thorsten Kukuk <kukuk@suse.com> Wed Jul 15 14:29:02 UTC 2020 - Thorsten Kukuk <kukuk@suse.com>

View File

@ -30,6 +30,7 @@ License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT
Group: Productivity/Networking/Email/Servers Group: Productivity/Networking/Email/Servers
URL: http://www.dovecot.org/ URL: http://www.dovecot.org/
PreReq: dovecot-implementation PreReq: dovecot-implementation
PreReq: shadow
Recommends: dovecot23 Recommends: dovecot23
#!BuildIgnore: dovecot-implementation #!BuildIgnore: dovecot-implementation
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -93,9 +94,9 @@ install -D -m 0644 %{S:9} %{buildroot}%{_unitdir}/dovecot.socket
%{buildroot}%{_var}/lib/%{name}/ %{buildroot}%{_var}/lib/%{name}/
%pre %pre
/usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || : getent group %{name} > /dev/null || /usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || :
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name} >/dev/null 2>&1 || : getent passwd %{name} > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name} >/dev/null 2>&1 || :
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull >/dev/null 2>&1 || : getent passwd dovenull > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull >/dev/null 2>&1 || :
# try to copy the default configuration. # try to copy the default configuration.
# #
# we fail silently if the dovecot-implementation package is not # we fail silently if the dovecot-implementation package is not
@ -121,7 +122,7 @@ fi
%if %{with systemd} %if %{with systemd}
%post %post
systemd-tmpfiles --create /usr/lib/tmpfiles.d/dovecot.conf || true %tmpfiles_create dovecot.conf
%service_add_post %{name}.service %{name}.socket %service_add_post %{name}.service %{name}.socket
%endif %endif