summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apache/mod_bw')
-rw-r--r--www-apache/mod_bw/Manifest1
-rw-r--r--www-apache/mod_bw/files/11_mod_bw.conf16
-rw-r--r--www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch49
-rw-r--r--www-apache/mod_bw/metadata.xml5
-rw-r--r--www-apache/mod_bw/mod_bw-0.9.2-r1.ebuild30
5 files changed, 101 insertions, 0 deletions
diff --git a/www-apache/mod_bw/Manifest b/www-apache/mod_bw/Manifest
new file mode 100644
index 000000000000..810eac3de166
--- /dev/null
+++ b/www-apache/mod_bw/Manifest
@@ -0,0 +1 @@
+DIST mod_bw-0.92.tgz 23816 SHA256 658eb3f63e2181ac0b6fc3ea33f0eaf637d6ef832c7df3a0e3f3d0cd2376cd7f SHA512 caa5c0eccb12498ca59428e0ac6b06e6a6c86c1126693071b5df20f32cc5a5673197b2e53e58c9edb0f0f8efd8d1c276cfdc9962cb90b219baf1bd0785ea2443 WHIRLPOOL 639bd389f9124973b5592865c6ecbc5402f0bf28876abf55f19fe5e2e43eaf61f00c615b52b6c2b62dbbfc0195efdf2967b0ce646e27368ad983ef3fa62ce546
diff --git a/www-apache/mod_bw/files/11_mod_bw.conf b/www-apache/mod_bw/files/11_mod_bw.conf
new file mode 100644
index 000000000000..1d990612bdc5
--- /dev/null
+++ b/www-apache/mod_bw/files/11_mod_bw.conf
@@ -0,0 +1,16 @@
+<IfDefine BW>
+LoadModule bw_module modules/mod_bw.so
+
+# This must be turned on for mod_bandwidth to actually do anything
+# These directives can go inside a VirtualHost or Directory, etc...
+#BandWidthModule On
+
+# Limit 196.168.0.0/24 to 80KB/sec, with a minimum of 60KB/sec
+#BandWidth 196.168.0 80000
+#BandWidth 196.168.0 60000
+
+# Everyone else shares 50KB/sec
+#Bandwidth all 50000
+</IfDefine>
+
+# vim: ts=4 filetype=apache
diff --git a/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch b/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch
new file mode 100644
index 000000000000..27af0dbc1c6f
--- /dev/null
+++ b/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch
@@ -0,0 +1,49 @@
+--- a/mod_bw.c 2010-07-20 18:14:30.000000000 +0200
++++ b/mod_bw.c 2014-03-31 14:36:27.064883758 +0200
+@@ -105,6 +105,10 @@ Changelog :
+ #define apr_atomic_set32 apr_atomic_set
+ #endif
+
++#define APACHE_VERSION_AT_LEAST(major,minor) \
++(((major) < AP_SERVER_MAJORVERSION_NUMBER) \
++ || ((major) == AP_SERVER_MAJORVERSION_NUMBER && (minor) <= AP_SERVER_MINORVERSION_NUMBER))
++
+ /* Enum types of "from address" */
+ enum from_type {
+ T_ALL,
+@@ -564,7 +568,11 @@ static long get_bw_rate(request_rec * r,
+ return e[i].rate;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].rate;
+ }
+ break;
+@@ -655,7 +663,11 @@ static int get_maxconn(request_rec * r,
+ return e[i].max;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].max;
+ }
+ break;
+@@ -706,7 +718,11 @@ static int get_sid(request_rec * r, apr_
+ return e[i].sid;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].sid;
+ }
+ break;
diff --git a/www-apache/mod_bw/metadata.xml b/www-apache/mod_bw/metadata.xml
new file mode 100644
index 000000000000..4538a68724a6
--- /dev/null
+++ b/www-apache/mod_bw/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer><email>maintainer-needed@gentoo.org</email></maintainer>
+</pkgmetadata>
diff --git a/www-apache/mod_bw/mod_bw-0.9.2-r1.ebuild b/www-apache/mod_bw/mod_bw-0.9.2-r1.ebuild
new file mode 100644
index 000000000000..e2f07a08b9bf
--- /dev/null
+++ b/www-apache/mod_bw/mod_bw-0.9.2-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit apache-module eutils
+
+DESCRIPTION="Bandwidth Management Module for Apache2"
+HOMEPAGE="http://www.ivn.cl/apache/"
+
+SRC_URI="http://ivn.cl/files/source/${P/9./9}.tgz"
+
+KEYWORDS="amd64 ppc x86"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="sys-devel/libtool"
+RDEPEND=""
+
+APACHE2_MOD_CONF="11_${PN}"
+APACHE2_MOD_DEFINE="BW"
+
+need_apache2
+
+S="${WORKDIR}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-apache24.patch"
+}