Remove per-edition config files

- Decide on default configuration based on /etc/os-release
This commit is contained in:
Stephen Gallagher 2015-03-12 16:27:57 -04:00
parent e24f6cfcb4
commit 4c9547c601

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: 3%{?dist}
Release: 4%{?dist}
URL: http://www.firewalld.org
License: GPLv2+
Source0: https://fedorahosted.org/released/firewalld/%{name}-%{version}.tar.bz2
@ -42,9 +42,12 @@ Requires: python3-firewall = %{version}-%{release}
%else #0%{?use_python3}
Requires: python2-firewall = %{version}-%{release}
%endif #0%{?use_python3}
%if 0%{?fedora} > 20
Requires: firewalld-config
%endif
# Remove old config subpackages
Obsoletes: firewalld-config-standard <= 0.3.13
Obsoletes: firewalld-config-cloud <= 0.3.13
Obsoletes: firewalld-config-server <= 0.3.13
Obsoletes: firewalld-config-workstation <= 0.3.13
%description
firewalld is a firewall service daemon that provides a dynamic customizable
@ -105,42 +108,6 @@ Requires: NetworkManager-glib
The firewall configuration application provides an configuration interface for
firewalld.
%if 0%{?fedora} > 20
%package config-standard
Summary: Firewalld standard configuration settings
Requires: firewalld = %{version}-%{release}
Provides: firewalld-config
Conflicts: system-release-server
Conflicts: firewalld-config-server
Conflicts: system-release-workstation
Conflicts: firewalld-config-workstation
%description config-standard
Standard product firewalld configuration settings.
%package config-server
Summary: Firewalld server configuration settings
Provides: firewalld-config
Requires: firewalld = %{version}-%{release}
Requires: system-release-server
Conflicts: firewalld-config-workstation
Conflicts: firewalld-config-standard
%description config-server
Server product specific firewalld configuration settings.
%package config-workstation
Summary: Firewalld workstation configuration settings
Provides: firewalld-config
Requires: firewalld = %{version}-%{release}
Requires: system-release-workstation
Conflicts: firewalld-config-server
Conflicts: firewalld-config-standard
%description config-workstation
Workstation product specific firewalld configuration settings.
%endif
%prep
%setup -q
%if 0%{?fedora}
@ -225,6 +192,37 @@ rm -f %{buildroot}%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.poli
%postun
%systemd_postun_with_restart firewalld.service
%posttrans
# Only on initial installation, not upgrades
if [ $1 -eq 0 ]
# 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
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 || :
;;
"Workstation")
ln -sf firewalld-workstation.conf %{_sysconfdir}/firewalld/firewalld.conf || :
ln -sf org.fedoraproject.FirewallD1.desktop.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
;;
*)
ln -sf firewalld-standard.conf %{_sysconfdir}/firewalld/firewalld.conf
# 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
fi
%post -n firewall-applet
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@ -255,50 +253,6 @@ fi
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%if 0%{?fedora} > 20
%post config-standard
if [ $1 -eq 1 ]; then # Initial installation
# link standard config
rm -f %{_sysconfdir}/firewalld/firewalld.conf
ln -sf firewalld-standard.conf %{_sysconfdir}/firewalld/firewalld.conf || :
fi
%triggerin config-standard -- firewalld
if [ $1 -eq 1 ]; then
# link server policy
rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
fi
%post config-server
if [ $1 -eq 1 ]; then # Initial installation
# link server config
rm -f %{_sysconfdir}/firewalld/firewalld.conf
ln -sf firewalld-server.conf %{_sysconfdir}/firewalld/firewalld.conf || :
fi
%triggerin config-server -- firewalld
if [ $1 -eq 1 ]; then
# link server policy
rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
ln -sf org.fedoraproject.FirewallD1.server.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
fi
%post config-workstation
if [ $1 -eq 1 ]; then # Initial installation
# link workstation config
rm -f %{_sysconfdir}/firewalld/firewalld.conf
ln -sf firewalld-workstation.conf %{_sysconfdir}/firewalld/firewalld.conf || :
fi
%triggerin config-workstation -- firewalld
if [ $1 -eq 1 ]; then
# link desktop policy
rm -f %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
ln -sf org.fedoraproject.FirewallD1.desktop.policy %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy || :
fi
%endif
%files -f %{name}.lang
%doc COPYING README
%{_sbindir}/firewalld
@ -311,9 +265,11 @@ fi
%{_prefix}/lib/firewalld/zones/*.xml
%{_prefix}/lib/firewalld/xmlschema/*.xsd
%attr(0750,root,root) %dir %{_sysconfdir}/firewalld
%if 0%{?fedora} <= 20
%config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%endif
%ghost %config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-standard.conf
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-server.conf
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-workstation.conf
%config(noreplace) %{_sysconfdir}/firewalld/lockdown-whitelist.xml
%attr(0750,root,root) %dir %{_sysconfdir}/firewalld/icmptypes
%attr(0750,root,root) %dir %{_sysconfdir}/firewalld/services
@ -325,9 +281,7 @@ fi
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/FirewallD.conf
%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.desktop.policy
%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.server.policy
%if 0%{?fedora} <= 20
%{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
%endif
%ghost %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
%{_mandir}/man1/firewall*cmd*.1*
%{_mandir}/man1/firewalld*.1*
%{_mandir}/man5/firewall*.5*
@ -395,24 +349,11 @@ fi
%{_datadir}/glib-2.0/schemas/org.fedoraproject.FirewallConfig.gschema.xml
%{_mandir}/man1/firewall-config*.1*
%if 0%{?fedora} > 20
%files config-standard
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-standard.conf
%ghost %config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%ghost %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
%files config-server
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-server.conf
%ghost %config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%ghost %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
%files config-workstation
%config(noreplace) %{_sysconfdir}/firewalld/firewalld-workstation.conf
%ghost %config(noreplace) %{_sysconfdir}/firewalld/firewalld.conf
%ghost %{_datadir}/polkit-1/actions/org.fedoraproject.FirewallD1.policy
%endif
%changelog
* 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
* Mon Feb 23 2015 Jiri Popelka <jpopelka@redhat.com> - 0.3.13-3
- use python3 bindings on fedora >=23