A new user interface for you! Read more...

File ferm.spec of Package ferm

#
# spec file for package ferm
#
# Copyright (c) 2016 SUSE LINUX Products 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/
#

%if 0%{?suse_version} > 1230 || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600 || 0%{?fedora_version} >= 20 || 0%{?el7}%{?fc20}%{?fc21}%{?fc22}%{?fc23}%{?fc24}%{?fc25}
%bcond_without  systemd
%else
%bcond_with     systemd
%endif

Name:           ferm
Version:        2.4.1
Release:        0
License:        GPL-2.0
Summary:        A tool to maintain complex firewalls
Url:            http://ferm.foo-projects.org/
Group:          Productivity/Networking/Security
Source:         http://ferm.foo-projects.org/download/2.4/ferm-%{version}.tar.xz
%if %{with systemd}
BuildRequires:  pkgconfig(systemd)
%{?systemd_requires}
%endif
Requires:       iptables
Requires:       perl
Recommends:     perl-Net-DNS
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
ferm is a tool to maintain complex firewalls, without having the trouble to
rewrite the complex rules over and over again. ferm allows the entire firewall
rule set to be stored in a separate file, and to be loaded with one command.
The firewall configuration resembles structured programming-like language,
which can contain levels and lists.

%prep
%setup -q

%build

%install
make install PREFIX=%{buildroot}%{_prefix} SERVICEDIR=%{buildroot}%{_unitdir} MANDIR=%{buildroot}%{_mandir}/man1 DOCDIR=%{buildroot}%{_datadir}/doc/packages/ferm
%if %{with systemd}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%endif
install -d -m 0750 %{buildroot}%{_sysconfdir}/ferm/
install    -m 0640 examples/workstation.ferm %{buildroot}%{_sysconfdir}/ferm.conf

%pre
# START BIG SYSTEMD
%if %{with systemd}
%if 0%{?suse_version}
%service_add_pre %{name}.service
%endif

%preun
%if 0%{?suse_version}
%service_del_preun %{name}.service
%else
%systemd_preun %{name}.service
%endif

%post
%if 0%{?suse_version}
%service_add_post %{name}.service
%else
%systemd_post %{name}.service
%endif

%postun
%if 0%{?suse_version}
%service_del_postun %{name}.service
%else
%systemd_postun_with_restart %{name}.service
%endif
%endif
# /END BIG SYSTEMD

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/ferm/
%config(noreplace) %{_sysconfdir}/ferm.conf
%if %{with systemd}
%{_unitdir}/ferm.service
%if 0%{?suse_version}
%{_sbindir}/rcferm
%endif
%endif
%{_sbindir}/ferm
%{_sbindir}/import-ferm
%{_mandir}/man1/ferm.1*
%{_mandir}/man1/import-ferm.1*
%doc %{_datadir}/doc/packages/ferm/