Accepting request 559954 from home:jengelh:branches:server:mail

- Replace %__-type macro indirections.
  Replace xargs rm by built in -delete of find(1).
- Run ldconfig directly via %post -p.
- Check for users in %pre before creating them, and do not suppress
  errors about it.

OBS-URL: https://build.opensuse.org/request/show/559954
OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot23?expand=0&rev=3
This commit is contained in:
Dirk Mueller 2018-01-09 13:47:47 +00:00 committed by Git OBS Bridge
parent 61e5cd10da
commit 4ea5f55590
2 changed files with 25 additions and 13 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Dec 25 22:39:53 UTC 2017 - jengelh@inai.de
- Replace %__-type macro indirections.
Replace xargs rm by built in -delete of find(1).
- Run ldconfig directly via %post -p.
- Check for users in %pre before creating them, and do not suppress
errors about it.
-------------------------------------------------------------------
Mon Dec 25 18:47:35 UTC 2017 - mrueckert@suse.de

View File

@ -316,9 +316,9 @@ dovecot tree.
pushd %{dovecot_pigeonhole_source_dir}
%patch2 -p1
popd
%{__gzip} -9v ChangeLog
gzip -9v ChangeLog
# Fix plugins dir.
%{__sed} -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf
sed -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf
%build
export CFLAGS="%{optflags}"
@ -389,11 +389,11 @@ make -C %{dovecot_pigeonhole_source_dir} test
%makeinstall -C %{dovecot_pigeonhole_source_dir} sieve_docdir=%{dovecot_pigeonhole_docdir}
# clean up unused files, as much as I would like to use -delete ... the old find on sles9 doesnt support it
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name \*.la -print0 | xargs -r0 rm -fv
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name \*.a -print0 | xargs -r0 rm -fv
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f \
'(' -name \*.la -o -name \*.a ')' -print -delete
# create /var directories
%{__install} -m 0755 -Dd \
install -m 0755 -Dd \
%{buildroot}%{_var}/run/%{pkg_name}/login/ \
%{buildroot}%{_var}/lib/%{pkg_name}/
@ -414,7 +414,7 @@ ln -sv \
popd
# additional docs for the main package
%{__install} -m 0644 \
install -m 0644 \
AUTHORS ChangeLog* COPYING* NEWS TODO README* \
%if %{with solr}
doc/*.xml \
@ -422,9 +422,9 @@ popd
%{buildroot}%{_docdir}/%{pkg_name}/
# install sieve docs
%{__install} -m 0755 -Dd %{buildroot}%{dovecot_pigeonhole_docdir}
install -m 0755 -Dd %{buildroot}%{dovecot_pigeonhole_docdir}
pushd %{dovecot_pigeonhole_source_dir}
%__sed -i 's/\r$//' doc/rfc/*
sed -i 's/\r$//' doc/rfc/*
cp -av AUTHORS COPYING* INSTALL NEWS README TODO \
examples/ doc/rfc/ doc/devel \
%{buildroot}%{dovecot_pigeonhole_docdir}/
@ -446,9 +446,13 @@ rm %{buildroot}%{_sysconfdir}/%{pkg_name}/README
%pre
test -n "$FIRST_ARG" || FIRST_ARG=$1
/usr/sbin/groupadd -r %{pkg_name} >/dev/null 2>&1 || :
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{pkg_name} %{pkg_name} >/dev/null 2>&1 || :
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{pkg_name} dovenull >/dev/null 2>&1 || :
getent group %{pkg_name} >/dev/null || /usr/sbin/groupadd -r %{pkg_name}
getent passwd %{pkg_name} >/dev/null || \
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r \
-c "User for Dovecot imapd" -d %{_var}/run/%{pkg_name} %{pkg_name}
getent passwd dovenull >/dev/null || \
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r \
-c "User for Dovecot login" -d %{_var}/run/%{pkg_name} dovenull
# do not let dovecot run during upgrade rhbz#134325
if [ "$FIRST_ARG" -ge "1" ]; then
rm -f %restart_flag
@ -469,8 +473,7 @@ if [ "$FIRST_ARG" -ge "1" ]; then
%endif
fi
%post
/sbin/ldconfig
%post -p /sbin/ldconfig
%postun
test -n "$FIRST_ARG" || FIRST_ARG=$1