1 # Note that this is NOT a relocatable package
2 # XXX is this still true? https://fedoraproject.org/wiki/Packaging:Cmake
3 # says that recent CMake versions take care of rpathification.
6 # - Support clang with non Fedora distributions
8 %bcond_with toolchain_clang
11 # In rpm 4.17.1 it's possible to define these so that
12 # the one is set, the default is the inverse of the other
13 %if 0%{?fedora} || 0%{?rhel} >= 9
21 %bcond_with mmdbresolve
22 %bcond_with lz4_and_snappy
35 # Fedora options to use clang as the compiler
36 # https://docs.fedoraproject.org/en-US/packaging-guidelines/#compiler
38 %if %{with toolchain_clang}
39 %global toolchain clang
45 # Set at most one of these two:
46 # Note that setcap requires rpmbuild 4.7.0 or later.
47 %global setuid_dumpcap
0
48 %global setcap_dumpcap
1
50 # Set to 1 if you want a group called 'wireshark' which users must be a member
51 # of in order to run dumpcap. Only used if setuid_dumpcap or setcap_dumpcap
53 %global use_wireshark_group
1
55 # RPM 4.11.2 and higher errors out on double dash in versions by default.
56 # Some, but not all, distros make this a warning instead; ensure that it is.
57 # We override the dashes with underscores for the main wireshark RPM version,
58 # but rpmbuild will fail based on its generated dependency from the pkg-config
59 # file (wireshark.pc), which has our original version with dashes.
60 %global _wrong_version_format_terminate_build
0
62 %global package_version @PROJECT_VERSION@
65 Summary: The world's foremost protocol analyzer
67 Version: @RPM_VERSION@
70 Group: Applications
/Internet
71 Source: https
://www.wireshark.org
/download
/src
/%{name}-%{package_version}.tar.zst
72 # Or this URL for automated builds:
73 #Source: https://www.wireshark.org/download/automated/src/%%{name}-%%{package_version}.tar.zst
74 URL: https
://www.wireshark.org
/
75 Packager: Gerald Combs
<gerald
[AT
]wireshark.org
>
77 # 4.13 introduces Boolean dependencies
78 BuildRequires
: rpm
-build
>= 4.13.0
80 BuildRequires
: cmake
>= 3.13
81 BuildRequires
: python3
82 %if %{with toolchain_clang}
85 # The default GCC version in Leap 15 is too old
86 %if 0%{?suse_version} == 1500
88 BuildRequires
: gcc13
-PIE
89 BuildRequires
: gcc13
-c
++
92 BuildRequires
: gcc
-c
++
97 BuildRequires
: (ninja or ninja
-build
)
99 # We always require Asciidoctor for packaging builds as of 84ab55cf75,
100 # unfortunately it's not evenly distributed across distros.
101 # Fedora & CentOS: rubygem-asciidoctor
102 # CentOS 8: <added in - https://bugzilla.redhat.com/show_bug.cgi?id=1820896>
103 # openSUSE 15.3: ruby2.5-rubygem-asciidoctor
104 # All of the packages provide this, so we can rely on it:
105 BuildRequires
: /usr
/bin
/asciidoctor
107 # For the HTML guides, we need xsltproc, and the docbook stylesheets
109 BuildRequires
: /usr
/bin
/xsltproc
110 BuildRequires
: (docbook
-style
-xsl or docbook
-xsl
-stylesheets
)
113 BuildRequires
: glib2
-devel
>= 2.54.0
114 BuildRequires
: libpcap
-devel
115 BuildRequires
: zlib
-devel
116 BuildRequires
: libgcrypt
-devel
117 BuildRequires
: pcre2
-devel
119 %if %{with lz4_and_snappy}
120 BuildRequires
: (lz4
-devel or liblz4
-devel
)
121 BuildRequires
: snappy
-devel
124 BuildRequires
: (c
-ares
-devel or libcares
-devel
)
125 # On SUSE speex-devel requires speexdsp-devel, but that
126 # is not the case on RH/Fedora. I believe we only need
128 BuildRequires
: speexdsp
-devel
131 BuildRequires
: (lua
-devel or lua53
-devel or compat
-lua
-devel or lua52
-devel or lua51
-devel
)
135 BuildRequires
: libnghttp2
-devel
139 BuildRequires
: libnghttp3
-devel
142 %if %{with sdjournal}
143 BuildRequires
: systemd
-devel
147 BuildRequires
: (brotli
-devel or libbrotli
-devel
)
151 BuildRequires
: libzstd
-devel
154 # Uncomment these if you want to be sure you get them...
155 #BuildRequires: krb5-devel
156 #BuildRequires: libsmi-devel
157 #BuildRequires: pcre-devel
158 #BuildRequires: libselinux
159 #BuildRequires: gnutls-devel
160 #BuildRequires: libcap-devel
162 %if %{with mmdbresolve}
163 BuildRequires
: libmaxminddb
-devel
166 %if %{use_wireshark_group}
167 %if 0%{?suse_version}
168 # SUSE's groupadd is in this package:
169 Requires(pre
): pwdutils
171 # ... while Red Hat's is in this one:
172 Requires(pre
): shadow
-utils
176 # NOTE: the below description has been copied to org.wireshark.Wireshark.metainfo.xml (in the
177 # top-level directory).
179 Wireshark allows you to examine protocol data stored
in files or as it is
180 captured from wired or wireless
(WiFi or Bluetooth
) networks
, USB devices
,
181 and many other sources. It supports dozens of protocol capture file formats
182 and understands more than a thousand protocols.
184 It has many powerful features including a rich display filter language
185 and the ability to reassemble multiple protocol packets
in order to
, for
186 example
, view a complete TCP stream
, save the contents of a file which was
187 transferred over HTTP or CIFS
, or play back an RTP audio stream.
189 This package contains
command-line utilities
, plugins
, and documentation
for
190 Wireshark. A Qt graphical user interface is packaged separately.
192 %if %{with qt5} || %{with qt6}
194 Summary: Wireshark's Qt
-based GUI
195 Group: Applications
/Internet
196 Obsoletes
: wireshark
-gnome
< %{version} wireshark-gtk < %{version}
197 Requires: %{name} = %{version}-%{release}
199 %if 0%{?suse_version}
200 BuildRequires
: libQt5Core
-devel
201 BuildRequires
: libQt5Gui
-devel
202 BuildRequires
: libQt5Widgets
-devel
203 BuildRequires
: libQt5PrintSupport
-devel
204 BuildRequires
: libQt5Concurrent
-devel
205 BuildRequires
: libqt5
-qtmultimedia
-devel
206 BuildRequires
: libqt5
-linguist
-devel
208 # Need this for SUSE's suse_update_desktop_file macro
209 BuildRequires
: update
-desktop
-files
211 BuildRequires
: qt5
-qtbase
-devel
212 BuildRequires
: qt5
-qtmultimedia
-devel
213 BuildRequires
: qt5
-linguist
218 %if 0%{?suse_version}
219 BuildRequires
: qt6
-base
-devel
220 BuildRequires
: qt6
-multimedia
-devel
221 BuildRequires
: qt6
-tools
-devel
222 BuildRequires
: qt6
-linguist
-devel
224 BuildRequires
: qt6
-qtbase
-devel
225 BuildRequires
: qt6
-qtmultimedia
-devel
226 BuildRequires
: qt6
-qttools
-devel
228 BuildRequires
: qt6
-qt5compat
-devel
229 BuildRequires
: libxkbcommon
-devel
232 Requires: hicolor
-icon
-theme
233 BuildRequires
: desktop
-file
-utils
234 Requires(post
): desktop
-file
-utils
235 # Add this for more readable fonts on some distributions/versions
236 #Requires: dejavu-sans-mono-fonts
239 This package contains the Qt Wireshark GUI and desktop integration files.
243 Summary: Development headers
for Wireshark
244 Group: Applications
/Internet
245 Requires: %{name} = %{version}-%{release}
248 The wireshark
-devel package contains the header and other files required
for
249 development of Wireshark scripts and plugins.
253 %setup -q
-n
%{name}-%{package_version}
256 # The SUSE macros for cmake and ninja depend upon _bindir, which depends
257 # on _prefix (and is thus wrong if _prefix is anything other than /usr).
258 # That's wrong - just because we're installing our package's binaries
259 # into another _bindir doesn't mean we want to run cmake or ninja out
260 # of there instead of the system cmake or ninja.
261 %if 0%{?suse_version}
262 %define __cmake
/usr
/bin
/cmake
264 %define __builder
/usr
/bin
/ninja
269 %define __ninja
/usr
/bin
/ninja
-build
272 # How do we reliably run CMake for all of CentOS, Fedora, RHEL, and openSUSE?
273 # https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/
274 # https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
275 # https://en.opensuse.org/openSUSE:Build_system_recipes#cmake
276 # Fedora's new RPATH hardening means we need to enable $ORIGIN if the
277 # prefix is anything other than /usr:
278 # https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
280 %if 0%{?fedora} && ( "%{_prefix}"
!= "
/usr"
)
281 -DENABLE_RPATH_ORIGIN
=ON \
286 %if %{with qt5} || %{with qt6}
287 -DBUILD_wireshark
=ON \
292 -DBUILD_wireshark
=OFF \
299 %if %{with mmdbresolve}
300 -DBUILD_mmdbresolve
=ON \
302 -DBUILD_mmdbresolve
=OFF \
304 %if %{with lz4_and_snappy}
309 -DENABLE_SNAPPY
=OFF \
312 -DENABLE_SPANDSP
=ON \
314 -DENABLE_SPANDSP
=OFF \
319 -DENABLE_BCG729
=OFF \
322 -DENABLE_LIBXML2
=ON \
324 -DENABLE_LIBXML2
=OFF \
327 -DENABLE_NGHTTP2
=ON \
329 -DENABLE_NGHTTP2
=OFF \
332 -DENABLE_NGHTTP3
=ON \
334 -DENABLE_NGHTTP3
=OFF \
336 %if %{with sdjournal}
337 -DBUILD_sdjournal
=ON \
339 -DBUILD_sdjournal
=OFF \
344 -DENABLE_BROTLI
=OFF \
346 -DENABLE_WERROR
=OFF \
361 # Fedora and SUSE 15 do out of source builds by default, but they store
362 # the build directory in different macros. Older distributions don't define
363 # that macro at all. Let's make it so that one macro contains the build
364 # directory (which will be "." for any distribution that doesn't define
365 # either macro, and thus presumably does in-source builds.)
366 %{?!__cmake_builddir: %global __cmake_builddir %{?__builddir}%{!?__builddir:.}}
370 %if 0%{?suse_version}
371 %cmake_build all_guides
373 %cmake_build --target all_guides
379 %if 0%{?suse_version}
380 %define cmake_install DESTDIR
=%{buildroot} %__cmake --install %{__cmake_builddir}
384 %cmake_install --component Development
386 %cmake_install --component UserGuide
387 %cmake_install --component DeveloperGuide
388 %cmake_install --component ReleaseNotes
391 # If we're being installed in an unusual prefix tell the loader where
392 # to find our libraries.
393 %if "
%{_prefix}"
!= "
/usr"
394 %define install_ld_so_conf
1
395 mkdir -p $RPM_BUILD_ROOT
/etc
/ld.so.conf.d
396 echo %{_libdir} > $RPM_BUILD_ROOT
/etc
/ld.so.conf.d
/wireshark.conf
399 %if %{with qt5} || %{with qt6}
400 %if 0%{?suse_version}
401 # SUSE's packaging conventions
402 # (https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file)
404 %if "
%{_prefix}"
!= "
/usr"
405 install -Dm
0644 %{buildroot}%{_prefix}/share/applications/org.wireshark.Wireshark.desktop %{buildroot}/usr
/share
/applications
/org.wireshark.Wireshark.desktop
407 %suse_update_desktop_file org.wireshark.Wireshark
409 # Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines)
410 # require this (at least if desktop-file-install was not used to install it).
411 desktop
-file
-validate
%{buildroot}%{_datadir}/applications
/org.wireshark.Wireshark.desktop
415 %if %{use_wireshark_group}
417 getent group wireshark
>/dev
/null || groupadd
-r wireshark
420 %post -p
/sbin
/ldconfig
422 %postun -p
/sbin
/ldconfig
424 %if %{with qt5} || %{with qt6}
426 update
-desktop
-database
%{_datadir}/applications
&> /dev
/null ||
:
427 update
-mime
-database
%{_datadir}/mime
&> /dev
/null ||
:
428 touch
--no
-create
%{_datadir}/icons
/hicolor
&>/dev
/null ||
:
431 update
-desktop
-database
%{_datadir}/applications
&> /dev
/null ||
:
432 update
-mime
-database
%{_datadir}/mime
&> /dev
/null ||
:
437 %defattr(-,root
,root
)
438 %doc AUTHORS COPYING README.md
440 %exclude %{_docdir}/wireshark
/wsdg_html_chunked
443 %docdir %{_docdir}/wireshark
445 # Don't pick up any of the wireshark (GUI) binaries or devtools here
446 %exclude %{_bindir}/wireshark
*
447 %exclude %{_bindir}/dftest
448 %exclude %{_bindir}/idl2wrs
451 # This generates a warning because dumpcap is listed twice. That's
452 # probably preferable to listing each program (and keeping the list up to
454 %if %{use_wireshark_group} && %{setuid_dumpcap}
455 # Setuid but only executable by members of the 'wireshark' group
456 %attr(4750, root
, wireshark
) %{_bindir}/dumpcap
458 %if %{use_wireshark_group} && %{setcap_dumpcap}
459 # Setcap but only executable by members of the 'wireshark' group
460 %attr(0750, root
, wireshark
) %caps(cap_net_raw
,cap_net_admin
=ep
) %{_bindir}/dumpcap
462 %if %{setuid_dumpcap}
463 # Setuid and executable by all
464 %attr(4755, root
, root
) %{_bindir}/dumpcap
466 %if %{setcap_dumpcap}
467 # Setcap and executable by all
468 %attr(0755, root
, root
) %caps(cap_net_raw
,cap_net_admin
=ep
) %{_bindir}/dumpcap
470 # Executable by all but with no special permissions
471 %attr(0755, root
, root
) %{_bindir}/dumpcap
479 # Don't pick up the wireshark (GUI) man page here
480 %exclude %{_mandir}/man1
/wireshark.
*
484 %config(noreplace
) %{_datadir}/wireshark
/diameter
/Custom.xml
485 %{_datadir}/wireshark
487 %if 0%{?install_ld_so_conf}
488 /etc
/ld.so.conf.d
/wireshark.conf
491 %if %{with qt5} || %{with qt6}
493 %defattr(-,root
,root
)
494 %{_datadir}/applications
/org.wireshark.Wireshark.desktop
495 %if 0%{?suse_version}
496 %if "
%{_prefix}"
!= "
/usr"
497 /usr
/share
/applications
/org.wireshark.Wireshark.desktop
500 %{_datadir}/metainfo
/org.wireshark.Wireshark.metainfo.xml
501 %{_datadir}/icons
/hicolor
/*/apps
/*
502 %{_datadir}/icons
/hicolor
/*/mimetypes
/*
503 %{_datadir}/mime
/packages
/org.wireshark.Wireshark.xml
505 %{_mandir}/man1
/wireshark.
*
511 %{_includedir}/wireshark
513 %{_libdir}/cmake
/wireshark
514 %{_libdir}/pkgconfig
/wireshark.pc
516 %{_docdir}/wireshark
/wsdg_html_chunked
517 %docdir %{_docdir}/wireshark
/wsdg_html_chunked
521 * Wed Jun
14 2023 Joao Valverde
522 - Update CMake devel files path
524 * Wed Aug
24 2022 Joao Valverde
525 - Add Qt6 support with Fedora build dependencies
527 * Mon Apr
25 2022 John Thacker
528 - Cleanup specfile to remove obsolete and deprecated syntax
530 * Wed Jan
5 2022 John Thacker
531 - pcre2 is required now
(most distros will get this as part of a dependency
532 chain glib2
-devel
->libselinux
-devel
->pcre2
-devel anyway
)
533 - Remove
Requires that automatic dependency handling picks up
535 * Mon Mar
29 2021 Joao Valverde
536 - Update HTML documentation location
538 * Thu Nov
26 2020 Gerald Combs
539 - Bison is no longer required
541 * Tue Sep
29 2020 Lin Sun
542 - Added opus codec as an option
544 * Sun Jan
19 2020 Jiri Novak
545 - Added ilbc codec as an option
547 * Fri Nov
22 2019 Gerald Combs
548 - c
-ares is a required package
550 * Thu Aug
15 2019 Gerald Combs
553 * Mon Apr
22 2019 Daniel Bakai
554 - Added brotli
(as an option
, defaulting to not required
).
556 * Fri Sep
28 2018 Gerald Combs
559 * Thu Sep
27 2018 Jeff Morriss
560 - Have the qt package obsolute the old gnome and gtk packages. This allows
561 clean upgrades to the Qt version.
562 - Set
install prefix based on original cmake call's prefix.
563 - Update capitalization of SUSE.
565 * Wed Sep
26 2018 Jeff Morriss
566 - Put development
-related files
in a new
-devel RPM.
568 * Mon Sep
24 2018 Jeff Morriss
569 - Allow using ccache to
(greatly
) speed up rebuilds.
571 * Mon Sep
24 2018 Jeff Morriss
572 - Make the
(optional
) maxminddb dependencies actually work.
574 * Wed Apr
11 2018 Gerald Combs
575 - Make documentation installation conditional.
577 * Tue Mar
20 2018 Gerald Combs
578 - Migrate from Autotools to CMake.
579 - Remove Qt4
, GTK
+ 2, and GTK
+ 3 sections.
580 - Require flex
, bison
, and libgcrypt.
581 - Optionally build with Ninja.
583 * Sat Dec
2 2017 Jeff Morriss
584 - Include the User Guide
(now installed by default by autotools
).
586 * Wed Jul
26 2017 Pascal Quantin
587 - Added bcg729
(as an option
, defaulting to not required
).
589 * Tue Apr
4 2017 Ahmad Fatoum
590 - Added libxml2
(as an option
, defaulting to required
).
592 * Tue Dec
20 2016 Anders Broman
593 - Add with extcap
(as an option
, defaulting to yes
).
595 * Mon Dec
5 2016 Jeff Morriss
596 - Add spandsp
(as an option
, defaulting to not required
).
598 * Tue Oct
18 2016 Benoit Canet
599 - Add LZ4 and snappy compression support.
601 * Mon Aug
29 2016 Jeff Morriss
602 - Add libnghttp2
(as an option
, defaulting to required
).
604 * Wed Aug
17 2016 Jeff Morriss
605 - wireshark.pc is now installed with Wireshark
, include it
in the RPM.
607 * Mon May
9 2016 Jeff Morriss
608 - Make autoconf
, automake
, flex
, and bison optional
: most users
(who aren't
609 patching Wireshark
) don't need them to build an RPM.
611 * Tue Nov
10 2015 Jeff Morriss
612 - Rename the gnome package to gtk
: Wireshark uses Gtk
+ but isn't part of GNOME.
614 * Mon Sep
14 2015 Jeff Morriss
615 - Follow .
/configure's decision on whether to configure Lua or not rather than
616 forcing it to be enabled
(and thus failing on some distros which don't ship
617 a compatible version of Lua any more
).
619 * Sat Sep
12 2015 Jeffrey Smith
620 - Begin support
for Qt5
622 * Thu Jan
22 2015 Jeff Morriss
625 * Tue Jan
20 2015 Jeff Morriss
626 - Make the license tag more specific
: Wireshark is GPLv2
+.
628 * Mon Jan
12 2015 Jeff Morriss
629 - Modernize the
(base package
) %
%description.
631 * Wed Dec
3 2014 Jeff Morriss
632 - Don't run gtk
-update
-icon
-cache when uninstalling the Qt package. But
do run
633 it when installing the gnome package.
634 - Tell the loader where to find our libraries
if we're being installed
635 someplace other than
/usr .
636 - Attempt to get RPMs working with a prefix other than
/usr
(now that the
637 (free
)desktop files are no longer always installed
/usr
). Desktop
638 integration doesn't work
for prefixes other than "
/usr" or "
/usr
/local".
640 * Fri Aug
29 2014 Gerald Combs
641 - The Qt UI is now the default. Update logic and prioritization to
644 * Mon Aug
4 2014 Jeff Morriss
645 - Fix RPM builds with a prefix other than
/usr
: The location of
646 update
-alternatives does not depend on Wireshark's installation prefix
:
647 it's always
in /usr
/sbin
/.
649 * Fri Aug
1 2014 Jeff Morriss
650 - Remove the old wireshark binary during RPM upgrades
: this is needed because
651 we now
declare wireshark to be %
%ghost so it doesn't get overwritten during an
652 upgrade
(but
in older RPMs it was the real program
).
654 * Tue Jul
1 2014 Jeff Morriss
655 - Get rid of rpath when we're building RPMs
: Fedora prohibits it
, we don't
656 need it
, and it gets
in the way some
times.
658 * Tue Nov
26 2013 Jeff Morriss
659 - Overhaul options handling to pull
in the UI choice from .
/configure.
660 - Make it possible to not build the GNOME package.
662 * Tue Nov
12 2013 Jeff Morriss
663 - Add a qt package using 'alternatives' to allow the administrator to choose
664 which one they actually use.
666 * Fri Sep
20 2013 Jeff Morriss
667 - If we're not using gtk3 add
--with
-gtk2
(since Wireshark now defaults to gtk3
)
669 * Thu Mar
28 2013 Jeff Morriss
670 - Simplify check
for rpmbuild's version.
672 * Fri Mar
8 2013 Jeff Morriss
673 - Put all icons
in hicolor
674 - Use SuSE's desktop
-update macro.
675 - Actually update MIME database when Wireshark's prefix is not
/usr .
677 * Thu Mar
7 2013 Jeff Morriss
678 - List more build dependencies.
679 - Update to work on SuSE too
: some of their package names are different.
681 * Wed Mar
6 2013 Gerald Combs
682 - Enable c
-ares by default
684 * Thu Feb
7 2013 Jeff Morriss
685 - Overhaul to
make this file more useful
/up to date. Many changes are based
686 on Fedora's .spec file. Changes include
:
687 - Create a separate wireshark
-gnome package
(like Red Hat
).
688 - Control some things with variables
set at the top of the file.
689 - Allow the user to configure how dumpcap is installed.
690 - Allow the user to choose some options including GTK2 or GTK3.
691 - Greatly expand the BuildRequires entries
; get the minimum versions of some
692 things from 'configure'.
693 - Install freedesktop files
for better
(free
)desktop integration.
695 * Thu Aug
10 2006 Joerg Mayer
696 - Starting with X.org
7.x X11R6 is being phased out. Install wireshark
697 and manpage into the standard path.
699 * Mon Aug
01 2005 Gerald Combs
700 - Add a desktop file and icon
for future use
702 - Take over the role of packager
704 - Update descriptions and
source locations
706 * Thu Oct
28 2004 Joerg Mayer
707 - Add openssl requirement
(heimdal and net
-snmp are still automatic
)
709 * Tue Jul
20 2004 Joerg Mayer
710 - Redo
install and files section to actually work with normal builds
712 * Sat Feb
07 2004 Joerg Mayer
713 - in case there are shared libs
: include them
715 * Tue Aug
24 1999 Gilbert Ramirez
716 - changed to ethereal.spec.
in so that 'configure' can update
717 the version automatically
719 * Tue Aug
03 1999 Gilbert Ramirez
<gram@xiexie.org
>
720 - updated to
0.7.0 and changed gtk
+ requirement
722 * Sun Jan
03 1999 Gerald Combs
<gerald@zing.org
>
725 * Fri Nov
20 1998 FastJack
<fastjack@i
-s
-o.net
>
728 * Sun Nov
15 1998 FastJack
<fastjack@i
-s
-o.net
>