File dba-apache2-mod_security-290.spec of Package dba-apache2-mod_security-290
%define vers 290
%define version 2.9.0
%define prefix /DBA/apache/WWW/2.2.x
%define apavers 2.2.29
%define apapack 2229
%define dbaxml2 0
%define apahome /DBA/apache/WWW/%{apavers}
%define apxs %{apahome}/bin/apxs
%define modname mod_security2
%define tarballname modsecurity-%{version}
Name: dba-apache2-mod_security-%{vers}
Summary: ModSecurity Open Source Web Application Firewall
Version: %{version}
Release: 1
License: GPL
Url: http://www.modsecurity.org
Source0: https://www.modsecurity.org/tarball/%{version}/%{tarballname}.tar.gz
Source1: dba-apache2-mod_security-rpmlintrc
Source2: filter-requires-modsec.sh
Group: Productivity/Networking/Web/Servers
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE2}
BuildRequires: dba-apache-%{apapack}
Requires: dba-apache-base
#!BuildIgnore: dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c
BuildRequires: pcre-devel curl-devel gcc-c++
%if 0%{?centos_version} >= 501 && 0%{?centos_version} <= 599 || 0%{?rhel_version} >= 406 && 0%{?rhel_version} <= 599
BuildRequires: dba-libxml2-291-static
%define dbaxml2 1
%define xmlpath /DBA/libxml2/2.9.1
%else
#!BuildIgnore: dba-libxml2-290
BuildRequires: libxml2-devel
%endif
%if 0%{?suse_version} >= 1000
BuildRequires: openldap2-devel
%else
BuildRequires: openldap-devel
%endif
%if 0%{?suse_version} >= 1110
BuildRequires: -post-build-checks
%endif
%description
ModSecurity(TM) is an open source intrusion detection and
prevention engine for web applications (or a web application
firewall). Operating as an Apache Web server module or
standalone, the purpose of ModSecurity is to increase web
application security, protecting web applications from known
and unknown attacks.
Author:
--------
Ivan Ristic <ivanr@webkreator.com>
%prep
%setup -n %{tarballname}
%{__chmod} +x %{SOURCE2}
%build
%if 0%{?centos_version} >= 501 && 0%{?centos_version} <= 599 || 0%{?rhel_version} >= 406 && 0%{?rhel_version} <= 599
export CFLAGS="$RPM_OPT_FLAGS -DAPR_IOVEC_DEFINED"
%endif
%configure \
--prefix=%{prefix} \
--enable-mlogc \
--enable-htaccess-config \
--with-apr=%{apahome}/bin/apr-1-config \
--with-apu=%{apahome}/bin/apu-1-config \
%if %{dbaxml2}
--with-libxml=%{xmlpath}/bin/xml2-config \
%endif
--with-apxs=%{apxs}
%if 0%{?sles_version} >= 10
perl -pi -e "s|apr-1 64/include|apr-1|g" apache2/Makefile config.status mlogc/Makefile tests/Makefile tools/Makefile
perl -pi -e "s|apr-1 /include|apr-1|g" apache2/Makefile config.status mlogc/Makefile tests/Makefile tools/Makefile
%endif
%{__make}
%install
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true
%{__mkdir_p} %{buildroot}%{prefix}/bin
%{__mkdir_p} %{buildroot}%{prefix}/conf
%{__mkdir_p} %{buildroot}%{prefix}/modules
install -m 755 apache2/.libs/mod_security2.so %{buildroot}%{prefix}/modules/%{modname}-%{version}.so
install -m 755 mlogc/mlogc %{buildroot}/%{prefix}/bin/mlogc-%{version}
cp -p tools/rules-updater.pl rules-updater.pl
cp -p mlogc/mlogc-batch-load.pl mlogc-batch-load.pl
cp -p modsecurity.conf-recommended %{modname}.conf
cp -p mlogc/mlogc-default.conf mlogc.conf
cp -p tools/rules-updater-example.conf rules-updater.conf
rm -f tools/mlogc tools/*.in
%post
pushd %{prefix}/modules
%{__rm} -f %{modname}.so
%{__ln_s} -f %{modname}-%{version}.so %{modname}.so
popd
pushd %{prefix}/bin
%{__rm} -f mlogc
%{__ln_s} -f mlogc-%{version} mlogc
popd
%clean
%{__rm} -rf %{buildroot};
%files
%defattr(-,root,root,-)
%doc doc/
%doc %{modname}.conf mlogc.conf rules-updater.conf rules-updater.pl mlogc-batch-load.pl
%{prefix}/bin/mlogc-%{version}
%{prefix}/modules/%{modname}-%{version}.so
%changelog
* Mon Mar 2 2015 Holger Manthey <holger.manthey@bertelsmann.de>
- initial build