File sshguard.spec of Package sshguard

#
# 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.
#


Name:           sshguard
Version:        1.5
Release:        1
License:        GPLv2+
Summary:        Protect hosts from brute force attacks against ssh
Url:            http://www.sshguard.net
Group:          Productivity/Networking/Security
Source0:        http://downloads.sourceforge.net/sshguard/%{name}-%{version}.tar.bz2
Source1:        sshguard.init
Source2:        sysconfig.sshguard
Requires:       iptables
Requires:       openssh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(pre):  %fillup_prereq

%description
Sshguard protects networked hosts from brute force attacks
against ssh servers. It detects such attacks and blocks the
attacker's address with a firewall rule.

%prep
%setup -q

%build
%configure \
  --with-firewall=iptables \
  --with-iptables=%{_sbindir}/iptables
make %{_smp_mflags}

%install
%makeinstall
install -D -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.sshguard
install -D -m 744 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/sshguard
ln -s ../..%{_sysconfdir}/init.d/sshguard %{buildroot}%{_sbindir}/rcsshguard

%clean
rm -rf %{buildroot}

%post
%fillup_and_insserv sshguard

%preun
%stop_on_removal sshguard

%postun
%restart_on_update sshguard
%insserv_cleanup

%files
%defattr(-,root,root,-)
%doc Changes README examples/ scripts/
%{_sbindir}/*
%config %{_sysconfdir}/init.d/sshguard
%doc %{_mandir}/man8/%{name}*
%{_localstatedir}/adm/fillup-templates/sysconfig.sshguard

%changelog
openSUSE Build Service is sponsored by