1 |
commit: 2e7aa9eed8f8a1bb10838fc6e11cc41e5884d270 |
2 |
Author: Hans Fredrik Nordhaug <hansfn <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Feb 26 21:17:24 2021 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Fri Feb 26 21:17:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2e7aa9ee |
7 |
|
8 |
net-misc/can-utils: New package 2020.12.0 |
9 |
|
10 |
Package-Manager: Portage-3.0.13, Repoman-3.0.2 |
11 |
Signed-off-by: Hans Fredrik Nordhaug <hansfn <AT> gmail.com> |
12 |
|
13 |
net-misc/can-utils/Manifest | 2 ++ |
14 |
net-misc/can-utils/can-utils-2020.02.04.ebuild | 49 ++++++++++++++++++++++++++ |
15 |
net-misc/can-utils/can-utils-2020.12.0.ebuild | 49 ++++++++++++++++++++++++++ |
16 |
net-misc/can-utils/can-utils-9999-r3.ebuild | 49 ++++++++++++++++++++++++++ |
17 |
net-misc/can-utils/files/slcan.service | 19 ++++++++++ |
18 |
net-misc/can-utils/files/slcan.service.conf | 18 ++++++++++ |
19 |
net-misc/can-utils/files/slcand.confd | 18 ++++++++++ |
20 |
net-misc/can-utils/files/slcand.initd | 39 ++++++++++++++++++++ |
21 |
net-misc/can-utils/metadata.xml | 8 +++++ |
22 |
9 files changed, 251 insertions(+) |
23 |
|
24 |
diff --git a/net-misc/can-utils/Manifest b/net-misc/can-utils/Manifest |
25 |
new file mode 100644 |
26 |
index 00000000..d6ff0f22 |
27 |
--- /dev/null |
28 |
+++ b/net-misc/can-utils/Manifest |
29 |
@@ -0,0 +1,2 @@ |
30 |
+DIST can-utils-2020.02.04.tar.gz 121866 BLAKE2B 64a9e0dbc2e65ef01b6709fc608daecce53592f98c002a46b15a282fff33f52d1d7b34d22ed85f1e2a2eb8a7be6e5ce69a85ba4e2ba19f251994f5022697f474 SHA512 5f12a84b82564da5a47e6dc906bf26f0e56db77ce367b5b72a2820cf18447d78a355d0173c678e33dc0e4cc07ef3a12b3a84d6b016c7ee0b1ac5a7f10daee1c8 |
31 |
+DIST can-utils-2020.12.0.tar.gz 132010 BLAKE2B 626c0b88973c0579728869013f48ec7de4bcd94dd98ed4ae8349a0b71ec2eb9892d267501ff7af58b34ac528f2d6e733aad795582bcc96b03d20ae0710986ea8 SHA512 b9d92b7734611deaf445708aabf4f46f7cf3ad88f46618fbae6821d308b2950da014420b194792e4d2458f396bd85f200a8d10112c10191a98624073b8502c19 |
32 |
|
33 |
diff --git a/net-misc/can-utils/can-utils-2020.02.04.ebuild b/net-misc/can-utils/can-utils-2020.02.04.ebuild |
34 |
new file mode 100644 |
35 |
index 00000000..eff9dabb |
36 |
--- /dev/null |
37 |
+++ b/net-misc/can-utils/can-utils-2020.02.04.ebuild |
38 |
@@ -0,0 +1,49 @@ |
39 |
+# Copyright 2021 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+EAPI=7 |
43 |
+ |
44 |
+inherit autotools systemd |
45 |
+ |
46 |
+DESCRIPTION="CAN userspace utilities and tools" |
47 |
+HOMEPAGE="https://github.com/linux-can/" |
48 |
+SRC_URI="https://github.com/linux-can/can-utils/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
49 |
+ |
50 |
+LICENSE="GPL-2" |
51 |
+SLOT="0" |
52 |
+KEYWORDS="~amd64" |
53 |
+IUSE="systemd" |
54 |
+ |
55 |
+DEPEND="" |
56 |
+ |
57 |
+src_prepare() { |
58 |
+ default |
59 |
+ |
60 |
+ eautoreconf |
61 |
+} |
62 |
+ |
63 |
+# Default src_install + newconfd and newinitd |
64 |
+src_install() { |
65 |
+ |
66 |
+ emake DESTDIR="${D}" install |
67 |
+ |
68 |
+ if ! declare -p DOCS >/dev/null 2>&1 ; then |
69 |
+ local d |
70 |
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ |
71 |
+ FAQ CREDITS CHANGELOG ; do |
72 |
+ [[ -s "${d}" ]] && dodoc "${d}" |
73 |
+ done |
74 |
+ elif declare -p DOCS | grep -q "^declare -a " ; then |
75 |
+ dodoc "${DOCS[@]}" |
76 |
+ else |
77 |
+ dodoc ${DOCS} |
78 |
+ fi |
79 |
+ |
80 |
+ if use systemd ; then |
81 |
+ systemd_dounit "${FILESDIR}/slcan.service" |
82 |
+ systemd_install_serviced "${FILESDIR}/slcan.service.conf" |
83 |
+ else |
84 |
+ newconfd "${FILESDIR}/slcand.confd" slcand |
85 |
+ newinitd "${FILESDIR}/slcand.initd" slcand |
86 |
+ fi |
87 |
+} |
88 |
|
89 |
diff --git a/net-misc/can-utils/can-utils-2020.12.0.ebuild b/net-misc/can-utils/can-utils-2020.12.0.ebuild |
90 |
new file mode 100644 |
91 |
index 00000000..eff9dabb |
92 |
--- /dev/null |
93 |
+++ b/net-misc/can-utils/can-utils-2020.12.0.ebuild |
94 |
@@ -0,0 +1,49 @@ |
95 |
+# Copyright 2021 Gentoo Authors |
96 |
+# Distributed under the terms of the GNU General Public License v2 |
97 |
+ |
98 |
+EAPI=7 |
99 |
+ |
100 |
+inherit autotools systemd |
101 |
+ |
102 |
+DESCRIPTION="CAN userspace utilities and tools" |
103 |
+HOMEPAGE="https://github.com/linux-can/" |
104 |
+SRC_URI="https://github.com/linux-can/can-utils/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
105 |
+ |
106 |
+LICENSE="GPL-2" |
107 |
+SLOT="0" |
108 |
+KEYWORDS="~amd64" |
109 |
+IUSE="systemd" |
110 |
+ |
111 |
+DEPEND="" |
112 |
+ |
113 |
+src_prepare() { |
114 |
+ default |
115 |
+ |
116 |
+ eautoreconf |
117 |
+} |
118 |
+ |
119 |
+# Default src_install + newconfd and newinitd |
120 |
+src_install() { |
121 |
+ |
122 |
+ emake DESTDIR="${D}" install |
123 |
+ |
124 |
+ if ! declare -p DOCS >/dev/null 2>&1 ; then |
125 |
+ local d |
126 |
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ |
127 |
+ FAQ CREDITS CHANGELOG ; do |
128 |
+ [[ -s "${d}" ]] && dodoc "${d}" |
129 |
+ done |
130 |
+ elif declare -p DOCS | grep -q "^declare -a " ; then |
131 |
+ dodoc "${DOCS[@]}" |
132 |
+ else |
133 |
+ dodoc ${DOCS} |
134 |
+ fi |
135 |
+ |
136 |
+ if use systemd ; then |
137 |
+ systemd_dounit "${FILESDIR}/slcan.service" |
138 |
+ systemd_install_serviced "${FILESDIR}/slcan.service.conf" |
139 |
+ else |
140 |
+ newconfd "${FILESDIR}/slcand.confd" slcand |
141 |
+ newinitd "${FILESDIR}/slcand.initd" slcand |
142 |
+ fi |
143 |
+} |
144 |
|
145 |
diff --git a/net-misc/can-utils/can-utils-9999-r3.ebuild b/net-misc/can-utils/can-utils-9999-r3.ebuild |
146 |
new file mode 100644 |
147 |
index 00000000..1af5ac07 |
148 |
--- /dev/null |
149 |
+++ b/net-misc/can-utils/can-utils-9999-r3.ebuild |
150 |
@@ -0,0 +1,49 @@ |
151 |
+# Copyright 2021 Gentoo Authors |
152 |
+# Distributed under the terms of the GNU General Public License v2 |
153 |
+ |
154 |
+EAPI=7 |
155 |
+ |
156 |
+EGIT_REPO_URI="https://github.com/linux-can/${PN}.git" |
157 |
+EGIT_BRANCH="master" |
158 |
+ |
159 |
+inherit autotools git-r3 systemd |
160 |
+ |
161 |
+DESCRIPTION="CAN userspace utilities and tools" |
162 |
+HOMEPAGE="https://github.com/linux-can/" |
163 |
+ |
164 |
+LICENSE="GPL-2" |
165 |
+SLOT="0" |
166 |
+KEYWORDS="~amd64" |
167 |
+IUSE="systemd" |
168 |
+ |
169 |
+DEPEND="" |
170 |
+ |
171 |
+src_prepare() { |
172 |
+ eautoreconf |
173 |
+} |
174 |
+ |
175 |
+# Default src_install + newconfd and newinitd |
176 |
+src_install() { |
177 |
+ |
178 |
+ emake DESTDIR="${D}" install |
179 |
+ |
180 |
+ if ! declare -p DOCS >/dev/null 2>&1 ; then |
181 |
+ local d |
182 |
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ |
183 |
+ FAQ CREDITS CHANGELOG ; do |
184 |
+ [[ -s "${d}" ]] && dodoc "${d}" |
185 |
+ done |
186 |
+ elif declare -p DOCS | grep -q "^declare -a " ; then |
187 |
+ dodoc "${DOCS[@]}" |
188 |
+ else |
189 |
+ dodoc ${DOCS} |
190 |
+ fi |
191 |
+ |
192 |
+ if use systemd ; then |
193 |
+ systemd_dounit "${FILESDIR}/slcan.service" |
194 |
+ systemd_install_serviced "${FILESDIR}/slcan.service.conf" |
195 |
+ else |
196 |
+ newconfd "${FILESDIR}/slcand.confd" slcand |
197 |
+ newinitd "${FILESDIR}/slcand.initd" slcand |
198 |
+ fi |
199 |
+} |
200 |
|
201 |
diff --git a/net-misc/can-utils/files/slcan.service b/net-misc/can-utils/files/slcan.service |
202 |
new file mode 100644 |
203 |
index 00000000..01e4b3d7 |
204 |
--- /dev/null |
205 |
+++ b/net-misc/can-utils/files/slcan.service |
206 |
@@ -0,0 +1,19 @@ |
207 |
+[Unit] |
208 |
+Description=Userspace daemon for serial line CAN interface driver SLCAN |
209 |
+ |
210 |
+[Service] |
211 |
+Environment=can_speed=S5 |
212 |
+Environment=tty_baud=460800 |
213 |
+Environment=tty_device=ttyUSB0 |
214 |
+Environment=can_device=can0 |
215 |
+ |
216 |
+ |
217 |
+ExecStartPre=/sbin/modprobe slcan |
218 |
+ExecStartPre=/bin/stty -F /dev/${tty_device} ${tty_baud} line 0 cs8 -onlcr -echo raw min 100 time 2 |
219 |
+ExecStartPre=/bin/sh -c 'echo -e -n "C\rF\r${can_speed}\rO\r" > /dev/${tty_device}' |
220 |
+ |
221 |
+ExecStart=/usr/bin/slcand -F ${tty_device} ${can_device} |
222 |
+ExecStartPost=/bin/sleep 1 |
223 |
+ExecStartPost=/bin/ip link set can0 txqueuelen 1000 up |
224 |
+ |
225 |
+ExecStopPost=/sbin/modprobe -r slcan |
226 |
|
227 |
diff --git a/net-misc/can-utils/files/slcan.service.conf b/net-misc/can-utils/files/slcan.service.conf |
228 |
new file mode 100644 |
229 |
index 00000000..c29e8b83 |
230 |
--- /dev/null |
231 |
+++ b/net-misc/can-utils/files/slcan.service.conf |
232 |
@@ -0,0 +1,18 @@ |
233 |
+# This file contains the configuration for the slcan daemon |
234 |
+ |
235 |
+ |
236 |
+ |
237 |
+# The `stty' command includes support for speeds of 57600, 115200, |
238 |
+# 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, |
239 |
+# 2000000, 2500000, 3000000, 3500000, or 4000000 |
240 |
+ |
241 |
+# 921600 baud for S6 |
242 |
+# 460800 baud for S5 |
243 |
+ |
244 |
+# Case sensitive speed setting |
245 |
+ |
246 |
+[Service] |
247 |
+Environment=can_speed=S5 |
248 |
+Environment=tty_baud=460800 |
249 |
+Environment=tty_device=ttyUSB0 |
250 |
+Environment=can_device=can0 |
251 |
|
252 |
diff --git a/net-misc/can-utils/files/slcand.confd b/net-misc/can-utils/files/slcand.confd |
253 |
new file mode 100644 |
254 |
index 00000000..725fcd10 |
255 |
--- /dev/null |
256 |
+++ b/net-misc/can-utils/files/slcand.confd |
257 |
@@ -0,0 +1,18 @@ |
258 |
+# /etc/conf.d/slcand |
259 |
+# This file contains the configuration for the slcan daemon |
260 |
+ |
261 |
+ |
262 |
+ |
263 |
+# The `stty' command includes support for speeds of 57600, 115200, |
264 |
+# 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, |
265 |
+# 2000000, 2500000, 3000000, 3500000, or 4000000 |
266 |
+ |
267 |
+# 921600 baud for S6 |
268 |
+# 460800 baud for S5 |
269 |
+ |
270 |
+# Case sensitive speed setting |
271 |
+ |
272 |
+can_speed="S5" |
273 |
+tty_baud="460800" |
274 |
+tty_device="ttyUSB0" |
275 |
+can_device="can0" |
276 |
|
277 |
diff --git a/net-misc/can-utils/files/slcand.initd b/net-misc/can-utils/files/slcand.initd |
278 |
new file mode 100644 |
279 |
index 00000000..ffe08a9b |
280 |
--- /dev/null |
281 |
+++ b/net-misc/can-utils/files/slcand.initd |
282 |
@@ -0,0 +1,39 @@ |
283 |
+#!/sbin/runscript |
284 |
+# Copyright 2013 Brunvoll AS |
285 |
+ |
286 |
+ |
287 |
+start() { |
288 |
+ |
289 |
+ if [ -z "${can_speed}" -o -z "${tty_baud}" -o -z "${tty_device}" -o -z "${can_device}" ]; then |
290 |
+ eerror "CAN speed, CAN device, tty_baud or tty_device not set" |
291 |
+ return 1 |
292 |
+ fi |
293 |
+ |
294 |
+ if ! grep -q slcan /proc/modules; then |
295 |
+ einfo "Loading module slcan" |
296 |
+ modprobe slcan || return 1 |
297 |
+ fi |
298 |
+ |
299 |
+ ebegin "Creating can0 at speed ${can_speed} on device ${tty_device}" |
300 |
+ einfo "Setting baudrate of ${tty_device} to ${tty_baud}" |
301 |
+ stty -F /dev/${tty_device} ${tty_baud} line 0 cs8 -onlcr -echo raw min 100 time 2 |
302 |
+ sleep 1 |
303 |
+ einfo "Set bitrate of slcan on ${tty_device} to ${can_speed}: " |
304 |
+ echo -e -n "C\rF\r${can_speed}\rO\r" > /dev/${tty_device} |
305 |
+ sleep 1 |
306 |
+ einfo "Starting slcand" |
307 |
+ start-stop-daemon --start --background --make-pidfile \ |
308 |
+ --pidfile /var/run/slcand.pid \ |
309 |
+ --exec /usr/bin/slcand -- ${tty_device} ${can_device} |
310 |
+ sleep 1 |
311 |
+ ifconfig ${can_device} up |
312 |
+ eend $? |
313 |
+} |
314 |
+ |
315 |
+stop() { |
316 |
+ ebegin "Stopping slcand" |
317 |
+ start-stop-daemon --stop --quiet --pidfile /var/run/slcand.pid |
318 |
+ sleep 1 |
319 |
+ rmmod slcan |
320 |
+ eend $? |
321 |
+} |
322 |
|
323 |
diff --git a/net-misc/can-utils/metadata.xml b/net-misc/can-utils/metadata.xml |
324 |
new file mode 100644 |
325 |
index 00000000..1c142c04 |
326 |
--- /dev/null |
327 |
+++ b/net-misc/can-utils/metadata.xml |
328 |
@@ -0,0 +1,8 @@ |
329 |
+<?xml version="1.0" encoding="UTF-8"?> |
330 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
331 |
+<pkgmetadata> |
332 |
+ <maintainer type="person"> |
333 |
+ <email>hansfn@×××××.com</email> |
334 |
+ <name>Hans Fredrik Nordhaug</name> |
335 |
+ </maintainer> |
336 |
+</pkgmetadata> |