Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arping/files/, net-analyzer/arping/
Date: Mon, 16 May 2022 19:57:09
Message-Id: 1652730998.1e9321ab9798ddf673ce2f8b2e3d820399aae75c.sam@gentoo
1 commit: 1e9321ab9798ddf673ce2f8b2e3d820399aae75c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 16 06:30:40 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon May 16 19:56:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e9321ab
7
8 net-analyzer/arping: add 2.23
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 net-analyzer/arping/Manifest | 1 +
13 net-analyzer/arping/arping-2.23.ebuild | 60 ++++++++++++++++++++++
14 net-analyzer/arping/arping-9999.ebuild | 48 ++++++++++++-----
15 .../arping-2.23-configure.ac-seccomp-disable.patch | 31 +++++++++++
16 4 files changed, 126 insertions(+), 14 deletions(-)
17
18 diff --git a/net-analyzer/arping/Manifest b/net-analyzer/arping/Manifest
19 index fb1a565d27c9..a871acf0f729 100644
20 --- a/net-analyzer/arping/Manifest
21 +++ b/net-analyzer/arping/Manifest
22 @@ -1,2 +1,3 @@
23 DIST arping-2.21.tar.gz 50067 BLAKE2B 67b76cc48e9717117dbf43702df7f422634ed40196ec44d273a773610618922ddf7de47ffdf32cb7296db1dbce0a696c57b7992e6ad11f6fddf52a16212154fc SHA512 e976ce1a3ec0e4f57bbded09c6a07934e21df66ce7931422c420f5335dafcd88968f03ba6987d192dcdf51cca89180c86337aff50806713c7b04cb13e3e83504
24 DIST arping-2.22.tar.gz 50152 BLAKE2B 2215773b922219537339550e8034bb6eca82974469ebd0e399c73bd259ef4ff7a4510d9a5ff108cef3dac492477c54fc2517c2dfd4035158d0269f03c0e2a0b5 SHA512 0b36fff2c14c1ff89453ba63eea04de3343fcb19da7dbc1c8749bc926e441c54915cd628d54171d449e66e92663e31f12e057c30a80cd49c4412650e2cd00ef3
25 +DIST arping-2.23.tar.gz 51911 BLAKE2B 8b0d34522957a83d0a66b47576fa0ecbd1e4fc86537df6d2737510bdb1a4ea3d30feb664077790a8f70be9cf2cdcdc30a648261e9a6a30401ce85274c45ccf12 SHA512 45295fd68717379d18fcff4270c70e0d9df3cae175f0c2a9f1e8e88e3046f5109e7a95bb717be329af8d6002c9a2338efd39831a652c0b425b75058287fa35df
26
27 diff --git a/net-analyzer/arping/arping-2.23.ebuild b/net-analyzer/arping/arping-2.23.ebuild
28 new file mode 100644
29 index 000000000000..f143eadf7e1e
30 --- /dev/null
31 +++ b/net-analyzer/arping/arping-2.23.ebuild
32 @@ -0,0 +1,60 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +inherit autotools fcaps
39 +
40 +DESCRIPTION="A utility to see if a specific IP is taken and what MAC owns it"
41 +HOMEPAGE="http://www.habets.pp.se/synscan/programs.php?prog=arping"
42 +if [[ ${PV} == 9999 ]] ; then
43 + EGIT_REPO_URI="https://github.com/ThomasHabets/arping"
44 + inherit git-r3
45 +else
46 + SRC_URI="https://github.com/ThomasHabets/${PN}/archive/${P}.tar.gz"
47 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
48 +
49 + S="${WORKDIR}/${PN}-${P}"
50 +fi
51 +
52 +LICENSE="GPL-2"
53 +SLOT="2"
54 +IUSE="+seccomp test"
55 +RESTRICT="!test? ( test )"
56 +
57 +RDEPEND="net-libs/libpcap
58 + net-libs/libnet:1.1
59 + sys-libs/libcap
60 + seccomp? ( sys-libs/libseccomp )
61 + !net-misc/iputils[arping(+)]"
62 +DEPEND="${RDEPEND}
63 + test? (
64 + dev-libs/check
65 + dev-python/subunit
66 + )"
67 +
68 +FILECAPS=( cap_net_raw usr/sbin/arping )
69 +
70 +PATCHES=(
71 + "${FILESDIR}"/${PN}-2.23-configure.ac-seccomp-disable.patch
72 +)
73 +
74 +src_prepare() {
75 + default
76 +
77 + eautoreconf
78 +}
79 +
80 +src_configure() {
81 + local myeconfargs=(
82 + # Controls whether seccomp is used by default
83 + $(use_enable seccomp)
84 + )
85 +
86 + # Needed to actually make it optional and not automagic
87 + # (and we want it optional for the non-seccomp arches, like sparc)
88 + export ac_cv_lib_seccomp_seccomp_init=$(usex seccomp)
89 + export ac_cv_header_seccomp_h=$(usex seccomp)
90 +
91 + econf "${myeconfargs[@]}"
92 +}
93
94 diff --git a/net-analyzer/arping/arping-9999.ebuild b/net-analyzer/arping/arping-9999.ebuild
95 index 13d8502fc949..a706dc286849 100644
96 --- a/net-analyzer/arping/arping-9999.ebuild
97 +++ b/net-analyzer/arping/arping-9999.ebuild
98 @@ -1,36 +1,56 @@
99 -# Copyright 1999-2021 Gentoo Authors
100 +# Copyright 1999-2022 Gentoo Authors
101 # Distributed under the terms of the GNU General Public License v2
102
103 -EAPI=7
104 +EAPI=8
105
106 -inherit autotools git-r3 fcaps
107 +inherit autotools fcaps
108
109 DESCRIPTION="A utility to see if a specific IP is taken and what MAC owns it"
110 HOMEPAGE="http://www.habets.pp.se/synscan/programs.php?prog=arping"
111 -EGIT_REPO_URI="https://github.com/ThomasHabets/arping"
112 -S="${WORKDIR}/${PN}-${P}"
113 +if [[ ${PV} == 9999 ]] ; then
114 + EGIT_REPO_URI="https://github.com/ThomasHabets/arping"
115 + inherit git-r3
116 +else
117 + SRC_URI="https://github.com/ThomasHabets/${PN}/archive/${P}.tar.gz"
118 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
119 +
120 + S="${WORKDIR}/${PN}-${P}"
121 +fi
122
123 LICENSE="GPL-2"
124 SLOT="2"
125 -IUSE="test"
126 +IUSE="+seccomp test"
127 RESTRICT="!test? ( test )"
128
129 -RDEPEND="
130 - net-libs/libpcap
131 +RDEPEND="net-libs/libpcap
132 net-libs/libnet:1.1
133 - !net-misc/iputils[arping(+)]
134 -"
135 -DEPEND="
136 - ${RDEPEND}
137 + sys-libs/libcap
138 + seccomp? ( sys-libs/libseccomp )
139 + !net-misc/iputils[arping(+)]"
140 +DEPEND="${RDEPEND}
141 test? (
142 dev-libs/check
143 dev-python/subunit
144 - )
145 -"
146 + )"
147
148 FILECAPS=( cap_net_raw usr/sbin/arping )
149
150 src_prepare() {
151 default
152 +
153 eautoreconf
154 }
155 +
156 +src_configure() {
157 + local myeconfargs=(
158 + # Controls whether seccomp is used by default
159 + $(use_enable seccomp)
160 + )
161 +
162 + # Needed to actually make it optional and not automagic
163 + # (and we want it optional for the non-seccomp arches, like sparc)
164 + export ac_cv_lib_seccomp_seccomp_init=$(usex seccomp)
165 + export ac_cv_header_seccomp_h=$(usex seccomp)
166 +
167 + econf "${myeconfargs[@]}"
168 +}
169
170 diff --git a/net-analyzer/arping/files/arping-2.23-configure.ac-seccomp-disable.patch b/net-analyzer/arping/files/arping-2.23-configure.ac-seccomp-disable.patch
171 new file mode 100644
172 index 000000000000..53b59da1a961
173 --- /dev/null
174 +++ b/net-analyzer/arping/files/arping-2.23-configure.ac-seccomp-disable.patch
175 @@ -0,0 +1,31 @@
176 +https://github.com/ThomasHabets/arping/pull/51
177 +
178 +From 47622ccc97591f55899f8fff325af241b89df09f Mon Sep 17 00:00:00 2001
179 +From: Sam James <sam@g.o>
180 +Date: Mon, 16 May 2022 06:24:27 +0000
181 +Subject: [PATCH] configure.ac: make --disable-seccomp work
182 +
183 +The first branch ("[action-if-given]") is taken even if --disable-seccomp
184 +is passed. So, in that branch, check whether the user disabled it or not.
185 +
186 +Without this, we'd get a failure when seccomp is detected but we want
187 +to disable it:
188 +```
189 +./configure --disable-seccomp
190 +[...]
191 +checking for library containing clock_gettime... none required
192 +configure: error: --enable-seccomp given but seccomp libraries not present
193 +```
194 +
195 +Signed-off-by: Sam James <sam@g.o>
196 +--- a/configure.ac
197 ++++ b/configure.ac
198 +@@ -35,7 +35,7 @@ AC_CHECK_LIB([pcap], [pcap_open_live], ,[AC_MSG_ERROR([libpcap not found])])
199 + AC_SEARCH_LIBS([clock_gettime], [rt])
200 +
201 + AC_ARG_ENABLE([seccomp], [Enable seccomp priv drops by default (-z to turn on, -Z for off)], [
202 +- if test "$ac_cv_lib_seccomp_seccomp_init" = "no"; then
203 ++ if test x"$enableval" != x"no" && test "$ac_cv_lib_seccomp_seccomp_init" = "no"; then
204 + AC_MSG_ERROR([--enable-seccomp given but seccomp libraries not present])
205 + fi
206 + AC_DEFINE([DEFAULT_SECCOMP], [1], [Enable seccomp by default])