File apache2-mod_evasive.spec of Package apache2-mod_evasive
#
# spec file for package apache2-mod_evasive
#
# Copyright (c) 2012 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/
#
Name: apache2-mod_evasive
Version: 1.10.1
Release: 0
Summary: Denial of Service evasion module for Apache
#
# Only mod_evasive20.c (GPL-2.0+) is provided in object form.
# mod_evasive.c (GPL-2.0) and mod_evasiveNSAPI.c (non-OSI compliant)
# are merely shipped unmodified, fulfilling their terms.
#
License: GPL-2.0+
Group: Productivity/Networking/Web/Servers
Url: http://zdziarski.com/blog/?page_id=442
Source: http://zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_%version.tar.gz
Source2: mod_evasive.conf
Patch1: modev-return.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: apache2-devel
BuildRequires: apache2-prefork
BuildRequires: curl-devel
BuildRequires: gcc-c++
BuildRequires: pcre-devel
%define apxs %_sbindir/apxs2
%define apache_libexecdir %(%apxs -q LIBEXECDIR)
%define apache_sysconfdir %(%apxs -q SYSCONFDIR)
%define apache_mmn %(MMN=$(%apxs -q LIBEXECDIR)/MMN; test -x $MMN && $MMN)
Requires: apache2 %apache_mmn
%description
mod_evasive is an evasive maneuvers module for Apache to provide
evasive action in the event of an HTTP DoS or DDoS attack or brute
force attack. It is also designed to be a detection and network
management tool, and can be easily configured to talk to ipchains,
firewalls, routers, and etcetera. mod_evasive presently reports
abuses via email and syslog facilities.
%prep
%setup -qn mod_evasive
%patch -P 1 -p1
%build
%apxs -Wc,"%optflags" -c mod_evasive20.c;
%install
b="%buildroot"
mkdir -p "$b/%apache_libexecdir" "$b/%apache_sysconfdir/conf.d"
%apxs -i -S LIBEXECDIR="%buildroot/%apache_libexecdir" \
-n mod_evasive20.so mod_evasive20.la;
cp -a "%{S:2}" "$b/%apache_sysconfdir/conf.d/";
perl -i -pe "s{/usr/lib/}{%_libdir/}g" \
"$b/%apache_sysconfdir/conf.d/mod_evasive.conf";
%files
%defattr(-,root,root)
%apache_libexecdir/mod_evasive20.so
%config(noreplace) %apache_sysconfdir/conf.d/mod_evasive.conf
%doc CHANGELOG LICENSE README test.pl
%changelog