$ git show --format=fuller --patch-with-stat --summary 0daf1e0fe23068b3a260011e30a06ab79eb79afd
commit 0daf1e0fe23068b3a260011e30a06ab79eb79afd
Author: tpgxyz <tpgxyz@gmail.com>
AuthorDate: Wed Jan 8 14:40:20 2020 +0100
Commit: tpgxyz <tpgxyz@gmail.com>
CommitDate: Wed Jan 8 14:40:20 2020 +0100
spec file clean
---
ufw.spec | 82 +++++++++++++++++++++++++++++-----------------------------------
1 file changed, 37 insertions(+), 45 deletions(-)
diff --git a/ufw.spec b/ufw.spec
index 59d38f0..3b8f083 100644
--- a/ufw.spec
+++ b/ufw.spec
@@ -1,15 +1,14 @@
-Name: ufw
-Version: 0.35
-Release: 1
-Summary: Uncomplicated Firewall
-
-License: GPLv3
-URL: https://launchpad.net/%{name}
-Source0: https://launchpad.net/%{name}/%{version}/%{version}/+download/ufw-%{version}.tar.gz
+Summary: Uncomplicated Firewall
+Name: ufw
+Version: 0.35
+Release: 2
+License: GPLv3
+URL: https://launchpad.net/%{name}
+Source0: https://launchpad.net/%{name}/%{version}/%{version}/+download/ufw-%{version}.tar.gz
# systemd service file
-Source1: ufw.service
+Source1: ufw.service
# Install translations to the systemwide standard location for %%find_lang
-Patch0: ufw-0.35-trans-dir.patch
+Patch0: ufw-0.35-trans-dir.patch
# Separate libexec_dir from state_dir because the state files must go into /var,
# whereas the scripts don't belong there (we install them to /usr/libexec
# instead). Upstream used to install everything into /lib/ufw, a hack to make
@@ -17,46 +16,39 @@ Patch0: ufw-0.35-trans-dir.patch
# must not contain writable state data according to Fedora packaging guidelines.
# Now, upstream essentially uses state_dir only for libexec-type stuff, and has
# moved user.rules and user6.rules back to /etc, we move them back to /var/lib.
-Patch1: ufw-0.35-libexec-dir.patch
+Patch1: ufw-0.35-libexec-dir.patch
# Default to enabled, let systemd handle whether ufw is actually enabled
-Patch2: ufw-0.34~rc-default-enabled.patch
+Patch2: ufw-0.34~rc-default-enabled.patch
# Allow SSH connections by default
-Patch3: ufw-0.34~rc-default-allow-ssh.patch
+Patch3: ufw-0.34~rc-default-allow-ssh.patch
# Define multicast protocols (mDNS, UPnP) as a normal protocol profile
# Use a managed rule instead of a "before" rule for default-allowing mDNS
# Do not allow UPnP by default at all, document in ufw.8 how it can be allowed
# Update the README file and the ufw.8 manpage according to the above changes
-Patch4: ufw-0.34~rc-multicast.patch
+Patch4: ufw-0.34~rc-multicast.patch
# Add protocol profiles for KDE Connect (#1257699) and Icecream (#1262009)
-Patch5: ufw-0.34~rc-additional-profiles.patch
+Patch5: ufw-0.34~rc-additional-profiles.patch
# Fix check-requirements for Python 3.5, add 3.6, remove unsupported 3.2/3.3
-Patch6: ufw-0.35-python36.patch
+Patch6: ufw-0.35-python36.patch
# Change permissions of the *.rules files from 0640 to 0644
# Change permissions of the before.init and after.init hooks from 0640 to 0755
-Patch7: ufw-0.35-permissions.patch
+Patch7: ufw-0.35-permissions.patch
# Don't prepend /usr/bin/env to sys.executable, which is always an absolute path
-Patch8: ufw-0.35-no-pointless-env.patch
-
-BuildArch: noarch
-
-BuildRequires: python-devel
-BuildRequires: iptables
-BuildRequires: gettext
-BuildRequires: systemd
-
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-
-Requires: systemd
-Requires: iptables
-
+Patch8: ufw-0.35-no-pointless-env.patch
+
+BuildArch: noarch
+#BuildRequires: pkgconfig(python)
+BuildRequires: iptables
+BuildRequires: gettext
+BuildRequires: systemd-macros
+Requires: iptables
+
%description
The Uncomplicated Firewall(ufw) is a front-end for netfilter, which
aims to make it easier for people unfamiliar with firewall concepts.
Ufw provides a framework for managing netfilter as well as
manipulating the firewall.
-
+
%prep
%setup -q
%patch0 -p1 -b .trans-dir
@@ -70,23 +62,22 @@ rm -f profiles/*.additional-profiles
%patch6 -p1 -b .python36
%patch7 -p1 -b .permissions
%patch8 -p1 -b .no-pointless-env
-
+
%build
%py_build
+
%install
%py_install
+
install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/ufw.service
+
+install -d %{buildroot}%{_presetdir}
+cat > %{buildroot}%{_presetdir}/86-ufw.preset << EOF
+enable ufw.service
+EOF
+
%find_lang %{name}
-
-%post
-%systemd_post ufw.service
-
-%preun
-%systemd_preun ufw.service
-
-%postun
-%systemd_postun_with_restart ufw.service
-
+
%files -f %{name}.lang
%license COPYING
%doc ChangeLog README TODO AUTHORS
@@ -95,6 +86,7 @@ install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/ufw.service
%{python3_sitelib}/ufw-%{version}-py*.egg-info
%{python3_sitelib}/ufw/
%{_datadir}/ufw/
+%{_presetdir}/86-ufw.preset
%{_unitdir}/ufw.service
# config files under /etc, directly user-editable, should survive updates
%dir %{_sysconfdir}/ufw/