Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/wireshark/, net-analyzer/wireshark/files/
Date: Tue, 16 Jan 2018 09:56:35
Message-Id: 1516096588.e0e175a627ca55478fb4ffae9349eb607a18b64f.jer@gentoo
1 commit: e0e175a627ca55478fb4ffae9349eb607a18b64f
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 16 09:56:13 2018 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 16 09:56:28 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0e175a6
7
8 net-analyzer/wireshark: Add upstream patch for libsmi configure check (bug #644734 by Bob Johnson).
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 .../wireshark/files/wireshark-2.4.3-libsmi.patch | 233 +++++++++++++++++++++
13 net-analyzer/wireshark/wireshark-2.4.3.ebuild | 1 +
14 net-analyzer/wireshark/wireshark-2.4.4.ebuild | 1 +
15 3 files changed, 235 insertions(+)
16
17 diff --git a/net-analyzer/wireshark/files/wireshark-2.4.3-libsmi.patch b/net-analyzer/wireshark/files/wireshark-2.4.3-libsmi.patch
18 new file mode 100644
19 index 00000000000..288efb7d66f
20 --- /dev/null
21 +++ b/net-analyzer/wireshark/files/wireshark-2.4.3-libsmi.patch
22 @@ -0,0 +1,233 @@
23 +From 72c2e53981a204d746737d8c01c4ad3738cd4880 Mon Sep 17 00:00:00 2001
24 +From: =?utf8?q?Jo=C3=A3o=20Valverde?= <joao.valverde@×××××××××××××××.pt>
25 +Date: Sun, 5 Nov 2017 12:05:43 +0000
26 +Subject: [PATCH 1/1] autotools: Use pkg-config to configure Libsmi
27 +MIME-Version: 1.0
28 +Content-Type: text/plain; charset=utf8
29 +Content-Transfer-Encoding: 8bit
30 +
31 +Change-Id: Icecea743739aa7e1a65753f623f311514260d373
32 +Reviewed-on: https://code.wireshark.org/review/24252
33 +Petri-Dish: João Valverde <j@×××.pt>
34 +Tested-by: Petri Dish Buildbot
35 +Reviewed-by: João Valverde <j@×××.pt>
36 +---
37 + Makefile.am | 2 +-
38 + configure.ac | 27 +++++++++---
39 + epan/Makefile.am | 2 +-
40 + m4/libsmi.m4 | 125 -------------------------------------------------------
41 + 4 files changed, 24 insertions(+), 132 deletions(-)
42 + delete mode 100644 m4/libsmi.m4
43 +
44 +diff --git a/Makefile.am b/Makefile.am
45 +index a2851e0..e6ed5eb 100644
46 +--- a/Makefile.am
47 ++++ b/Makefile.am
48 +@@ -422,7 +422,7 @@ EPAN_EXTRA_LIBS = \
49 + @KRB5_LIBS@ \
50 + @LIBGCRYPT_LIBS@ \
51 + @LIBGNUTLS_LIBS@ \
52 +- @LIBSMI_LDFLAGS@
53 ++ @LIBSMI_LIBS@
54 +
55 + # Libraries and plugin flags with which to link wireshark.
56 + #
57 +diff --git a/configure.ac b/configure.ac
58 +index 3b3475b..326561c 100644
59 +--- a/configure.ac
60 ++++ b/configure.ac
61 +@@ -432,10 +432,6 @@ linux*)
62 + fi
63 + esac
64 +
65 +-# libsmi
66 +-# FIXME: currently the path argument to with-libsmi is being ignored
67 +-AX_LIBSMI
68 +-
69 + #
70 + # Check if we should build the Wireshark User's Guide
71 + #
72 +@@ -2427,6 +2423,27 @@ else
73 + fi
74 + AM_CONDITIONAL(HAVE_LIBXML2, test "x$have_libxml2" = "xyes")
75 +
76 ++#
77 ++# Libsmi check
78 ++#
79 ++AC_ARG_WITH(libsmi,
80 ++ AC_HELP_STRING([--with-libsmi=@<:@yes/no@:>@],
81 ++ [use libsmi MIB/PIB library @<:@default=yes, if available@:>@]),
82 ++ [], [with_libsmi="if_available"])
83 ++
84 ++have_libsmi=no
85 ++if test "x$with_libsmi" != "xno"; then
86 ++ PKG_CHECK_MODULES(LIBSMI, libsmi,
87 ++ [have_libsmi=yes
88 ++ AC_DEFINE(HAVE_LIBSMI, 1, [Define if you have libsmi])
89 ++ ],
90 ++ [if test "x$with_libsmi" = "xyes"; then
91 ++ # Error out if the user explicitly requested libsmi
92 ++ AC_MSG_ERROR([Libsmi was requested, but is not installed for development])
93 ++ fi
94 ++ ]
95 ++ )
96 ++fi
97 +
98 + dnl
99 + dnl check whether plugins should be enabled
100 +@@ -3012,7 +3029,7 @@ echo " Use pcap library : $want_pcap"
101 + echo " Use zlib library : $zlib_message"
102 + echo " Use kerberos library : $krb5_message"
103 + echo " Use c-ares library : $c_ares_message"
104 +-echo " Use SMI MIB library : $libsmi_message"
105 ++echo " Use SMI MIB library : $have_libsmi"
106 + echo " Use GNU gcrypt library : yes"
107 + echo " Use GnuTLS library : $tls_message"
108 + echo " Use POSIX capabilities library : $libcap_message"
109 +diff --git a/epan/Makefile.am b/epan/Makefile.am
110 +index 9f7de62..e85f97b 100644
111 +--- a/epan/Makefile.am
112 ++++ b/epan/Makefile.am
113 +@@ -330,7 +330,7 @@ libwireshark_la_LIBADD = \
114 + @KRB5_LIBS@ \
115 + @LIBGCRYPT_LIBS@ \
116 + @LIBGNUTLS_LIBS@ \
117 +- @LIBSMI_LDFLAGS@ \
118 ++ @LIBSMI_LIBS@ \
119 + @LZ4_LIBS@ \
120 + @NGHTTP2_LIBS@ \
121 + @SNAPPY_LIBS@ \
122 +diff --git a/m4/libsmi.m4 b/m4/libsmi.m4
123 +deleted file mode 100644
124 +index d719438..0000000
125 +--- a/m4/libsmi.m4
126 ++++ /dev/null
127 +@@ -1,125 +0,0 @@
128 +-# Configure paths for libsmi
129 +-# Shamelessly stolen from http://autoconf-archive.cryp.to/ax_lib_sqlite3.html
130 +-
131 +-# Synopsis: AX_LIBSMI([minimum library version])
132 +-# The default minimum library version is 2
133 +-
134 +-# This macro sets/substitutes the following:
135 +-# AC_DEFINE(HAVE_LIBSMI)
136 +-# AC_SUBST(LIBSMI_CFLAGS)
137 +-# AC_SUBST(LIBSMI_LDFLAGS)
138 +-# AC_SUBST(LIBSMI_VERSION)
139 +-# $libsmi_message is set to "yes" or "no"
140 +-
141 +-AC_DEFUN([AX_LIBSMI],
142 +-[
143 +- AC_ARG_WITH([libsmi],
144 +- AC_HELP_STRING(
145 +- [--with-libsmi=@<:@DIR@:>@],
146 +- [use libsmi MIB/PIB library @<:@default=yes@:>@, optionally specify the prefix for libsmi]
147 +- ),
148 +- [
149 +- if test "$withval" = "no"; then
150 +- WANT_LIBSMI="no"
151 +- elif test "$withval" = "yes"; then
152 +- WANT_LIBSMI="yes"
153 +- ac_libsmi_path=""
154 +- else
155 +- WANT_LIBSMI="yes"
156 +- ac_libsmi_path="$withval"
157 +- fi
158 +- ],
159 +- [WANT_LIBSMI="yes"]
160 +- )
161 +-
162 +- libsmi_message="no"
163 +- LIBSMI_CFLAGS=""
164 +- LIBSMI_LDFLAGS=""
165 +- LIBSMI_VERSION=""
166 +-
167 +- if test "x$WANT_LIBSMI" = "xyes"; then
168 +-
169 +- ac_libsmi_header="smi.h"
170 +-
171 +- libsmi_version_req=ifelse([$1], [], [2], [$1])
172 +-
173 +- AC_MSG_CHECKING([for libsmi >= $libsmi_version_req])
174 +-
175 +- if test "$ac_libsmi_path" != ""; then
176 +- ac_libsmi_ldflags="-L$ac_libsmi_path/lib"
177 +- ac_libsmi_cflags="-I$ac_libsmi_path/include"
178 +- else
179 +- for ac_libsmi_path_tmp in /usr /usr/local /opt $prefix; do
180 +- if test -f "$ac_libsmi_path_tmp/include/$ac_libsmi_header" \
181 +- && test -r "$ac_libsmi_path_tmp/include/$ac_libsmi_header"; then
182 +- ac_libsmi_path=$ac_libsmi_path_tmp
183 +- ac_libsmi_ldflags="-L$ac_libsmi_path_tmp/lib"
184 +- ac_libsmi_cflags="-I$ac_libsmi_path_tmp/include"
185 +- break;
186 +- fi
187 +- done
188 +- fi
189 +-
190 +- ac_libsmi_ldflags="$ac_libsmi_ldflags -lsmi"
191 +-
192 +- saved_CFLAGS="$CFLAGS"
193 +- CFLAGS="$CFLAGS $ac_libsmi_cflags"
194 +-
195 +- AC_LANG_PUSH(C)
196 +- AC_COMPILE_IFELSE(
197 +- [
198 +- AC_LANG_PROGRAM([[@%:@include <smi.h>]],
199 +- [[
200 +- int current, revision, age, n;
201 +- const int required = $libsmi_version_req;
202 +- if (smiInit(""))
203 +- exit(1);
204 +- if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
205 +- exit(2);
206 +- n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
207 +- if (n != 3)
208 +- exit(3);
209 +- if (required < current - age || required > current)
210 +- exit(4);
211 +- ]]
212 +- )
213 +- ],
214 +- [
215 +- AC_MSG_RESULT([yes])
216 +- libsmi_message="yes"
217 +- ],
218 +- [
219 +- AC_MSG_RESULT([not found])
220 +- libsmi_message="no"
221 +- ]
222 +- )
223 +- AC_LANG_POP([C])
224 +-
225 +- CFLAGS="$saved_CFLAGS"
226 +-
227 +- if test "$libsmi_message" = "yes"; then
228 +-
229 +- LIBSMI_CFLAGS="$ac_libsmi_cflags"
230 +- LIBSMI_LDFLAGS="$ac_libsmi_ldflags"
231 +-
232 +- ac_libsmi_header_path="$ac_libsmi_path/include/$ac_libsmi_header"
233 +-
234 +- dnl Retrieve libsmi release version
235 +- if test "x$ac_libsmi_header_path" != "x"; then
236 +- ac_libsmi_version=`cat $ac_libsmi_header_path \
237 +- | grep '#define.*SMI_LIBRARY_VERSION.*\"' | sed -e 's/.* "//' \
238 +- | sed -e 's/"//'`
239 +- if test $ac_libsmi_version != ""; then
240 +- LIBSMI_VERSION=$ac_libsmi_version
241 +- else
242 +- AC_MSG_WARN([Can not find SMI_LIBRARY_VERSION macro in smi.h header to retrieve libsmi version!])
243 +- fi
244 +- fi
245 +-
246 +- AC_SUBST(LIBSMI_CFLAGS)
247 +- AC_SUBST(LIBSMI_LDFLAGS)
248 +- AC_SUBST(LIBSMI_VERSION)
249 +- AC_DEFINE(HAVE_LIBSMI, 1, [Define to 1 if you have the `smi' library (-lsmi).])
250 +- fi
251 +- fi
252 +-])
253 +--
254 +2.7.4
255 +
256
257 diff --git a/net-analyzer/wireshark/wireshark-2.4.3.ebuild b/net-analyzer/wireshark/wireshark-2.4.3.ebuild
258 index 24633327717..e63e4d8f74f 100644
259 --- a/net-analyzer/wireshark/wireshark-2.4.3.ebuild
260 +++ b/net-analyzer/wireshark/wireshark-2.4.3.ebuild
261 @@ -98,6 +98,7 @@ PATCHES=(
262 "${FILESDIR}"/${PN}-2.1.0-sse4_2-r1.patch
263 "${FILESDIR}"/${PN}-2.4-androiddump.patch
264 "${FILESDIR}"/${PN}-99999999-androiddump.patch
265 + "${FILESDIR}"/${PN}-2.4.3-libsmi.patch
266 )
267
268 pkg_setup() {
269
270 diff --git a/net-analyzer/wireshark/wireshark-2.4.4.ebuild b/net-analyzer/wireshark/wireshark-2.4.4.ebuild
271 index c62ae1cfa0b..b56e421d4d1 100644
272 --- a/net-analyzer/wireshark/wireshark-2.4.4.ebuild
273 +++ b/net-analyzer/wireshark/wireshark-2.4.4.ebuild
274 @@ -98,6 +98,7 @@ PATCHES=(
275 "${FILESDIR}"/${PN}-2.1.0-sse4_2-r1.patch
276 "${FILESDIR}"/${PN}-2.4-androiddump.patch
277 "${FILESDIR}"/${PN}-99999999-androiddump.patch
278 + "${FILESDIR}"/${PN}-2.4.3-libsmi.patch
279 )
280
281 pkg_setup() {