Hello community,

here is the log from the commit of package apache2-mod_evasive for 
openSUSE:Factory checked in at 2013-01-29 12:00:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apache2-mod_evasive (Old)
 and      /work/SRC/openSUSE:Factory/.apache2-mod_evasive.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apache2-mod_evasive", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/apache2-mod_evasive/apache2-mod_evasive.changes  
2012-09-06 08:43:02.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.apache2-mod_evasive.new/apache2-mod_evasive.changes 
    2013-01-29 12:00:46.000000000 +0100
@@ -1,0 +2,14 @@
+Mon Jan 28 18:47:38 UTC 2013 - [email protected]
+
+- Introduce compatibility with Apache 2.4 (changed API: remote_ip
+  was renamed to client_ip):
+  + apxs2 was moved from %{_sbindir} to %{_bindir}: use "which" to
+    actually find it.
+  + Set apache_branch to $major.$minor, so it can be used for
+    evaluation further down.
+  + set ap_suffix and rename the .so modules to mod_evasive24.so
+    when building for apache 2.4.x API.
+- Fix the requires on apache_mmn: this only worked becuase the
+  Requires was on one line.. but %apache_mmn was always empty.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ apache2-mod_evasive.spec ++++++
--- /var/tmp/diff_new_pack.zPkSaj/_old  2013-01-29 12:00:48.000000000 +0100
+++ /var/tmp/diff_new_pack.zPkSaj/_new  2013-01-29 12:00:48.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package apache2-mod_evasive
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 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
@@ -20,13 +20,13 @@
 Version:        1.10.1
 Release:        0
 Summary:        Denial of Service evasion module for Apache
+License:        GPL-2.0+
+Group:          Productivity/Networking/Web/Servers
 #
 # 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
@@ -39,12 +39,20 @@
 BuildRequires:  gcc-c++
 BuildRequires:  pcre-devel
 
-%define apxs              %_sbindir/apxs2
+%define apache_branch     %(rpm -q --qf %%{version} apache2 | grep -E -o 
"2\\.[0-9]+")
+%if "%{apache_branch}" == "2.4"
+  %define ap_suffix 24
+  %define apxs %{_bindir}/apxs2
+%else
+  %define ap_suffix 20
+  %define apxs %{_sbindir}/apxs2
+%endif
 %define apache_libexecdir %(%apxs -q LIBEXECDIR)
 %define apache_sysconfdir %(%apxs -q SYSCONFDIR)
-%define apache_mmn        %(MMN=$(%apxs -q LIBEXECDIR)/MMN; test -x $MMN && 
$MMN)
+%define apache_mmn        %(MMN=$(%apxs -q LIBEXECDIR)_MMN; test -x $MMN && 
$MMN)
 
-Requires:       apache2 %apache_mmn
+Requires:       %apache_mmn
+Requires:       apache2
 
 %description
 mod_evasive is an evasive maneuvers module for Apache to provide
@@ -59,21 +67,26 @@
 %patch -P 1 -p1
 
 %build
-%apxs -Wc,"%optflags" -c mod_evasive20.c;
+%if %{ap_suffix} == 24
+# create apache httpd-2.4 version and compile it
+sed 's/connection->remote_ip/connection->client_ip/' \
+  < mod_evasive20.c > mod_evasive%{ap_suffix}.c
+%endif
+%apxs -Wc,"%{optflags}" -c mod_evasive%{ap_suffix}.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;
+       -n mod_evasive%{ap_suffix}.so mod_evasive%{ap_suffix}.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
+%apache_libexecdir/mod_evasive%{ap_suffix}.so
 %config(noreplace) %apache_sysconfdir/conf.d/mod_evasive.conf
 %doc CHANGELOG LICENSE README test.pl
 

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to