Fix bugs with posttrans

- Remove nonexistent fedora-cloud.conf symlink
This commit is contained in:
Stephen Gallagher 2015-03-13 21:35:17 -04:00
parent 4c9547c601
commit 82cf3d8869

View File

@ -8,7 +8,7 @@
Summary: A firewall daemon with D-Bus interface providing a dynamic firewall
Name: firewalld
Version: 0.3.13
Release: 4%{?dist}
Release: 5%{?dist}
URL: http://www.firewalld.org
License: GPLv2+
Source0: https://fedorahosted.org/released/firewalld/%{name}-%{version}.tar.bz2
@ -193,20 +193,18 @@ rm -f %{buildroot}%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.poli
%systemd_postun_with_restart firewalld.service
%posttrans
# Only on initial installation, not upgrades
if [ $1 -eq 0 ]
# If we don't yet have a symlink or existing file for firewalld.conf,
# create it. Note: this will intentionally reset the policykit policy
# at the same time, so they are in sync.
if [ \! -e %{_sysconfdir}/firewalld/firewalld.conf ]; then
# Select the default config file based on /etc/os-release
variant=$(awk -F "=" '/VARIANT/ {print $2}' /etc/os-release) || :
rm -f %{_sysconfdir}/firewalld/firewalld.conf
rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
# Make sure that we remove any dangling links
rm -f %{_sysconfdir}/firewalld/firewalld.conf || :
rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
case $variant in
"Cloud")
ln -sf firewalld-cloud.conf %{_sysconfdir}/firewalld/firewalld.conf || :
# The Cloud edition will share the Server policy for now
ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
;;
"Server")
ln -sf firewalld-server.conf %{_sysconfdir}/firewalld/firewalld.conf || :
ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
@ -220,10 +218,9 @@ if [ $1 -eq 0 ]
# The standard firewall policy will be the same as Server
ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
;;
esac
esac
fi
%post -n firewall-applet
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@ -350,6 +347,10 @@ fi
%{_mandir}/man1/firewall-config*.1*
%changelog
* Fri Mar 13 2015 Stephen Gallagher <sgallagh@redhat.com> 0.3.13-5
- Fix bugs with posttrans
- Remove nonexistent fedora-cloud.conf symlink
* Fri Mar 13 2015 Stephen Gallagher <sgallagh@redhat.com> 0.3.13-4
- Remove per-edition config files
- Decide on default configuration based on /etc/os-release