From 317a76f48d0911db6c496f253d27f7a19fb0f01d Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 18:46:48 +0100 Subject: [PATCH] switched to systemd service file [release 0.33-4mamba;Tue Sep 02 2014] --- ufw.service | 12 ++++++++++++ ufw.spec | 36 +++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 ufw.service diff --git a/ufw.service b/ufw.service new file mode 100644 index 0000000..efba29a --- /dev/null +++ b/ufw.service @@ -0,0 +1,12 @@ +[Unit] +Description=Uncomplicated firewall +Before=network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/lib/ufw/ufw-init start quiet +ExecStop=/lib/ufw/ufw-init stop + +[Install] +WantedBy=multi-user.target diff --git a/ufw.spec b/ufw.spec index 80278f0..8506541 100644 --- a/ufw.spec +++ b/ufw.spec @@ -2,7 +2,7 @@ %define majver %(echo %version | cut -d. -f1-2) Name: ufw Version: 0.33 -Release: 3mamba +Release: 4mamba Summary: ufw is Uncomplicated Firewall a cli front end to iptables Group: System/Libraries/Python Vendor: openmamba @@ -10,16 +10,18 @@ Distribution: openmamba Packager: Ercole 'ercolinux' Carpanetto URL: https://launchpad.net/ufw Source: http://launchpad.net/ufw/%{majver}/%{version}/+download/ufw-%{version}.tar.gz +Source1: ufw.service Patch0: %{name}-0.30.1-initscript-chkconfig.patch Patch1: %{name}-0.30.1-enabled_by_default.patch Patch2: %{name}-0.30.1-load_netbios_ipt_module.patch License: GPL -Requires: python >= %python_version ## AUTOBUILDREQ-BEGIN BuildRequires: libpython-devel ## AUTOBUILDREQ-END BuildRequires: iptables BuildRequires: iptables-ipv6 +%systemd_requires +Requires: python >= %python_version Requires: iptables Requires: iptables-ipv6 BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -42,21 +44,21 @@ Ufw stands for Uncomplicated Firewall, and is program for managing a netfilter f --root="%{buildroot}" install -D %{buildroot}/lib/ufw/ufw-init %{buildroot}/etc/init.d/ufw-init +install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/ufw.service + %post -# new install +%systemd_post ufw if [ $1 -ge 1 ]; then - /sbin/chkconfig --add ufw-init - service ufw-init restart +# workaround + systemctl -q enable ufw fi -exit 0 +: %preun -#erase -if [ $1 -eq 0 ]; then - service ufw-init stop - /sbin/chkconfig --del ufw-init -fi -exit 0 +%systemd_preun ufw + +%postun +%systemd_postun_with_restart ufw %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" @@ -71,6 +73,7 @@ exit 0 %dir %{_sysconfdir}/ufw/applications.d %{_sysconfdir}/ufw/applications.d/ufw-* %{_sbindir}/ufw +%{_unitdir}/ufw.service %dir /lib/ufw /lib/ufw/ufw-init /lib/ufw/ufw-init-functions @@ -79,13 +82,16 @@ exit 0 %dir %{_datadir}/ufw %dir %{_datadir}/ufw/iptables %{_datadir}/ufw/iptables/*.rules -%{python_sitearch}/ufw-%{version}-py*.egg-info -%{python_sitearch}/ufw/*.py -%{python_sitearch}/ufw/*.pyc +%{python_sitelib}/ufw-%{version}-py*.egg-info +%{python_sitelib}/ufw/*.py +%{python_sitelib}/ufw/*.pyc %{_mandir}/man8/*.8.gz %{_datadir}/ufw/messages/*.mo %changelog +* Tue Sep 02 2014 Silvan Calarco 0.33-4mamba +- switched to systemd service file + * Sat May 25 2013 Silvan Calarco 0.33-3mamba - python 2.7 mass rebuild