diff --git a/firewalld.spec b/firewalld.spec index b24a706..220c7f2 100644 --- a/firewalld.spec +++ b/firewalld.spec @@ -1,7 +1,7 @@ Summary: A firewall daemon with D-Bus interface providing a dynamic firewall Name: firewalld Version: 1.0.0 -Release: 0.2.alpha%{?dist} +Release: 0.3.alpha%{?dist} URL: http://www.firewalld.org License: GPLv2+ #Source0: https://github.com/firewalld/firewalld/releases/download/v%{version}/firewalld-%{version}.tar.gz @@ -82,6 +82,27 @@ Requires: dbus-x11 The firewall configuration application provides an configuration interface for firewalld. +%pretrans -p +-- HACK: Old rpm versions had an untracked (%ghost) symlink for +-- /etc/firewalld/firewalld.conf. RPM won't handle replacing the symlink due to +-- "%config(noreplace)". As such, we remove the symlink here before attempting +-- to install the new version which is a real file. Only replace the symlink if +-- the target matches one of the previous package's expected targets. +-- +-- Unfortunately this must be done in pretrans in order to occur before RPM +-- makes decisions about file replacement. +-- +local old_package_symlinks = {"firewalld-standard.conf", "firewalld-server.conf", + "firewalld-workstation.conf"} + +local symlink_target = posix.readlink("%{_sysconfdir}/firewalld/firewalld.conf") +for k,v in ipairs(old_package_symlinks) do + if symlink_target == v then + posix.unlink("%{_sysconfdir}/firewalld/firewalld.conf") + break + end +end + %prep %autosetup -p1 @@ -202,6 +223,10 @@ install -d -m 755 %{buildroot}%{_prefix}/lib/firewalld/zones/ %{_mandir}/man1/firewall-config*.1* %changelog +* Mon Jun 07 2021 Eric Garver - 1.0.0-0.3.alpha +- remove dead symlink (firewalld.conf) left over from old package versions + before installing new file + * Tue Jun 01 2021 Eric Garver - 1.0.0-0.2.alpha - fix missing policy kit symlink