Switched to systemd-rpm macros

Resolves: rhbz#850276
This commit is contained in:
Jaroslav Škarvada 2013-02-25 16:31:05 +01:00
parent d23b2d999f
commit c2049bb859

View File

@ -40,18 +40,18 @@
Name: postfix Name: postfix
Summary: Postfix Mail Transport Agent Summary: Postfix Mail Transport Agent
Version: 2.10.0 Version: 2.10.0
Release: 0.1.rc1%{?dist} Release: 0.2.rc1%{?dist}
Epoch: 2 Epoch: 2
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://www.postfix.org URL: http://www.postfix.org
License: IBM License: IBM
Requires(post): systemd-units systemd-sysv Requires(post): systemd
Requires(post): %{_sbindir}/alternatives Requires(post): %{_sbindir}/alternatives
Requires(pre): %{_sbindir}/groupadd Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd Requires(pre): %{_sbindir}/useradd
Requires(preun): %{_sbindir}/alternatives Requires(preun): %{_sbindir}/alternatives
Requires(preun): systemd-units Requires(preun): systemd
Requires(postun): systemd-units Requires(postun): systemd
Provides: MTA smtpd smtpdaemon server(smtp) Provides: MTA smtpd smtpdaemon server(smtp)
Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}%{?prerelease}.tar.gz Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}%{?prerelease}.tar.gz
@ -321,7 +321,7 @@ do
done done
%post %post
[ $1 -eq 1 ] && bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_post %{name}.service
# upgrade configuration files if necessary # upgrade configuration files if necessary
%{_sbindir}/postfix set-permissions upgrade-configuration \ %{_sbindir}/postfix set-permissions upgrade-configuration \
@ -364,18 +364,15 @@ exit 0
exit 0 exit 0
%preun %preun
%systemd_preun %{name}.service
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
/bin/systemctl --no-reload disable postfix.service > /dev/null 2>&1 || :
/bin/systemctl stop postfix.service > /dev/null 2>&1 || :
%{_sbindir}/alternatives --remove mta %{postfix_command_dir}/sendmail.postfix %{_sbindir}/alternatives --remove mta %{postfix_command_dir}/sendmail.postfix
fi fi
exit 0 exit 0
%postun %postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_postun_with_restart %{name}.service
if [ "$1" -ge 1 ]; then
/bin/systemctl try-restart postfix.service >/dev/null 2>&1 || :
fi
%post sysvinit %post sysvinit
/sbin/chkconfig --add postfix >/dev/null 2>&1 ||: /sbin/chkconfig --add postfix >/dev/null 2>&1 ||:
@ -529,6 +526,10 @@ rm -rf $RPM_BUILD_ROOT
%endif %endif
%changelog %changelog
* Mon Feb 25 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 2:2.10.0-0.2.rc1
- Switched to systemd-rpm macros
Resolves: rhbz#850276
* Fri Feb 8 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 2:2.10.0-0.1.rc1 * Fri Feb 8 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 2:2.10.0-0.1.rc1
- New version - New version