SHA256
1
0
forked from pool/courier-imap

Accepting request 459245 from home:kukuk:branches:server:mail

- Don't call insserv if we use systemd
- Don't install LSB init scripts if we use systemd
- Create rc* links to service command if we use systemd

OBS-URL: https://build.opensuse.org/request/show/459245
OBS-URL: https://build.opensuse.org/package/show/server:mail/courier-imap?expand=0&rev=77
This commit is contained in:
Christian Wittmer 2017-03-04 17:49:08 +00:00 committed by Git OBS Bridge
parent 710f11096f
commit 0b6377b17c
2 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Feb 20 14:53:44 CET 2017 - kukuk@suse.de
- Don't call insserv if we use systemd
- Don't install LSB init scripts if we use systemd
- Create rc* links to service command if we use systemd
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 20 10:34:20 CEST 2016 - kukuk@suse.de Fri May 20 10:34:20 CEST 2016 - kukuk@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package courier-imap # spec file for package courier-imap
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -146,10 +146,16 @@ install the entire Courier server.
%{__install} -D -m 644 $RPM_SOURCE_DIR/pop3.pamd %{buildroot}/etc/pam.d/pop3 %{__install} -D -m 644 $RPM_SOURCE_DIR/pop3.pamd %{buildroot}/etc/pam.d/pop3
%{__install} -D -m 644 $RPM_SOURCE_DIR/imap.pamd %{buildroot}/etc/pam.d/imap %{__install} -D -m 644 $RPM_SOURCE_DIR/imap.pamd %{buildroot}/etc/pam.d/imap
# Install init scripts # Install init scripts
%if 0%{?has_systemd}
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%{__ln_s} -f service %{buildroot}%{_prefix}/sbin/rccourier-$i
done
%else
for i in imap imap-ssl pop pop-ssl ; do for i in imap imap-ssl pop pop-ssl ; do
%{__install} -D -m 0755 $RPM_SOURCE_DIR/courier-$i.init %{buildroot}/etc/init.d/courier-$i %{__install} -D -m 0755 $RPM_SOURCE_DIR/courier-$i.init %{buildroot}/etc/init.d/courier-$i
%{__ln_s} -f /etc/init.d/courier-$i %{buildroot}%{_prefix}/sbin/rccourier-$i %{__ln_s} -f /etc/init.d/courier-$i %{buildroot}%{_prefix}/sbin/rccourier-$i
done done
%endif
# Install service files # Install service files
%if 0%{?has_systemd} %if 0%{?has_systemd}
for j in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do for j in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
@ -198,15 +204,16 @@ done
%endif %endif
%preun %preun
%if 0%{?has_systemd}
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_del_preun courier-$i.service
done
%else
%if 0%{?suse_version} %if 0%{?suse_version}
for i in imap imap-ssl pop pop-ssl; do for i in imap imap-ssl pop pop-ssl; do
%stop_on_removal courier-$i %stop_on_removal courier-$i
done done
%endif %endif
%if 0%{?has_systemd}
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_del_preun courier-$i.service
done
%endif %endif
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
%{__rm} -f %{_localstatedir}/couriersslcache %{__rm} -f %{_localstatedir}/couriersslcache
@ -222,7 +229,6 @@ fi
%post %post
%{_datadir}/%{name}/sysconftool `%{__cat} %{_datadir}/%{name}/configlist` >/dev/null %{_datadir}/%{name}/sysconftool `%{__cat} %{_datadir}/%{name}/configlist` >/dev/null
%if 0%{?has_systemd} %if 0%{?has_systemd}
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_add_post courier-$i.service %service_add_post courier-$i.service
@ -230,14 +236,15 @@ done
%endif %endif
%postun %postun
for i in imap imap-ssl pop pop-ssl; do
%restart_on_update courier-$i
done
%insserv_cleanup
%if 0%{?has_systemd} %if 0%{?has_systemd}
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_del_postun courier-$i.service %service_del_postun courier-$i.service
done done
%else
for i in imap imap-ssl pop pop-ssl; do
%restart_on_update courier-$i
done
%insserv_cleanup
%endif %endif
%clean %clean
@ -247,7 +254,9 @@ done
%defattr(-,root,root,755) %defattr(-,root,root,755)
%doc AUTHORS libs/imap/ChangeLog COPYING* libs/imap/BUGS README README.imap README.maildirquota README.proxy %doc AUTHORS libs/imap/ChangeLog COPYING* libs/imap/BUGS README README.imap README.maildirquota README.proxy
%doc README.sharedfolders %doc README.sharedfolders
%if !0%{?has_systemd}
%attr(755,root,root) /etc/init.d/courier-* %attr(755,root,root) /etc/init.d/courier-*
%endif
%config %attr(644,root,root) /etc/pam.d/imap %config %attr(644,root,root) /etc/pam.d/imap
%config %attr(644,root,root) /etc/pam.d/pop3 %config %attr(644,root,root) /etc/pam.d/pop3
%dir %{_sysconfdir}/courier %dir %{_sysconfdir}/courier