summaryrefslogtreecommitdiff
blob: f94e49e51217851f44ac468c831aa662b4da1d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/htbinit/htbinit-0.8.4.ebuild,v 1.3 2003/09/05 22:01:48 msterret Exp $

DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2"
HOMEPAGE="http://www.sourceforge.net/projects/htbinit"
SRC_URI="http://unc.dl.sourceforge.net/sourceforge/htbinit/htb.init-v${PV}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ~sparc ~alpha"

DEPEND="sys-apps/iproute"
RDEPEND="${DEPEND}"

S="${WORKDIR}"

src_unpack() {
	cp ${DISTDIR}/htb.init-v${PV} ${S}
}

src_compile() {
	mv htb.init-v${PV} htb.init-v${PV}.orig
	sed <htb.init-v${PV}.orig >htb.init-v${PV} \
		-e 's|HTB_PATH=${HTB_PATH:-/etc/sysconfig/htb}|HTB_PATH=/etc/htbinit|' \
		-e 's|HTB_CACHE=${HTB_CACHE:-/var/cache/htb.init}|HTB_CACHE=/var/cache/htbinit|'
}

src_install() {
	mv htb.init-v${PV} htbinit

	exeinto /usr/sbin
	doexe htbinit

	exeinto /usr/sbin
	doexe ${FILESDIR}/htb.sysconfig

	exeinto /etc/init.d
	newexe ${FILESDIR}/rc_htbinit htbinit

	dodoc htbinit ${FILESDIR}/htb.sysconfig
}

pkg_postinst() {
	einfo 'Run "rc-update add htbinit default" to run htbinit at startup.'
	einfo 'Edit "/usr/sbin/htb.sysconfig" to make a custom configuration.'
	einfo 'Please, read carefully the htbinit and htb.sysconfig documentation.'
}