Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/mcproxy/, net-misc/mcproxy/files/
Date: Sat, 29 Sep 2018 10:43:40
Message-Id: 1538217810.2716879722854bcd457b1ceb7025db16f4f2a179.mgorny@gentoo
1 commit: 2716879722854bcd457b1ceb7025db16f4f2a179
2 Author: Conrad Kostecki <conrad <AT> kostecki <DOT> com>
3 AuthorDate: Wed Sep 5 21:20:07 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 29 10:43:30 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27168797
7
8 net-misc/mcproxy: New package
9
10 Closes: https://bugs.gentoo.org/665314
11 Signed-off-by: Conrad Kostecki <conrad <AT> kostecki.com>
12 Package-Manager: Portage-2.3.49, Repoman-2.3.10
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14 Closes: https://github.com/gentoo/gentoo/pull/9787
15
16 net-misc/mcproxy/Manifest | 1 +
17 .../mcproxy/files/fix_checksum_calculation.patch | 41 ++++++++++++++++
18 net-misc/mcproxy/files/mcproxy.confd | 5 ++
19 net-misc/mcproxy/files/mcproxy.initd | 27 +++++++++++
20 net-misc/mcproxy/files/mcproxy.service | 10 ++++
21 net-misc/mcproxy/mcproxy-1.1.1.ebuild | 55 ++++++++++++++++++++++
22 net-misc/mcproxy/metadata.xml | 29 ++++++++++++
23 7 files changed, 168 insertions(+)
24
25 diff --git a/net-misc/mcproxy/Manifest b/net-misc/mcproxy/Manifest
26 new file mode 100644
27 index 00000000000..b3c14ff5c82
28 --- /dev/null
29 +++ b/net-misc/mcproxy/Manifest
30 @@ -0,0 +1 @@
31 +DIST mcproxy-1.1.1.tar.gz 3373209 BLAKE2B 0b54f7c20b9d6d66c5b88daeaa00901918057b449b932656355303a83c4e4f1feb370de0c55e55484b9bafc63bfd82b8ef8179144529f3074e3d94e147cc8ff5 SHA512 408bc27169c9c90080c7842aaeaf260d5349b735e017d1750118f190124f48743fbf15fc05eee16290e38cc2f752e27b28548714a3d0cd2366dfc53dafcda0bb
32
33 diff --git a/net-misc/mcproxy/files/fix_checksum_calculation.patch b/net-misc/mcproxy/files/fix_checksum_calculation.patch
34 new file mode 100644
35 index 00000000000..2cbfb6590b7
36 --- /dev/null
37 +++ b/net-misc/mcproxy/files/fix_checksum_calculation.patch
38 @@ -0,0 +1,41 @@
39 +From 93b5ace42268160ebbfff4c61818fb15fa2d9b99 Mon Sep 17 00:00:00 2001
40 +From: Sebastian Woelke <Sebastian.Woelke@××××××.de>
41 +Date: Thu, 24 Aug 2017 14:41:50 +0200
42 +Subject: [PATCH] Fix checksum calculation
43 +
44 +---
45 + mcproxy/src/utils/mroute_socket.cpp | 14 ++++++++++----
46 + 1 file changed, 10 insertions(+), 4 deletions(-)
47 +
48 +diff --git a/mcproxy/src/utils/mroute_socket.cpp b/mcproxy/src/utils/mroute_socket.cpp
49 +index 61289dd..3a55359 100644
50 +--- a/src/utils/mroute_socket.cpp
51 ++++ b/src/utils/mroute_socket.cpp
52 +@@ -157,17 +157,23 @@ u_int16_t mroute_socket::calc_checksum(const unsigned char* buf, int buf_size) c
53 +
54 + u_int16_t* b = (u_int16_t*)buf;
55 + int sum = 0;
56 ++ int csum;
57 +
58 + for (int i = 0; i < buf_size / 2; i++) {
59 +- ADD_SIGNED_NUM_U16(sum, b[i]);
60 +- //sum +=b[i];
61 ++ sum +=b[i];
62 + }
63 +
64 + if (buf_size % 2 == 1) {
65 +- //sum += buf[buf_size-1];
66 +- ADD_SIGNED_NUM_U16(sum, buf[buf_size - 1]);
67 ++ sum += buf[buf_size-1];
68 + }
69 +
70 ++ // fold checksum
71 ++ csum = sum & 0xFFFF;
72 ++ sum = sum >> 16;
73 ++ sum += csum;
74 ++ // fold again in case of overflow.
75 ++ sum += sum >> 16;
76 ++
77 + return ~sum;
78 + }
79 +
80
81 diff --git a/net-misc/mcproxy/files/mcproxy.confd b/net-misc/mcproxy/files/mcproxy.confd
82 new file mode 100644
83 index 00000000000..908bc353d4d
84 --- /dev/null
85 +++ b/net-misc/mcproxy/files/mcproxy.confd
86 @@ -0,0 +1,5 @@
87 +# Copyright 1999-2018 Gentoo Foundation
88 +# Distributed under the terms of the GNU General Public License v2
89 +
90 +# Additional command line options
91 +# MCPROXY_OPTS=""
92
93 diff --git a/net-misc/mcproxy/files/mcproxy.initd b/net-misc/mcproxy/files/mcproxy.initd
94 new file mode 100644
95 index 00000000000..44efd721c54
96 --- /dev/null
97 +++ b/net-misc/mcproxy/files/mcproxy.initd
98 @@ -0,0 +1,27 @@
99 +#!/sbin/openrc-run
100 +# Copyright 1999-2018 Gentoo Foundation
101 +# Distributed under the terms of the GNU General Public License v2
102 +
103 +config="/etc/${RC_SVCNAME}.conf"
104 +extra_commands="checkconfig"
105 +name="Mcproxy"
106 +pidfile="/run/${RC_SVCNAME}.pid"
107 +
108 +command="mcproxy"
109 +command_background="true"
110 +command_args="${MCPROXY_OPTS} -f ${config}"
111 +command_args_checkconfig="-c"
112 +procname="${RC_SVCNAME}"
113 +
114 +checkconfig() {
115 + ${command} ${command_args_checkconfig}
116 +}
117 +
118 +start_pre() {
119 + if [ ! -f "${config}" ]; then
120 + eerror "Please create ${config} before starting ${name}!"
121 + return 1
122 + else
123 + return 0
124 + fi
125 +}
126
127 diff --git a/net-misc/mcproxy/files/mcproxy.service b/net-misc/mcproxy/files/mcproxy.service
128 new file mode 100644
129 index 00000000000..0bad0f19cc8
130 --- /dev/null
131 +++ b/net-misc/mcproxy/files/mcproxy.service
132 @@ -0,0 +1,10 @@
133 +[Unit]
134 +After=network-online.target
135 +Description=Mcproxy
136 +
137 +[Service]
138 +ExecStart=/usr/bin/mcproxy -f /etc/mcproxy.conf
139 +Type=simple
140 +
141 +[Install]
142 +WantedBy=network.target
143
144 diff --git a/net-misc/mcproxy/mcproxy-1.1.1.ebuild b/net-misc/mcproxy/mcproxy-1.1.1.ebuild
145 new file mode 100644
146 index 00000000000..463944737b3
147 --- /dev/null
148 +++ b/net-misc/mcproxy/mcproxy-1.1.1.ebuild
149 @@ -0,0 +1,55 @@
150 +# Copyright 1999-2018 Gentoo Foundation
151 +# Distributed under the terms of the GNU General Public License v2
152 +
153 +EAPI="6"
154 +
155 +inherit linux-info qmake-utils systemd
156 +
157 +DESCRIPTION="A multicast proxy for IGMP/MLD"
158 +HOMEPAGE="https://mcproxy.realmv6.org/ https://github.com/mcproxy/mcproxy"
159 +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
160 +
161 +KEYWORDS="~amd64 ~x86"
162 +LICENSE="GPL-2+"
163 +SLOT="0"
164 +IUSE="doc"
165 +
166 +DEPEND="dev-qt/qtcore:5
167 + doc? ( app-doc/doxygen )"
168 +
169 +S="${WORKDIR}/${P}/${PN}"
170 +
171 +PATCHES=( "${FILESDIR}/fix_checksum_calculation.patch" )
172 +
173 +CONFIG_CHECK="~IP_MULTICAST ~IP_MROUTE"
174 +
175 +src_prepare() {
176 + # Change install path from '/usr/local/bin' to '/usr/bin'
177 + sed -e 's/local//' -i mcproxy.pro || die
178 +
179 + default
180 +}
181 +
182 +src_configure() {
183 + eqmake5
184 +}
185 +
186 +src_compile() {
187 + default
188 +
189 + use doc && emake doc
190 +}
191 +
192 +src_install() {
193 + emake INSTALL_ROOT="${ED%/}" install
194 +
195 + insinto /etc
196 + doins mcproxy.conf
197 +
198 + newinitd "${FILESDIR}"/mcproxy.initd mcproxy
199 + systemd_dounit "${FILESDIR}"/mcproxy.service
200 +
201 + newconfd "${FILESDIR}"/mcproxy.confd mcproxy
202 +
203 + use doc && dodoc -r ../docs/.
204 +}
205
206 diff --git a/net-misc/mcproxy/metadata.xml b/net-misc/mcproxy/metadata.xml
207 new file mode 100644
208 index 00000000000..e601c26a307
209 --- /dev/null
210 +++ b/net-misc/mcproxy/metadata.xml
211 @@ -0,0 +1,29 @@
212 +<?xml version="1.0" encoding="UTF-8"?>
213 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
214 +<pkgmetadata>
215 + <maintainer type="person">
216 + <email>ck+gentoo@××××××××.de</email>
217 + <name>Conrad Kostecki</name>
218 + </maintainer>
219 + <maintainer type="project">
220 + <email>proxy-maint@g.o</email>
221 + <name>Proxy Maintainers</name>
222 + </maintainer>
223 + <longdescription>
224 + IGMP/MLD proxies offer the possibility option to combine
225 + local multicast networks with a larger multicast infrastructure.
226 + In contrast to multicast routers, proxies are lightweight and
227 + do not require the support of a multicast routing protocol such as PIM or DVMRP.
228 + A common use case is a local stub networks that interconnects with
229 + a remote multicast routing domain, e.g. via a tunnel.
230 + But it can also be used in PMIPv6 domain to enable multicast for sources and listeners (RFC 6224).
231 + The Mcproxy meets the requirements of the IGMP/MLD proxying standard (RFC 4605)
232 + and has additional functionalities. The multicast proxy can be instantiated multiple times,
233 + is dynamically configurable at runtime, supports multiple upstreams and peering-interfaces
234 + for a non hierarchical interconnection of multicast proxies.
235 + </longdescription>
236 + <upstream>
237 + <bugs-to>https://github.com/mcproxy/mcproxy/issues</bugs-to>
238 + <remote-id type="github">mcproxy/mcproxy</remote-id>
239 + </upstream>
240 +</pkgmetadata>