summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Alberto Suarez Lopez <bass@gentoo.org>2006-10-13 11:01:22 +0000
committerJose Alberto Suarez Lopez <bass@gentoo.org>2006-10-13 11:01:22 +0000
commit76e84669ee262c5a9e7c0ef1b9d921540699b0b8 (patch)
tree29dbc63c72820b51b891fc14ab1334ef81fcd5e3 /net-misc/htbinit
parentAlways build with -fPIC on FreeBSD. (diff)
downloadgentoo-2-76e84669ee262c5a9e7c0ef1b9d921540699b0b8.tar.gz
gentoo-2-76e84669ee262c5a9e7c0ef1b9d921540699b0b8.tar.bz2
gentoo-2-76e84669ee262c5a9e7c0ef1b9d921540699b0b8.zip
Added support for ipv6, tos and esfq. Update ebuild and init. Thanks to Francisco Javier #146844
(Portage version: 2.1.1)
Diffstat (limited to 'net-misc/htbinit')
-rw-r--r--net-misc/htbinit/ChangeLog12
-rw-r--r--net-misc/htbinit/files/digest-htbinit-0.8.52
-rw-r--r--net-misc/htbinit/files/digest-htbinit-0.8.5-r13
-rw-r--r--net-misc/htbinit/files/htb.init-v0.8.5_tos.patch51
-rw-r--r--net-misc/htbinit/files/htb.init_find_fix.patch33
-rw-r--r--net-misc/htbinit/files/htb_0.8.5_esfq.diff53
-rw-r--r--net-misc/htbinit/files/htb_0.8.5_ipv6.diff128
-rw-r--r--net-misc/htbinit/files/htbinit.rc46
-rw-r--r--net-misc/htbinit/files/prio_rule.patch20
-rw-r--r--net-misc/htbinit/files/timecheck_fix.patch42
-rw-r--r--net-misc/htbinit/htbinit-0.8.5-r1.ebuild98
-rw-r--r--net-misc/htbinit/htbinit-0.8.5.ebuild6
12 files changed, 490 insertions, 4 deletions
diff --git a/net-misc/htbinit/ChangeLog b/net-misc/htbinit/ChangeLog
index 67af8ea4e9a7..706211e3d12b 100644
--- a/net-misc/htbinit/ChangeLog
+++ b/net-misc/htbinit/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-misc/htbinit
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/ChangeLog,v 1.10 2006/08/05 23:22:15 chriswhite Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/ChangeLog,v 1.11 2006/10/13 11:01:22 bass Exp $
+
+*htbinit-0.8.5-r1 (13 Oct 2006)
+
+ 13 Oct 2006; J. Alberto Suárez López <bass@gentoo.org>
+ +files/htb_0.8.5_ipv6.diff, +files/htb.init-v0.8.5_tos.patch,
+ +files/htb.init_find_fix.patch, +files/htb_0.8.5_esfq.diff,
+ +files/htbinit.rc, +files/prio_rule.patch, +files/timecheck_fix.patch,
+ -htbinit-0.8.4.ebuild, htbinit-0.8.5.ebuild, +htbinit-0.8.5-r1.ebuild:
+ Added support for ipv6, tos and esfq. Update ebuild and init. Thanks to
+ Francisco Javier #146844
05 Aug 2006; Chris White <chriswhite@gentoo.org> metadata.xml:
metadata.xml translation by Yoshino-san in bug #136066
diff --git a/net-misc/htbinit/files/digest-htbinit-0.8.5 b/net-misc/htbinit/files/digest-htbinit-0.8.5
index 2f558afe0723..353cc30f0bc6 100644
--- a/net-misc/htbinit/files/digest-htbinit-0.8.5
+++ b/net-misc/htbinit/files/digest-htbinit-0.8.5
@@ -1 +1,3 @@
MD5 1713d9a4941120235cb0721ceba6493b htb.init-v0.8.5 32038
+RMD160 46a7f4c3e606828b3e26c29a2a0e87cef63d85b2 htb.init-v0.8.5 32038
+SHA256 acfda369dff72b9073a8b70f2b05b1397a61a1cdb23970e5ed216d632ff33586 htb.init-v0.8.5 32038
diff --git a/net-misc/htbinit/files/digest-htbinit-0.8.5-r1 b/net-misc/htbinit/files/digest-htbinit-0.8.5-r1
new file mode 100644
index 000000000000..353cc30f0bc6
--- /dev/null
+++ b/net-misc/htbinit/files/digest-htbinit-0.8.5-r1
@@ -0,0 +1,3 @@
+MD5 1713d9a4941120235cb0721ceba6493b htb.init-v0.8.5 32038
+RMD160 46a7f4c3e606828b3e26c29a2a0e87cef63d85b2 htb.init-v0.8.5 32038
+SHA256 acfda369dff72b9073a8b70f2b05b1397a61a1cdb23970e5ed216d632ff33586 htb.init-v0.8.5 32038
diff --git a/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch b/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch
new file mode 100644
index 000000000000..a798508631d3
--- /dev/null
+++ b/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch
@@ -0,0 +1,51 @@
+--- htb.init.old 2005-03-15 14:56:08.328305288 +0200
++++ htb.init 2005-03-15 15:05:16.612953352 +0200
+@@ -240,6 +240,10 @@
+ # Maximum packet size HTB creates rate maps for. The default should
+ # be sufficient for most cases, it certainly is for Ethernet.
+ #
++# TOS=<number> optional, default "none"
++#
++# TOS field
++#
+ ### SFQ qdisc parameters
+ #
+ # The SFQ queueing discipline is a cheap way to fairly share class bandwidth
+@@ -435,6 +435,7 @@
+ HTB_CLASS="RATE\|CEIL\|BURST\|CBURST\|PRIO\|LEAF\|MTU"
+ HTB_CLASS="$HTB_CLASS\|PRIO_RULE\|PRIO_MARK\|PRIO_REALM"
+ HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB"
++HTB_CLASS="$HTB_CLASS\|TOS"
+
+
+ #############################################################################
+@@ -646,7 +647,7 @@
+ ### Set defaults & load class
+ MTU=""; LEAF=none; PERTURB=10
+ RATE=""; BURST=""; CEIL=""; CBURST=""
+- PRIO=""; LIMIT=""; QUANTUM=""
++ PRIO=""; LIMIT=""; QUANTUM=""; TOS=""
+
+ PRIO_RULE=$PRIO_RULE_DEFAULT
+ PRIO_MARK=$PRIO_MARK_DEFAULT
+@@ -868,12 +869,19 @@
+ u32_d="${DPORT:+match ip dport $DPORT $DMASK}"
+ u32_d="${DADDR:+match ip dst $DADDR} $u32_d"
+
++
++ u32_tos=""
++ if [ -n "$TOS" ]; then
++ u32_tos="match ip tos $TOS 0xff"
++ fi
++
++
+ ### Uncomment the following if you want to see parsed rules
+ #echo "$rule: $u32_s $u32_d"
+
+ ### Attach u32 filter to the appropriate class
+ tc filter add dev $DEVICE parent 1:0 protocol ip \
+- prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS
++ prio $PRIO_RULE u32 $u32_s $u32_d $u32_tos classid 1:$CLASS
+ done ### rule
+
+ [ "$1" = "compile" ] && echo
diff --git a/net-misc/htbinit/files/htb.init_find_fix.patch b/net-misc/htbinit/files/htb.init_find_fix.patch
new file mode 100644
index 000000000000..12222b3e32a5
--- /dev/null
+++ b/net-misc/htbinit/files/htb.init_find_fix.patch
@@ -0,0 +1,33 @@
+--- htb.init.old 2004-01-29 22:41:23.000000000 +0100
++++ htb.init 2006-09-08 00:22:11.000000000 +0200
+@@ -468,8 +468,8 @@
+ ### List of classes in $HTB_PATH
+ htb_class_list () {
+ for dev in `htb_device_list`; do
+- find $HTB_PATH \( -type f -or -type l \) \
+- -name "$dev-*" -not -name '*~' -maxdepth 1 \
++ find $HTB_PATH -maxdepth 1 \( -type f -or -type l \) \
++ -name "$dev-*" -not -name '*~' \
+ -printf "%f\n"| sort
+ done
+ } # htb_class_list
+@@ -483,8 +483,8 @@
+ ### Validate cache against config files
+ htb_valid_cache () {
+ for dev in `htb_device_list`; do
+- [ `find $HTB_PATH \( -type f -or -type l \) \
+- -name "$dev*" -maxdepth 1 -newer $HTB_CACHE| \
++ [ `find $HTB_PATH -maxdepth 1 \( -type f -or -type l \) \
++ -name "$dev*" -newer $HTB_CACHE| \
+ wc -l` -gt 0 ] && VALID=0
+ [ $VALID -ne 1 ] && break
+ done
+@@ -493,7 +493,7 @@
+
+ ### Find class config for device $1, which is newer than cache
+ htb_cache_older () {
+- [ `find $HTB_PATH -type f -name "$1*" -maxdepth 1 \
++ [ `find $HTB_PATH -maxdepth 1 -type f -name "$1*" \
+ -newer $HTB_CACHE| wc -l` -gt 0 ] && return 0
+ return 1
+ } # htb_cache_older
diff --git a/net-misc/htbinit/files/htb_0.8.5_esfq.diff b/net-misc/htbinit/files/htb_0.8.5_esfq.diff
new file mode 100644
index 000000000000..3130f6868a4f
--- /dev/null
+++ b/net-misc/htbinit/files/htb_0.8.5_esfq.diff
@@ -0,0 +1,53 @@
+--- htb.init.old 2004-01-29 22:41:23.000000000 +0100
++++ htb.init 2006-09-07 23:32:58.000000000 +0200
+@@ -226,7 +226,7 @@
+ # priority. Also, classes with higher priority are offered excess
+ # bandwidth first.
+ #
+-# LEAF=none|sfq|pfifo|bfifo optional, default "none"
++# LEAF=none|sfq|esfq|pfifo|bfifo optional, default "none"
+ #
+ # Tells the script to attach specified leaf queueing discipline to HTB
+ # class. By default, no leaf qdisc is used.
+@@ -261,6 +261,15 @@
+ # will never take place which is what you probably don't want. The
+ # default value of 10 seconds is probably a good value.
+ #
++### ESFQ qdisc parameters
++#
++# Same as SFQ and ...
++#
++# HASH=classic|src|dst
++#
++# src mean is fair per source IP
++# dsr mean is fair per destination IP
++#
+ ### PFIFO/BFIFO qdisc parameters
+ #
+ # Those are simple FIFO queueing disciplines. They only have one parameter
+@@ -427,14 +445,14 @@
+
+ ### Modules to probe for. Uncomment the last HTB_PROBE
+ ### line if you have QoS support compiled into kernel
+-HTB_PROBE="sch_htb sch_sfq cls_fw cls_u32 cls_route"
++HTB_PROBE="sch_htb sch_sfq sch_esfq cls_fw cls_u32 cls_route"
+ #HTB_PROBE=""
+
+ ### Config keywords
+ HTB_QDISC="DEFAULT\|DCACHE\|R2Q"
+ HTB_CLASS="RATE\|CEIL\|BURST\|CBURST\|PRIO\|LEAF\|MTU"
+ HTB_CLASS="$HTB_CLASS\|PRIO_RULE\|PRIO_MARK\|PRIO_REALM"
+-HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB"
++HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB\|HASH"
+ HTB_CLASS="$HTB_CLASS\|TOS"
+
+
+@@ -801,6 +819,8 @@
+ LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM}"
+ elif [ "$LEAF" = "pfifo" -o "$LEAF" = "bfifo" ]; then
+ LEAFPARM="${LIMIT:+limit $LIMIT}"
++ elif [ "$LEAF" = "esfq" ]; then
++ LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM} ${HASH:+hash $HASH}"
+ else
+ htb_fail_off "unknown leaf qdisc ($LEAF) in $classfile!"
+ fi
diff --git a/net-misc/htbinit/files/htb_0.8.5_ipv6.diff b/net-misc/htbinit/files/htb_0.8.5_ipv6.diff
new file mode 100644
index 000000000000..815f99545a61
--- /dev/null
+++ b/net-misc/htbinit/files/htb_0.8.5_ipv6.diff
@@ -0,0 +1,128 @@
+--- htb.init.old 2004-01-29 22:41:23.000000000 +0100
++++ htb.init 2006-09-07 23:32:58.000000000 +0200
+@@ -275,6 +284,7 @@
+ ### Filtering parameters
+ #
+ # RULE=[[saddr[/prefix]][:port[/mask]],][daddr[/prefix]][:port[/mask]]
++# RULEIPv6=[[saddr[/prefix]][_port[/mask]],][daddr[/prefix]][_port[/mask]]
+ #
+ # These parameters make up "u32" filter rules that select traffic for
+ # each of the classes. You can use multiple RULE fields per config.
+@@ -300,9 +310,13 @@
+ # RULE=10.5.5.5:80,
+ # selects traffic going from port 80 of single host 10.5.5.5
+ #
++# RULEIPv6=3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8
++# selects traffic going to IPv6 host 3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8
++#
+ #
+ #
+ # REALM=[srealm,][drealm]
++# REALMIPv6=[srealm,][drealm]
+ #
+ # These parameters make up "route" filter rules that classify traffic
+ # according to packet source/destination realms. For information about
+@@ -327,6 +341,7 @@
+ #
+ #
+ # MARK=<mark>
++# MARKIPv6=<mark>
+ #
+ # These parameters make up "fw" filter rules that select traffic for
+ # each of the classes accoring to firewall "mark". Mark is a decimal
+@@ -414,6 +429,9 @@
+ PRIO_RULE_DEFAULT=${PRIO_RULE:-100}
+ PRIO_MARK_DEFAULT=${PRIO_MARK:-200}
+ PRIO_REALM_DEFAULT=${PRIO_REALM:-300}
++PRIO_RULEIPv6=${PRIO_RULEIPv6:-150}
++PRIO_MARKIPv6=${PRIO_MARKIPv6:-250}
++PRIO_REALMIPv6=${PRIO_REALMIPv6:-350}
+
+ ### Default HTB_PATH & HTB_CACHE settings
+ HTB_PATH=${HTB_PATH:-/etc/sysconfig/htb}
+@@ -818,6 +838,13 @@
+ prio $PRIO_MARK handle $mark fw classid 1:$CLASS
+ done ### mark
+
++ ### Create fw filter for MARKIPv6 fields
++ for mark in `htb_cfile_rules MARKIPv6`; do
++ ### Attach fw filter to root class
++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \
++ prio $PRIO_MARKIPv6 handle $mark fw classid 1:$CLASS
++ done ### markipv6
++
+ ### Create route filter for REALM fields
+ for realm in `htb_cfile_rules REALM`; do
+ ### Split realm into source & destination realms
+@@ -833,6 +860,21 @@
+ ${DREALM:+to $DREALM} classid 1:$CLASS
+ done ### realm
+
++ ### Create route filter for REALMIPv6 fields
++ for realm in `htb_cfile_rules REALMIPv6`; do
++ ### Split realm into source & destination realms
++ SREALM=${realm%%,*}; DREALM=${realm##*,}
++ [ "$SREALM" = "$DREALM" ] && SREALM=""
++
++ ### Convert asterisks to empty strings
++ SREALM=${SREALM#\*}; DREALM=${DREALM#\*}
++
++ ### Attach route filter to the root class
++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \
++ prio $PRIO_REALM route ${SREALM:+from $SREALM} \
++ ${DREALM:+to $DREALM} classid 1:$CLASS
++ done ### realmipv6
++
+ ### Create u32 filter for RULE fields
+ for rule in `htb_cfile_rules RULE`; do
+ ### Split rule into source & destination
+@@ -876,6 +918,49 @@
+ prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS
+ done ### rule
+
++ ### Create u32 filter for RULEIPv6 fields
++ for rule in `htb_cfile_rules RULEIPv6`; do
++ ### Split rule into source & destination
++ SRC=${rule%%,*}; DST=${rule##*,}
++ [ "$SRC" = "$rule" ] && SRC=""
++
++
++ ### Split destination into address, port & mask fields
++ DADDR=${DST%%_*}; DTEMP=${DST##*_}
++ [ "$DADDR" = "$DST" ] && DTEMP=""
++
++ DPORT=${DTEMP%%/*}; DMASK=${DTEMP##*/}
++ [ "$DPORT" = "$DTEMP" ] && DMASK="0xffff"
++
++
++ ### Split up source (if specified)
++ SADDR=""; SPORT=""
++ if [ -n "$SRC" ]; then
++ SADDR=${SRC%%_*}; STEMP=${SRC##*_}
++ [ "$SADDR" = "$SRC" ] && STEMP=""
++
++ SPORT=${STEMP%%/*}; SMASK=${STEMP##*/}
++ [ "$SPORT" = "$STEMP" ] && SMASK="0xffff"
++ fi
++
++
++ ### Convert asterisks to empty strings
++ SADDR=${SADDR#\*}; DADDR=${DADDR#\*}
++
++ ### Compose u32 filter rules
++ u32_s="${SPORT:+match ip6 sport $SPORT $SMASK}"
++ u32_s="${SADDR:+match ip6 src $SADDR} $u32_s"
++ u32_d="${DPORT:+match ip6 dport $DPORT $DMASK}"
++ u32_d="${DADDR:+match ip6 dst $DADDR} $u32_d"
++
++ ### Uncomment the following if you want to see parsed rules
++ #echo "$rule: $u32_s $u32_d"
++
++ ### Attach u32 filter to the appropriate class
++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \
++ prio $PRIO_RULEIPv6 u32 $u32_s $u32_d classid 1:$CLASS
++ done ### ruleipv6
++
+ [ "$1" = "compile" ] && echo
+ done ### classfile
+ ;;
diff --git a/net-misc/htbinit/files/htbinit.rc b/net-misc/htbinit/files/htbinit.rc
new file mode 100644
index 000000000000..1dd75888f040
--- /dev/null
+++ b/net-misc/htbinit/files/htbinit.rc
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+opts="start stop reload stats list timecheck"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting htbinit"
+ /usr/sbin/htb.init start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping htbinit"
+ /usr/sbin/htb.init stop
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading htbinit"
+ /usr/sbin/htb.init start invalidate
+ eend $?
+}
+
+stats() {
+ ebegin "Showing htbinit stats"
+ /usr/sbin/htb.init stats
+ eend $?
+}
+
+list() {
+ ebegin "Showing htbinit list"
+ /usr/sbin/htb.init list
+ eend $?
+}
+
+timecheck() {
+ ebegin "Showing htbinit timecheck"
+ /usr/sbin/htb.init timecheck
+ eend $?
+}
diff --git a/net-misc/htbinit/files/prio_rule.patch b/net-misc/htbinit/files/prio_rule.patch
new file mode 100644
index 000000000000..28471aabb84e
--- /dev/null
+++ b/net-misc/htbinit/files/prio_rule.patch
@@ -0,0 +1,20 @@
+--- htb.init.old 2004-01-29 22:41:23.000000000 +0100
++++ htb.init 2006-09-08 00:03:32.000000000 +0200
+@@ -453,7 +457,7 @@
+ ### Load & filter file $HTB_PATH/$1
+ htb_filter_file () {
+ sed -n "s/#.*//; s/[^a-zA-Z0-9.,;:=/*-_]\+//g; \
+- /^[a-zA-Z0-9]\+=[a-zA-Z0-9.,:;/*-_]\+$/ p" $HTB_PATH/$1
++ /^[a-zA-Z0-9_]\+=[a-zA-Z0-9.,:;/*-_]\+$/ p" $HTB_PATH/$1
+ } # htb_filter_file
+
+
+@@ -517,7 +521,7 @@
+
+ htb_filter_file () {
+ sed 's/#.*//; s/[^a-zA-Z0-9.,;:=/*-_]\+//g' $HTB_PATH/$1 \
+- | grep '^[a-zA-Z0-9]\+=[a-zA-Z0-9.,;:/*-_]\+$'
++ | grep '^[a-zA-Z0-9_]\+=[a-zA-Z0-9.,;:/*-_]\+$'
+ } # htb_filter_file
+
+ htb_clsid_chain () {
diff --git a/net-misc/htbinit/files/timecheck_fix.patch b/net-misc/htbinit/files/timecheck_fix.patch
new file mode 100644
index 000000000000..de3791af997d
--- /dev/null
+++ b/net-misc/htbinit/files/timecheck_fix.patch
@@ -0,0 +1,42 @@
+--- htb.init.old 2004-01-29 22:41:23.000000000 +0100
++++ htb.init 2006-09-08 00:11:36.000000000 +0200
+@@ -891,7 +895,6 @@
+ TIME_TMP=`date +%w/%k:%M`
+ TIME_DOW=${TIME_TMP%%/*}
+ TIME_NOW=${TIME_TMP##*/}
+-TIME_ABS=`htb_time2abs $TIME_NOW`
+
+ ### Check all classes (if configured)
+ for classfile in `htb_class_list`; do
+@@ -914,6 +917,7 @@
+ ### Compute interval boundaries
+ BEG_ABS=`htb_time2abs $BEG_TIME`
+ END_ABS=`htb_time2abs $END_TIME`
++ TIME_ABS=`htb_time2abs $TIME_NOW`
+
+ ### Midnight wrap fixup
+ if [ $BEG_ABS -gt $END_ABS ]; then
+@@ -926,6 +930,23 @@
+ ### If time period matches, remember params and set MATCH flag
+ if [ $TIME_ABS -ge $BEG_ABS -a $TIME_ABS -lt $END_ABS ]; then
+ RATESPEC=${PARAMS%%,*}; CEILSPEC=${PARAMS##*,}
++
++ RNAME=""; CNAME=""
++
++ [ "$RATESPEC" = "prate" ] && RNAME=RATE_$PARENT
++ [ "$RATESPEC" = "pceil" ] && RNAME=CEIL_$PARENT
++
++ if [ -n "$RNAME" ]; then
++ RATESPEC=${!RNAME}
++ fi
++
++ [ "$CEILSPEC" = "prate" ] && CNAME=RATE_$PARENT
++ [ "$CEILSPEC" = "pceil" ] && CNAME=CEIL_$PARENT
++
++ if [ -n "$CNAME" ]; then
++ CEILSPEC=${!CNAME}
++ fi
++
+ [ "$RATESPEC" = "$CEILSPEC" ] && CEILSPEC=""
+
+ NEW_RATE=${RATESPEC%%/*}; NEW_BURST=${RATESPEC##*/}
diff --git a/net-misc/htbinit/htbinit-0.8.5-r1.ebuild b/net-misc/htbinit/htbinit-0.8.5-r1.ebuild
new file mode 100644
index 000000000000..3755faff6700
--- /dev/null
+++ b/net-misc/htbinit/htbinit-0.8.5-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/htbinit-0.8.5-r1.ebuild,v 1.1 2006/10/13 11:01:22 bass Exp $
+
+inherit eutils linux-mod
+
+DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2"
+HOMEPAGE="http://www.sourceforge.net/projects/htbinit"
+SRC_URI="mirror://sourceforge/htbinit/htb.init-v${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc alpha ~amd64"
+IUSE="ipv6 esfq"
+
+DEPEND="sys-apps/iproute2"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ ebegin "Checking for SCH_HTB support"
+ linux_chkconfig_present NET_SCH_HTB
+ eend $?
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs sch_htb support!"
+ die "sch_htb support not detected!"
+ fi
+ ebegin "Checking for SCH_SFQ support"
+ linux_chkconfig_present NET_SCH_SFQ
+ eend $?
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs sch_sfq support!"
+ die "sch_sfqsupport not detected!"
+ fi
+ ebegin "Checking for CLS_FW support"
+ linux_chkconfig_present NET_CLS_FW
+ eend $?
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs cls_fw support!"
+ die "cls_fw support not detected!"
+ fi
+ ebegin "Checking for CLS_U32 support"
+ linux_chkconfig_present NET_CLS_U32
+ eend $?
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs sch_u32 support!"
+ die "sch_u32 support not detected!"
+ fi
+ ebegin "Checking for CLS_ROUTE support"
+ linux_chkconfig_present NET_CLS_ROUTE
+ eend $?
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs cls_route support!"
+ die "cls_route support not detected!"
+ fi
+
+ if use esfq; then
+ ebegin "Checking for NET_SCH_ESFQ support"
+ linux_chkconfig_present NET_SCH_ESFQ
+ eend $?
+
+ if [[ $? -ne 0 ]] ; then
+ eerror "This version needs sch_esfq support!"
+ eerror "See http://fatooh.org/esfq-2.6/"
+ die "sch_esfq support not detected!"
+ fi
+ fi
+}
+
+src_unpack() {
+ cp ${DISTDIR}/htb.init-v${PV} ${S}/htb.init
+}
+
+src_compile() {
+ sed -i 's|/etc/sysconfig/htb|/etc/htb|g' ${S}/htb.init
+ epatch ${FILESDIR}/htb.init-v0.8.5_tos.patch
+ use ipv6 && epatch ${FILESDIR}/htb_0.8.5_ipv6.diff
+ use esfq && epatch ${FILESDIR}/htb_0.8.5_esfq.diff
+ epatch ${FILESDIR}/prio_rule.patch
+ epatch ${FILESDIR}/timecheck_fix.patch
+ epatch ${FILESDIR}/htb.init_find_fix.patch
+}
+
+src_install() {
+ dosbin htb.init
+
+ newinitd ${FILESDIR}/htbinit.rc htbinit
+
+ keepdir /etc/htb
+}
+
+pkg_postinst() {
+ einfo 'Run "rc-update add htbinit default" to run htb.init at startup.'
+ einfo 'Please, read carefully the htb.init documentation.'
+ einfo 'new directory to store configuration /etc/htb'
+}
diff --git a/net-misc/htbinit/htbinit-0.8.5.ebuild b/net-misc/htbinit/htbinit-0.8.5.ebuild
index 24f33daab415..7bc94687ae6e 100644
--- a/net-misc/htbinit/htbinit-0.8.5.ebuild
+++ b/net-misc/htbinit/htbinit-0.8.5.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/htbinit-0.8.5.ebuild,v 1.4 2005/06/13 15:33:46 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/htbinit-0.8.5.ebuild,v 1.5 2006/10/13 11:01:22 bass Exp $
DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2"
HOMEPAGE="http://www.sourceforge.net/projects/htbinit"
@@ -8,7 +8,7 @@ SRC_URI="mirror://sourceforge/htbinit/htb.init-v${PV}"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~x86 ~ppc ~sparc alpha ~amd64"
+KEYWORDS="x86 ~ppc ~sparc alpha ~amd64"
IUSE=""
DEPEND="sys-apps/iproute2"