File microfw.spec of Package microfw

#
# spec file for package microfw
#
# Copyright (c) 2022 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           microfw
Version:        2.0.1
Release:        %mkrel 1
Summary:        Tiny and simple firewall
License:        GPL-2.0+
Group:          Productivity/Security
URL:            https://build.opensuse.org/package/show/security/microfw
Source0:        %{name}-%{version}.tar.gz
Patch0:         microfw.diff
Conflicts:      gufw
Conflicts:      shorewall
Conflicts:      ufw
Conflicts:      firewalld
Conflicts:      nfw
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  systemd
Requires(post):   rpm-helper >= %{rpmhelper_required_version}
Requires(preun):  rpm-helper >= %{rpmhelper_required_version}
Requires(postun): rpm-helper >= %{rpmhelper_required_version}

%description
microfw is a tiny and simple firewall. It basically loads saved iptables/ip6tables rules
from %{_sysconfdir}/sysconfig/iptables and %{_sysconfdir}/sysconfig/ip6tables

%global debug_package %{nil}

%prep
%setup -q
%patch -P 0

%build

%install
install -D -m 755 %{name} %{buildroot}/%{_sbindir}/%{name}
install -D -m 644 %{name}.service %{buildroot}/%{_unitdir}/%{name}.service
install -D -m 644 iptables.rules %{buildroot}/%{_sysconfdir}/sysconfig/iptables
install -D -m 644 ip6tables.rules %{buildroot}/%{_sysconfdir}/sysconfig/ip6tables
install -D -m 644 sysconfig/%{name} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}

gzip -9 %{name}.8
install -D -m 644 %{name}.8.gz %{buildroot}/%{_mandir}/man8/%{name}.8.gz

%post
%_post_service %{name}
 
%preun
%_preun_service %{name}
 
%postun
%_postun_userdel %{name}

%files
%defattr(-,root,root)
%{_sbindir}/%{name}
%{_unitdir}/%{name}.service
%config(noreplace) %{_sysconfdir}/sysconfig/*
%{_mandir}/man8/*
%doc README LICENSE AUTHORS ChangeLog

%changelog
openSUSE Build Service is sponsored by