1 |
commit: 6ae3ebb95783618f3d3d047d38ef6fd700920076 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 20 01:19:19 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 20 01:20:45 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ae3ebb9 |
7 |
|
8 |
net-misc/htbinit: port to EAPI 7 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
net-misc/htbinit/files/htb.init-v0.8.5_tos.patch | 4 +-- |
13 |
net-misc/htbinit/files/htb.init_find_fix.patch | 4 +-- |
14 |
.../{htb_0.8.5_esfq.diff => htb_0.8.5_esfq.patch} | 4 +-- |
15 |
.../{htb_0.8.5_ipv6.diff => htb_0.8.5_ipv6.patch} | 4 +-- |
16 |
net-misc/htbinit/files/prio_rule.patch | 4 +-- |
17 |
net-misc/htbinit/files/timecheck_fix.patch | 4 +-- |
18 |
net-misc/htbinit/htbinit-0.8.5-r7.ebuild | 37 ++++++++++++++-------- |
19 |
7 files changed, 36 insertions(+), 25 deletions(-) |
20 |
|
21 |
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 |
22 |
index a798508631d..f45b5c07349 100644 |
23 |
--- a/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch |
24 |
+++ b/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch |
25 |
@@ -1,5 +1,5 @@ |
26 |
---- htb.init.old 2005-03-15 14:56:08.328305288 +0200 |
27 |
-+++ htb.init 2005-03-15 15:05:16.612953352 +0200 |
28 |
+--- a/htb.init |
29 |
++++ b/htb.init |
30 |
@@ -240,6 +240,10 @@ |
31 |
# Maximum packet size HTB creates rate maps for. The default should |
32 |
# be sufficient for most cases, it certainly is for Ethernet. |
33 |
|
34 |
diff --git a/net-misc/htbinit/files/htb.init_find_fix.patch b/net-misc/htbinit/files/htb.init_find_fix.patch |
35 |
index 12222b3e32a..27fce89ef2d 100644 |
36 |
--- a/net-misc/htbinit/files/htb.init_find_fix.patch |
37 |
+++ b/net-misc/htbinit/files/htb.init_find_fix.patch |
38 |
@@ -1,5 +1,5 @@ |
39 |
---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 |
40 |
-+++ htb.init 2006-09-08 00:22:11.000000000 +0200 |
41 |
+--- a/htb.init |
42 |
++++ b/htb.init |
43 |
@@ -468,8 +468,8 @@ |
44 |
### List of classes in $HTB_PATH |
45 |
htb_class_list () { |
46 |
|
47 |
diff --git a/net-misc/htbinit/files/htb_0.8.5_esfq.diff b/net-misc/htbinit/files/htb_0.8.5_esfq.patch |
48 |
similarity index 94% |
49 |
rename from net-misc/htbinit/files/htb_0.8.5_esfq.diff |
50 |
rename to net-misc/htbinit/files/htb_0.8.5_esfq.patch |
51 |
index 3130f6868a4..506c505f8e4 100644 |
52 |
--- a/net-misc/htbinit/files/htb_0.8.5_esfq.diff |
53 |
+++ b/net-misc/htbinit/files/htb_0.8.5_esfq.patch |
54 |
@@ -1,5 +1,5 @@ |
55 |
---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 |
56 |
-+++ htb.init 2006-09-07 23:32:58.000000000 +0200 |
57 |
+--- a/htb.init |
58 |
++++ b/htb.init |
59 |
@@ -226,7 +226,7 @@ |
60 |
# priority. Also, classes with higher priority are offered excess |
61 |
# bandwidth first. |
62 |
|
63 |
diff --git a/net-misc/htbinit/files/htb_0.8.5_ipv6.diff b/net-misc/htbinit/files/htb_0.8.5_ipv6.patch |
64 |
similarity index 97% |
65 |
rename from net-misc/htbinit/files/htb_0.8.5_ipv6.diff |
66 |
rename to net-misc/htbinit/files/htb_0.8.5_ipv6.patch |
67 |
index 815f99545a6..6e99319f2c6 100644 |
68 |
--- a/net-misc/htbinit/files/htb_0.8.5_ipv6.diff |
69 |
+++ b/net-misc/htbinit/files/htb_0.8.5_ipv6.patch |
70 |
@@ -1,5 +1,5 @@ |
71 |
---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 |
72 |
-+++ htb.init 2006-09-07 23:32:58.000000000 +0200 |
73 |
+--- a/htb.init |
74 |
++++ b/htb.init |
75 |
@@ -275,6 +284,7 @@ |
76 |
### Filtering parameters |
77 |
# |
78 |
|
79 |
diff --git a/net-misc/htbinit/files/prio_rule.patch b/net-misc/htbinit/files/prio_rule.patch |
80 |
index 28471aabb84..429a1bed0ad 100644 |
81 |
--- a/net-misc/htbinit/files/prio_rule.patch |
82 |
+++ b/net-misc/htbinit/files/prio_rule.patch |
83 |
@@ -1,5 +1,5 @@ |
84 |
---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 |
85 |
-+++ htb.init 2006-09-08 00:03:32.000000000 +0200 |
86 |
+--- a/htb.init |
87 |
++++ b/htb.init |
88 |
@@ -453,7 +457,7 @@ |
89 |
### Load & filter file $HTB_PATH/$1 |
90 |
htb_filter_file () { |
91 |
|
92 |
diff --git a/net-misc/htbinit/files/timecheck_fix.patch b/net-misc/htbinit/files/timecheck_fix.patch |
93 |
index de3791af997..4797ea6fd0a 100644 |
94 |
--- a/net-misc/htbinit/files/timecheck_fix.patch |
95 |
+++ b/net-misc/htbinit/files/timecheck_fix.patch |
96 |
@@ -1,5 +1,5 @@ |
97 |
---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 |
98 |
-+++ htb.init 2006-09-08 00:11:36.000000000 +0200 |
99 |
+--- a/htb.init |
100 |
++++ b/htb.init |
101 |
@@ -891,7 +895,6 @@ |
102 |
TIME_TMP=`date +%w/%k:%M` |
103 |
TIME_DOW=${TIME_TMP%%/*} |
104 |
|
105 |
diff --git a/net-misc/htbinit/htbinit-0.8.5-r7.ebuild b/net-misc/htbinit/htbinit-0.8.5-r7.ebuild |
106 |
index c7a38b5aae1..1ae14a2d6a5 100644 |
107 |
--- a/net-misc/htbinit/htbinit-0.8.5-r7.ebuild |
108 |
+++ b/net-misc/htbinit/htbinit-0.8.5-r7.ebuild |
109 |
@@ -1,28 +1,36 @@ |
110 |
# Copyright 1999-2021 Gentoo Authors |
111 |
# Distributed under the terms of the GNU General Public License v2 |
112 |
|
113 |
-EAPI=5 |
114 |
+EAPI=7 |
115 |
|
116 |
-inherit epatch linux-info |
117 |
+inherit linux-info |
118 |
|
119 |
DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2" |
120 |
HOMEPAGE="https://www.sourceforge.net/projects/htbinit/" |
121 |
SRC_URI="mirror://sourceforge/htbinit/htb.init-v${PV}" |
122 |
+S="${WORKDIR}" |
123 |
|
124 |
LICENSE="GPL-2" |
125 |
SLOT="0" |
126 |
KEYWORDS="amd64 ~ppc x86" |
127 |
-IUSE="ipv6 esfq" |
128 |
+IUSE="esfq ipv6" |
129 |
|
130 |
DEPEND="sys-apps/iproute2" |
131 |
RDEPEND="${DEPEND}" |
132 |
|
133 |
-S=${WORKDIR} |
134 |
+PATCHES=( |
135 |
+ "${FILESDIR}"/htb.init-v0.8.5_tos.patch |
136 |
+ "${FILESDIR}"/prio_rule.patch |
137 |
+ "${FILESDIR}"/timecheck_fix.patch |
138 |
+ "${FILESDIR}"/htb.init_find_fix.patch |
139 |
+) |
140 |
|
141 |
pkg_setup() { |
142 |
+ local i |
143 |
for i in NET_SCH_HTB NET_SCH_SFQ NET_CLS_FW NET_CLS_U32 NET_CLS_ROUTE4 ; do |
144 |
CONFIG_CHECK="${CONFIG_CHECK} ~${i}" |
145 |
done |
146 |
+ |
147 |
use esfq && CONFIG_CHECK="${CONFIG_CHECK} ~NET_SCH_ESFQ" |
148 |
linux-info_pkg_setup |
149 |
} |
150 |
@@ -32,14 +40,15 @@ src_unpack() { |
151 |
} |
152 |
|
153 |
src_prepare() { |
154 |
- sed -i 's|/etc/sysconfig/htb|/etc/htb|g' "${S}"/htb.init |
155 |
- epatch "${FILESDIR}"/htb.init-v0.8.5_tos.patch |
156 |
- use ipv6 && epatch "${FILESDIR}"/htb_0.8.5_ipv6.diff |
157 |
- use esfq && epatch "${FILESDIR}"/htb_0.8.5_esfq.diff |
158 |
- epatch "${FILESDIR}"/prio_rule.patch |
159 |
- epatch "${FILESDIR}"/timecheck_fix.patch |
160 |
- epatch "${FILESDIR}"/htb.init_find_fix.patch |
161 |
- sed -i -e 's:/sbin/ip:/bin/ip:g' "${S}"/htb.init # bug #474700 |
162 |
+ default |
163 |
+ |
164 |
+ sed -i 's|/etc/sysconfig/htb|/etc/htb|g' "${S}"/htb.init || die |
165 |
+ |
166 |
+ use esfq && eapply "${FILESDIR}"/htb_0.8.5_esfq.patch |
167 |
+ use ipv6 && eapply "${FILESDIR}"/htb_0.8.5_ipv6.patch |
168 |
+ |
169 |
+ # bug #474700 |
170 |
+ sed -i -e 's:/sbin/ip:/bin/ip:g' "${S}"/htb.init || die |
171 |
} |
172 |
|
173 |
src_compile() { |
174 |
@@ -48,12 +57,14 @@ src_compile() { |
175 |
|
176 |
src_install() { |
177 |
dosbin htb.init |
178 |
+ |
179 |
newinitd "${FILESDIR}"/htbinit.rc htbinit |
180 |
+ |
181 |
keepdir /etc/htb |
182 |
} |
183 |
|
184 |
pkg_postinst() { |
185 |
- if [[ -z ${REPLACING_VERSIONS} ]] ; then |
186 |
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
187 |
elog 'Run "rc-update add htbinit default" to run htb.init at startup.' |
188 |
elog 'Please, read carefully the htb.init documentation.' |
189 |
elog 'New directory to store configuration is /etc/htb.' |