htbinit-0.8.5-r7.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils linux-info
  5. DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2"
  6. HOMEPAGE="http://www.sourceforge.net/projects/htbinit"
  7. SRC_URI="mirror://sourceforge/htbinit/htb.init-v${PV}"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~ppc x86"
  11. IUSE="ipv6 esfq"
  12. DEPEND="sys-apps/iproute2"
  13. RDEPEND="${DEPEND}"
  14. S=${WORKDIR}
  15. pkg_setup() {
  16. for i in NET_SCH_HTB NET_SCH_SFQ NET_CLS_FW NET_CLS_U32 NET_CLS_ROUTE4 ; do
  17. CONFIG_CHECK="${CONFIG_CHECK} ~${i}"
  18. done
  19. use esfq && CONFIG_CHECK="${CONFIG_CHECK} ~NET_SCH_ESFQ"
  20. linux-info_pkg_setup
  21. }
  22. src_unpack() {
  23. cp "${DISTDIR}"/htb.init-v${PV} "${S}"/htb.init || die
  24. }
  25. src_prepare() {
  26. sed -i 's|/etc/sysconfig/htb|/etc/htb|g' "${S}"/htb.init
  27. epatch "${FILESDIR}"/htb.init-v0.8.5_tos.patch
  28. use ipv6 && epatch "${FILESDIR}"/htb_0.8.5_ipv6.diff
  29. use esfq && epatch "${FILESDIR}"/htb_0.8.5_esfq.diff
  30. epatch "${FILESDIR}"/prio_rule.patch
  31. epatch "${FILESDIR}"/timecheck_fix.patch
  32. epatch "${FILESDIR}"/htb.init_find_fix.patch
  33. sed -i -e 's:/sbin/ip:/bin/ip:g' "${S}"/htb.init # bug #474700
  34. }
  35. src_compile() {
  36. :
  37. }
  38. src_install() {
  39. dosbin htb.init
  40. newinitd "${FILESDIR}"/htbinit.rc htbinit
  41. keepdir /etc/htb
  42. }
  43. pkg_postinst() {
  44. if [[ -z ${REPLACING_VERSIONS} ]] ; then
  45. elog 'Run "rc-update add htbinit default" to run htb.init at startup.'
  46. elog 'Please, read carefully the htb.init documentation.'
  47. elog 'New directory to store configuration is /etc/htb.'
  48. fi
  49. }