LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dba-apache2-mod_security-270.spec of Package dba-apache2-mod_security-270 (Project home:csbuild:DBA)

%define vers	270
%define version	2.7.0
%define prefix	/DBA/apache/WWW/2.2.x
%if 0%{?suse_version} >= 1200
%define apavers         2.2.21
%define apapack         2221
%else
%define apavers         2.2.20
%define apapack         2220
%endif
%define apahome /DBA/apache/WWW/%{apavers}
%define apxs    %{apahome}/bin/apxs
%define apache        apache2
%define modname       mod_security2
%define tarballname   modsecurity-apache_%{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:        http://www.modsecurity.org/download/%{tarballname}.tar.gz
Source1:        dba-apache2-mod_security-rpmlintrc
Group:          Productivity/Networking/Web/Servers
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  dba-apache-%{apapack}
Requires:  	dba-apache-base

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c
BuildRequires:  libxml2-devel pcre-devel curl-devel gcc-c++

%if 0%{?suse_version}
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
%else
BuildRequires:  apr-util-devel apr-devel
%endif

%if 0%{?suse_version} >= 1000
BuildRequires:  openldap2-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}


%build
%configure \
        --prefix=%{prefix} \
        --enable-mlogc \
        --with-apxs=%{apxs}
%{__make}
# make mlogc
# cd -


%install
%{__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 0644 apache2/mlogc-src/mlogc-default.conf %{buildroot}/%{prefix}/conf/mlogc.conf
install -m 755 mlogc/mlogc %{buildroot}/%{prefix}/bin/mlogc-%{version}
# install -m 755 tools/rules-updater.pl %{buildroot}/%{prefix}/bin
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 mlgoc-%{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}/bin/rules-updater.pl
# %{prefix}/conf/*.conf
%{prefix}/modules/%{modname}-%{version}.so


%changelog
* Fri Oct 19 2012 Holger Manthey <holger.manthey@bertelsmann.de>
- add version suffix to mlogc to install multiple versions
* Thu Oct 18 2012 Holger Manthey <holger.manthey@bertelsmann.de>
- initial build