File mingw64-wireshark.spec of Package mingw64-wireshark

#
# spec file for package mingw64-wireshark
#
# Copyright (c) 2024-2026, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define realname wireshark
Name:           mingw64-%{realname}
Version:        4.6.4
Release:        0
Summary:        A Network Traffic Analyser
License:        GPL-2.0-or-later AND GPL-3.0-or-later
Group:          Productivity/Networking/Diagnostic
URL:            https://www.wireshark.org/
#Git-Clone:     https://gitlab.com/wireshark/wireshark.git
Source:         https://www.wireshark.org/download/src/%{realname}-%{version}.tar.xz
Patch0:         wireshark-mingw64-wireshark.patch
Patch1:         wireshark-mingw-no-qt-windeployqt.patch
BuildRequires:  flex
BuildRequires:  lemon
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-glib2-devel >= 2.54.0
BuildRequires:  mingw64-libgcrypt-devel
BuildRequires:  mingw64-c-ares-devel >= 1.13.0
BuildRequires:  mingw64-libssh-devel >= 0.8.5
BuildRequires:  mingw64-libpcap-devel
BuildRequires:  mingw64-speexdsp-devel
BuildRequires:  mingw64-brotli-devel
BuildRequires:  mingw64-opus-devel
BuildRequires:  mingw64-lz4-devel
BuildRequires:  mingw64-zstd-devel >= 1.0.0
BuildRequires:  mingw64-libxml2-devel
BuildRequires:  mingw64-nghttp3-devel
BuildRequires:  mingw64-libgnutls-devel >= 3.5.8
BuildRequires:  mingw64-libsmi-devel
BuildRequires:  mingw64-win_iconv-devel
BuildRequires:  mingw64-sbc-devel
BuildRequires:  mingw64-ilbc-devel
BuildRequires:  mingw64-opencore-amr-devel
BuildRequires:  mingw64-bcg729-devel
BuildRequires:  mingw64-libmaxminddb-devel
#####
# Packages werden nicht richtig erkannt ?!
BuildRequires:  mingw64-ngtcp2-devel
BuildRequires:  mingw64-minizip-ng-devel
# Package spandsp ist komplett broken
#BuildRequires:  mingw64-spandsp-devel


#[   13s]  * KERBEROS

#[   13s]  * ZLIBNG
### -> hab' doch zlib

#[   13s]  * Minizipng, A fork of the minizip library - Mini zip and unzip based on zlib, <https://github.com/zlib-ng/minizip-ng>
#[   13s]    Support for profiles import/export
### fahre doch mini

#[   13s]  * NGHTTP2 (required version >= 1.11.0), HTTP/2 C library and tools, <https://nghttp2.org>
#[   13s]    Header decompression in HTTP2
#### --> hab doch nghttp3, oder ???

#[   13s]  * Lua, Lua is a powerful, efficient, lightweight, embeddable scripting language, <https://www.lua.org/>
#[   13s]    Lua allows writing dissectors and other extensions without a C/C++ compiler

#[   13s]  * SPANDSP, a library of many DSP functions for telephony, <https://www.soft-switch.org>
#[   13s]    Support for G.722 and G.726 codecs in RTP player

#[   13s] -- Could NOT find KERBEROS (missing: KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR) 

#[   13s] -- Considering the following Lua versions: 5.4;5.3
#[   13s] -- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) 

#[   13s] -- Checking for one of the modules 'spandsp'
#[   13s] -- Could NOT find SPANDSP (missing: SPANDSP_LIBRARY SPANDSP_INCLUDE_DIR) 
#

# QT5
BuildRequires:  mingw64-cross-libqt5-qttools
BuildRequires:  mingw64-libqt5-qtbase-devel
BuildRequires:  mingw64-libqt5-linguist-devel
BuildRequires:  mingw64-libqt5-qtwinextras-devel
BuildRequires:  mingw64-libqt5-qtmultimedia-devel
%_mingw64_package_header_debug
BuildArch:      noarch

%description
Wireshark is a network protocol analyzer. It allows examining data
from a live network or from a capture file on disk. You can
interactively browse the capture data, viewing summary and detailed
information for each packet. Wireshark has several features,
including a rich display filter language and the ability to view the
reconstructed stream of a TCP session.

%_mingw64_debug_package

%prep
%autosetup -p1 -n %{realname}-%{version}

%build
%{_mingw64_cmake} -DUSE_qt6=OFF -DWIN32_LEAN_AND_MEAN=0
%{_mingw64_cmake_build}

%install
#find . -name "*.exe"
#find . -name "*.dll"
#./run/*

#%%{_mingw64_cmake_install}
# better manually install

# HACK
install -d %{buildroot}/opt/mingw64-wireshark
mv build/run/* %{buildroot}/opt/mingw64-wireshark/

# cmake fails during QT_WINDEPLOYQT
# Workaround: wireshark-mingw-no-qt-windeployqt.patch
# -> ./build/CMakeFiles/copy_qt_dlls.dir
# -> set "%PATH%" does not exist on Linux
#
#make  -f CMakeFiles/copy_qt_dlls.dir/build.make CMakeFiles/copy_qt_dlls.dir/depend
#make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build'
#cd /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2 /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2 /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build /home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build/CMakeFiles/copy_qt_dlls.dir/DependInfo.cmake "--color="
#make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build'
#make  -f CMakeFiles/copy_qt_dlls.dir/build.make CMakeFiles/copy_qt_dlls.dir/build
#make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build'
#set PATH=/usr/x86_64-w64-mingw32/bin/qt5;%PATH%
#/bin/sh: line 1: fg: no job control
#make[2]: *** [CMakeFiles/copy_qt_dlls.dir/build.make:76: copy_qt_dlls] Error 1
#make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build'
#make[1]: *** [CMakeFiles/Makefile2:4613: CMakeFiles/copy_qt_dlls.dir/all] Error 2
#make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/mingw64-wireshark-4.6.2-build/wireshark-4.6.2/build'
#make: *** [Makefile:159: all] Error 2

%files
%license COPYING
%doc AUTHORS README.md
/opt/mingw64-wireshark
# HACK
%exclude /opt/mingw64-wireshark/*.debug
%exclude /opt/mingw64-wireshark/extcap/wireshark/*.debug
%exclude /opt/mingw64-wireshark/plugins/4.6/codecs/*.debug
%exclude /opt/mingw64-wireshark/plugins/4.6/epan/*.debug
%exclude /opt/mingw64-wireshark/plugins/4.6/wiretap/*.debug

%changelog
openSUSE Build Service is sponsored by