Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 2fb1bcd290fea1999cc8c4a132a65312 > files > 2

apache2-mod_ip_count-2.0.53_2.0-0.r32.1mdk.src.rpm

#Module-Specific definitions
%define mod_version 2.0
%define svn_rev r32

%define mod_name mod_ip_count
%define mod_conf A34_%{mod_name}.conf
%define mod_so %{mod_name}.so
%define sourcename %{mod_name}-%{mod_version}

%define apache_version 2.0.53

# Standard Module Definitions
%define name apache2-%{mod_name}
%define version %{apache_version}_%{mod_version}

Summary:	Mod_ip_count is a DSO module for the apache2 Web server
Name:		%{name}
Version:	%{version}
Release:	%mkrel 0.%{svn_rev}.1
License:	Apache License
Group:		System/Servers
# http://feh.holsman.net
URL:		http://svn.webperf.org/repo/mod_ip_count/2.0.x/
Source0: 	%{mod_name}-%{svn_rev}.tar.bz2
Source1:	%{mod_conf}.bz2
Prereq:		apache2 >= %{apache_version}
Prereq:		apache2-conf
BuildRequires:	apache2-devel >= %{apache_version}-1mdk
#BuildRequires:	apr_memcache-devel
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description
mod_ip_count is a DoS prevention apache2 module. It works by
restricting the number of requests that a given client can issue
to a server pool.

%prep

%setup -q -n %{mod_name}

%build

sh ./autogen.sh

%configure2_5x \
    --with-apxs=%{_sbindir}/apxs2

#%{_sbindir}/apxs2 -I. -I%{_includedir}/apr_memcache-0 -lapr_memcache -c %{mod_name}.c 

%make

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}/apache2-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache2-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/conf.d/%{mod_conf}

install -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

%post
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README LICENSE
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache2-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*

%changelog
* Sat Mar 19 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_2.0-0.r32.1mdk
- initial package