#Module-Specific definitions %define mod_version 0.1.3 %define release 1mdk %define mod_name mod_bwshare %define mod_conf 77_%{mod_name}.conf %define mod_so %{mod_name}.so %define sourcename bwshare-%{mod_version} #New ADVX macros %define ADVXdir %{_datadir}/ADVX %{expand:%(cat %{ADVXdir}/ADVX-build)} %{expand:%%global ap_version %(%{apxs} -q ap_version)} # Standard Module Definitions %define name %{ap_name}-%{mod_name} %define version %{ap_version}_%{mod_version} #Standard ADVX requires Prereq: %{ap_name} = %{ap_version} Prereq: %{ap_name}-conf BuildPreReq: ADVX-build >= 9.2 BuildRequires: %{ap_name}-devel >= 2.0.44-6mdk Provides: ADVXpackage Provides: AP20package Summary: Bandwidth throttling and balancing by client IP address. Name: %{name} Version: %{version} Release: %{release} Group: System/Servers Source0: %{sourcename}.zip Source1: %{sourcename}.zip.asc Source2: %{mod_conf}.bz2 Patch: bwshare-fix-config.bz2 License: Artistic URL: http://www.topology.org/src/bwshare/README.html Prereq: rpm-helper BuildRequires: unzip BuildRoot: %{_tmppath}/%{name}-buildroot %description The Apache shaping module "bwshare" uses a form of "statistical shaping". This means that the software measures the statistical behaviour of the subscriber in the past, and uses this as a basis for controlling the current access to resources by the user. The purpose of this module is to give the web site operator some control over bandwidth utilization by individual client hosts. The "bwshare" module temporarily blocks access by excessive users. This is aimed especially at users who download whole websites at great speed. Excessive speed is considered bad etiquette for search engine robots. %prep %setup -q -n src pushd modules/bwshare %patch0 popd cp modules/bwshare/doc.html . cp modules/bwshare/LICENCE . cp modules/bwshare/README.html . cp modules/bwshare/%{mod_name}.c . %build %{apxs} -c %{mod_name}.c %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %ADVXinstlib %ADVXinstconf %{SOURCE2} %{mod_conf} %ADVXinstdoc %{name}-%{version} cat > README.%{name} <<EOF NOTE! It's crucial that forward and reverse DNS lookups works perfectly on the host running this module. If, not apache won't start unless for example ServerName is 127.0.0.1. -- Regards // Oden Eriksson Deserve-IT Networks http://d-srv.com EOF %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %post %ADVXpost %postun %ADVXpost %files %defattr(-,root,root) %doc doc.html LICENCE README.* %config(noreplace) %{ap_confd}/%{mod_conf} %{ap_extralibs}/%{mod_so} %{ap_webdoc}/* %changelog * Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.1.3-1mdk - built for apache 2.0.48 * Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_0.1.3-1mdk - rebuilt against latest apache2, requires and buildrequires * Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.1.3-1mdk - rebuilt for apache v2.0.46 - buildprereq ADVX-build >= 9.2 * Tue Apr 08 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.45_0.1.3-1mdk - cosmetic rebuild for apache v2.0.45 * Fri Feb 28 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.0.44_0.1.3-3mdk - _Major_ rework on the module, it would not use the values in httpd.conf for configuration. This module is totally weird, using shared memory and semaphores, and covers different Apache versions, which makes it a mess. I don't know if my patch will work for 1.3, but it works with Apache 2.0.42 and higher. Added BWSHARE_DEBUG define so we can recompile it with this option and trace the Apache API calls. - Set better default values in the conf file: the defaults were set to 0.067 pages per second, which is suitable for a server on an obsolete 33.6K modem, and totally unuseable according to the current standards. * Fri Feb 28 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.0.44_0.1.3-2mdk - rebuild * Thu Feb 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.44_0.1.3-1mdk - 0.1.3 - drop P0, it is now correcly done and included, great thanks Alan! * Tue Jan 21 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.44_0.1.2-1mdk - rebuilt for apache v2.0.44 * Mon Jan 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.1.2-3mdk - fix buildrequires apache2-devel >= 2.0.43-5mdk, as pointed out by Olivier Thauvin * Sat Jan 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.1.2-2mdk - rebuilt against rebuilt buildrequires * Mon Jan 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.1.2-1mdk - initial cooker contrib