From 2498ca527de2e9e5b8ac278e31e216b5acb4ea94bcc22995bdac93ee51fe7570 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 15 Aug 2014 22:56:14 +0000 Subject: [PATCH 1/4] Accepting request 244918 from home:AndreasStieger:branches:network:utilities - Build expermiental UI wireshark-qt: add wireshark-1.12.0-qt-QFont-stylename.patch to support building with Qt 4.6 on SLE 11 OBS-URL: https://build.opensuse.org/request/show/244918 OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=119 --- wireshark-1.12.0-qt-QFont-stylename.patch | 57 +++++++++++++++++++++++ wireshark.changes | 7 +++ wireshark.spec | 21 ++++++++- 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 wireshark-1.12.0-qt-QFont-stylename.patch diff --git a/wireshark-1.12.0-qt-QFont-stylename.patch b/wireshark-1.12.0-qt-QFont-stylename.patch new file mode 100644 index 0000000..0e79dc3 --- /dev/null +++ b/wireshark-1.12.0-qt-QFont-stylename.patch @@ -0,0 +1,57 @@ +From: Andreas Stieger +Date: Fri, 8 Aug 2014 19:50:24 +0200 +Subject: [PATCH] Qt: Fix when build with Qt < 4.8.0 +Upstream: Committed +References: https://www.wireshark.org/lists/wireshark-dev/201408/msg00074.html https://code.wireshark.org/review/#/c/3508/ https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commitdiff;h=020d0f89637faab8ec0e25e07d64eb66d96c2a72 + +Declared minimum requirement is Qt 4.6.0. +QFont.styleName is not available in Qt < 4.8 +Fails on SLE11 with libqt4-devel-4.6.3-5.25.5: +[ 567s] qt_ui_utils.cpp: In function 'void smooth_font_size(QFont&)': +[ 567s] qt_ui_utils.cpp:58: error: 'class QFont' has no member named 'styleName' + +--- + ui/qt/font_color_preferences_frame.cpp | 8 +++++++- + ui/qt/qt_ui_utils.cpp | 4 ++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/ui/qt/font_color_preferences_frame.cpp b/ui/qt/font_color_preferences_frame.cpp +index e9f4a5d..38c894c 100644 +--- a/ui/qt/font_color_preferences_frame.cpp ++++ b/ui/qt/font_color_preferences_frame.cpp +@@ -81,9 +81,15 @@ void FontColorPreferencesFrame::updateWidgets() + { + int margin = style()->pixelMetric(QStyle::PM_LayoutLeftMargin); + ++#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) + ui->fontPushButton->setText( +- cur_font_.family() + " "/* + cur_font_.styleName() + " "*/ + ++ cur_font_.family() + " " + + QString::number(cur_font_.pointSizeF(), 'f', 1)); ++#else ++ ui->fontPushButton->setText( ++ cur_font_.family() + " " + cur_font_.styleName() + " " + ++ QString::number(cur_font_.pointSizeF(), 'f', 1)); ++#endif + ui->fontSampleLineEdit->setFont(cur_font_); + + QString line_edit_ss = QString("QLineEdit { margin-left: %1px; }").arg(margin); +diff --git a/ui/qt/qt_ui_utils.cpp b/ui/qt/qt_ui_utils.cpp +index 8ad29d2..f4a0621 100644 +--- a/ui/qt/qt_ui_utils.cpp ++++ b/ui/qt/qt_ui_utils.cpp +@@ -55,7 +55,11 @@ QString gchar_free_to_qstring(gchar *glib_string) { + + void smooth_font_size(QFont &font) { + QFontDatabase fdb; ++#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) ++ QList size_list = fdb.smoothSizes(font.family(), ""); ++#else + QList size_list = fdb.smoothSizes(font.family(), font.styleName()); ++#endif + + if (size_list.size() < 2) return; + +-- +1.7.9.5 + diff --git a/wireshark.changes b/wireshark.changes index 1fd7b23..d49e3d2 100644 --- a/wireshark.changes +++ b/wireshark.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 15 22:11:53 UTC 2014 - andreas.stieger@gmx.de + +- Build expermiental UI wireshark-qt: + add wireshark-1.12.0-qt-QFont-stylename.patch + to support building with Qt 4.6 on SLE 11 + ------------------------------------------------------------------- Wed Aug 13 22:03:39 UTC 2014 - andreas.stieger@gmx.de diff --git a/wireshark.spec b/wireshark.spec index 605042d..a4e2e6d 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -20,6 +20,7 @@ %define use_caps 0 %define use_gtk3 0%{?suse_version} > 1140 +%bcond_without qt Name: wireshark Version: 1.12.0 @@ -37,14 +38,22 @@ Patch1: wireshark-1.2.0-disable-warning-dialog.patch Patch2: wireshark-1.2.0-geoip.patch Patch4: wireshark-1.10.0-enable_lua.patch Patch5: wireshark-1.10.0-authors-pod2man.patch +Patch6: wireshark-1.12.0-qt-QFont-stylename.patch BuildRequires: bison BuildRequires: cairo-devel BuildRequires: flex -%if 0%{?use_gtk3} +%if 0%{use_gtk3} BuildRequires: gtk3-devel >= 3.0.0 %else BuildRequires: gtk2-devel >= 2.12.0 %endif +%if %{with qt} +%if 0%{?suse_version} >= 1220 +BuildRequires: pkgconfig(QtCore) >= 4.6.0 +%else +BuildRequires: libqt4-devel >= 4.6.0 +%endif # 12.20 +%endif # with qt BuildRequires: krb5-devel BuildRequires: libcap-devel BuildRequires: libcares-devel @@ -125,6 +134,7 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark %endif %patch5 -p1 +%patch6 -p1 %build @@ -139,12 +149,16 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark %else --with-gtk3=no \ --with-gtk2=yes \ +%endif +%if %{with qt} + --with-qt=yes \ +%else + --with-qt=no \ %endif --with-ssl \ --with-gnutls=yes \ --with-gcrypt=yes \ --with-python \ - --with-qt=no \ --with-plugins=%{_libdir}/%{name}/plugins/%{version} make %{?_smp_mflags} @@ -208,6 +222,9 @@ getent group wireshark >/dev/null || groupadd wireshark %{_bindir}/ethereal %{_bindir}/tethereal %{_bindir}/wireshark +%if %{with qt} +%{_bindir}/wireshark-qt +%endif %{_bindir}/editcap %{_bindir}/tshark %{_bindir}/mergecap From 091629650748f26ddb9c4b04f1258453008d6025f6600390fba1502151282325 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Sun, 17 Aug 2014 16:06:53 +0000 Subject: [PATCH 2/4] Accepting request 244988 from home:AndreasStieger:branches:network:utilities - split UI into wireshark-ui-gtk and wireshark-ui-qt, to reduce dependencies, one of which is required by the main package - remove unknown configure option --with-python OBS-URL: https://build.opensuse.org/request/show/244988 OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=120 --- wireshark.changes | 7 +++++ wireshark.spec | 68 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/wireshark.changes b/wireshark.changes index d49e3d2..3ee3720 100644 --- a/wireshark.changes +++ b/wireshark.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Aug 17 12:22:05 UTC 2014 - andreas.stieger@gmx.de + +- split UI into wireshark-ui-gtk and wireshark-ui-qt, to reduce + dependencies, one of which is required by the main package +- remove unknown configure option --with-python + ------------------------------------------------------------------- Fri Aug 15 22:11:53 UTC 2014 - andreas.stieger@gmx.de diff --git a/wireshark.spec b/wireshark.spec index a4e2e6d..5a3c36d 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -20,6 +20,7 @@ %define use_caps 0 %define use_gtk3 0%{?suse_version} > 1140 +%bcond_without gtk %bcond_without qt Name: wireshark @@ -42,11 +43,13 @@ Patch6: wireshark-1.12.0-qt-QFont-stylename.patch BuildRequires: bison BuildRequires: cairo-devel BuildRequires: flex +%if %{with gtk} %if 0%{use_gtk3} BuildRequires: gtk3-devel >= 3.0.0 %else BuildRequires: gtk2-devel >= 2.12.0 -%endif +%endif # use_gtk3 +%endif # with gtk %if %{with qt} %if 0%{?suse_version} >= 1220 BuildRequires: pkgconfig(QtCore) >= 4.6.0 @@ -89,6 +92,7 @@ Recommends: GeoIP %if 0%{?suse_version} >= 1230 BuildRequires: gpg-offline %endif +Requires: wireshark-ui = %{version} %description Wireshark is a free network protocol analyzer for Unix and Windows. It @@ -115,6 +119,32 @@ and detail information for each packet. Wireshark has several powerful features, including a rich display filter language and the ability to view the reconstructed stream of a TCP session. +%if %{with gtk} + +%package ui-gtk +Summary: A Network Traffic Analyser - GTK+ UI +Group: Productivity/Networking/Diagnostic +Requires: %{name} = %{version} +Provides: %{name}-ui = %{version} + +%description ui-gtk +This package contains the classic GTK+ UI of Wireshark. + +%endif + +%if %{with qt} + +%package ui-qt +Summary: A Network Traffic Analyser - Qt UI +Group: Productivity/Networking/Diagnostic +Requires: %{name} = %{version} +Provides: %{name}-ui = %{version} + +%description ui-qt +This package contains the newer Qt based UI for Wireshark. + +%endif + %prep %{?gpg_verify: %gpg_verify %{S:2}} # The publisher doesn't sign the source tarball, but a signatures file containing multiple hashes. @@ -126,12 +156,14 @@ echo "`grep %{name}-%{version}.tar.bz2 %{S:2} | grep SHA1 | head -n1 | cut -d= - %patch2 -p1 %patch4 -p1 +%if %{with gtk} sed -i 's/^Icon=wireshark.png$/Icon=wireshark/' wireshark.desktop # run as root on 11.3 and older - bnc#349782 %if ! %{use_caps} %patch1 -p1 sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark.desktop %endif +%endif # with gtk %patch5 -p1 %patch6 -p1 @@ -143,6 +175,7 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark %if 0%{?suse_version} < 1220 --without-zlib \ %endif +%if %{with gtk} %if 0%{?use_gtk3} --with-gtk3=yes \ --with-gtk2=no \ @@ -150,6 +183,10 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark --with-gtk3=no \ --with-gtk2=yes \ %endif +%else + --with-gtk3=no \ + --with-gtk2=no \ +%endif # with gtk %if %{with qt} --with-qt=yes \ %else @@ -158,7 +195,6 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark --with-ssl \ --with-gnutls=yes \ --with-gcrypt=yes \ - --with-python \ --with-plugins=%{_libdir}/%{name}/plugins/%{version} make %{?_smp_mflags} @@ -166,7 +202,9 @@ make %{?_smp_mflags} %install make DESTDIR=%{buildroot} install find %{buildroot} -name "*.la" -delete -print +%if %{with gtk} ln -fs wireshark %{buildroot}%{_bindir}/ethereal +%endif ln -fs tshark %{buildroot}%{_bindir}/tethereal install -d -m 0755 %{buildroot}%{_sysconfdir} install -d -m 0755 %{buildroot}%{_mandir}/man1/ @@ -193,11 +231,13 @@ install -m 644 wiretap/*.h "${IDIR}/wiretap" install -m 644 wsutil/*.h "${IDIR}/wsutil" install -m 644 ws_symbol_export.h "${IDIR}/" +%if %{with gtk} install -D -m 0644 image/wsicon48.png %{buildroot}%{_datadir}/pixmaps/wireshark.png install -D -m 0644 wireshark.desktop %{buildroot}%{_datadir}/applications/wireshark.desktop %if 0%{?suse_version} %suse_update_desktop_file %{name} %endif +%endif %clean rm -rf %{buildroot} @@ -217,14 +257,8 @@ getent group wireshark >/dev/null || groupadd wireshark %doc AUTHORS COPYING NEWS README README.linux README.vmware %doc %{_mandir}/man1/[^i]* %doc %{_mandir}/man4/* -%{_datadir}/applications/wireshark.desktop -%{_datadir}/pixmaps/wireshark.png %{_bindir}/ethereal %{_bindir}/tethereal -%{_bindir}/wireshark -%if %{with qt} -%{_bindir}/wireshark-qt -%endif %{_bindir}/editcap %{_bindir}/tshark %{_bindir}/mergecap @@ -250,4 +284,22 @@ getent group wireshark >/dev/null || groupadd wireshark %{_includedir}/wireshark %{_libdir}/lib*.so +%if %{with gtk} + +%files ui-gtk +%defattr(-,root,root) +%{_bindir}/wireshark +%{_datadir}/applications/wireshark.desktop +%{_datadir}/pixmaps/wireshark.png + +%endif + +%if %{with qt} + +%files ui-qt +%defattr(-,root,root) +%{_bindir}/wireshark-qt + +%endif + %changelog From cd203b96153b5b8c0c5d62f1ae5001614517589ac58f1ef857c3dd20c9469b21 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Sun, 17 Aug 2014 16:09:38 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=121 --- wireshark.changes | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/wireshark.changes b/wireshark.changes index 3ee3720..bf9acaa 100644 --- a/wireshark.changes +++ b/wireshark.changes @@ -1,16 +1,12 @@ ------------------------------------------------------------------- -Sun Aug 17 12:22:05 UTC 2014 - andreas.stieger@gmx.de - -- split UI into wireshark-ui-gtk and wireshark-ui-qt, to reduce - dependencies, one of which is required by the main package -- remove unknown configure option --with-python - -------------------------------------------------------------------- -Fri Aug 15 22:11:53 UTC 2014 - andreas.stieger@gmx.de +Sun Aug 17 16:08:46 UTC 2014 - andreas.stieger@gmx.de - Build expermiental UI wireshark-qt: - add wireshark-1.12.0-qt-QFont-stylename.patch - to support building with Qt 4.6 on SLE 11 + * add wireshark-1.12.0-qt-QFont-stylename.patch + to support building with Qt 4.6 on SLE 11 + * split UI into wireshark-ui-gtk and wireshark-ui-qt to reduce + dependencies, one of which is required by the main package +- remove unknown configure option --with-python ------------------------------------------------------------------- Wed Aug 13 22:03:39 UTC 2014 - andreas.stieger@gmx.de From fdcc01ec9ffce0cfbdc1d14e0153532400cdf9cf32598de2796334476d6e9929 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Sun, 17 Aug 2014 16:10:37 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=122 --- wireshark.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wireshark.changes b/wireshark.changes index bf9acaa..654ad88 100644 --- a/wireshark.changes +++ b/wireshark.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Sun Aug 17 16:08:46 UTC 2014 - andreas.stieger@gmx.de -- Build expermiental UI wireshark-qt: +- Build experimental UI wireshark-qt: * add wireshark-1.12.0-qt-QFont-stylename.patch to support building with Qt 4.6 on SLE 11 * split UI into wireshark-ui-gtk and wireshark-ui-qt to reduce