%global git_commit 3b3c6c1de2f63a52d5b73fc84e7f23375590c845 %global git_commitdate 20220426.040836 %global git_shortcommit %%(c=%%{git_commit}; echo ${c:0:7}) %global realname kernel-shark Name: kernelshark Version: 2.1.1 Release: 202209141646%{?dist} Epoch: 1 %global libraryname libkshark %if 0%{?is_opensuse} == 1 %global _disable_ld_no_undefined 1 %endif # As of 1.1, only kernelshark.cpp, kshark-record.cpp and examples are GPL-2.0. The rest of kernel-shark is LGPL-2.1. # See SPDX identifier for most accurate info License: GPLv2 and LGPLv2 Summary: GUI analysis for Ftrace data captured by trace-cmd URL: https://kernelshark.org Source0: kernelshark-%{version}.tar.gz Source1: %{name}.appdata.xml #Patch0: 2-2-kernel-shark-Treat-all-tracing-headers-as-library-headers.diff Patch0: kernel-shark-rpath.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: doxygen BuildRequires: texlive-epstopdf BuildRequires: ghostscript BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: graphviz BuildRequires: pkgconf BuildRequires: freeglut-devel #BuildRequires: pkgconfig(glut) BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(Qt5Core) BuildRequires: font(freesans) # So libtracecmd was miss versioned in it's # initial rpm, and versioned to match trace-cmd # so for now libtracecmd-1 to obselete and # mash around that. Remove when the versioning # is fixed #BuildRequires: libtracecmd-devel < 2 BuildRequires: libtracecmd-1-devel BuildRequires: libtraceevent-devel BuildRequires: libtracefs-devel BuildRequires: boost-devel BuildRequires: trace-cmd BuildRequires: xmlto BuildRequires: make BuildRequires: zstd BuildRequires: libarchive-devel %if 0%{?is_opensuse} == 1 BuildRequires: docbook-xsl-stylesheets BuildRequires: extra-cmake-modules BuildRequires: cmake(KF5Config) BuildRequires: cmake(KF5CoreAddons) BuildRequires: cmake(KF5Crash) BuildRequires: cmake(KF5DBusAddons) BuildRequires: cmake(KF5DNSSD) BuildRequires: cmake(KF5DocTools) BuildRequires: cmake(KF5I18n) BuildRequires: cmake(KF5Notifications) BuildRequires: cmake(KF5Wallet) BuildRequires: cmake(KF5Wayland) BuildRequires: cmake(KF5WidgetsAddons) BuildRequires: cmake(KF5WindowSystem) BuildRequires: cmake(KF5XmlGui) BuildRequires: cmake(PlasmaWaylandProtocols) BuildRequires: cmake(Qt5Core) BuildRequires: cmake(Qt5DBus) BuildRequires: cmake(Qt5Test) BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5WaylandClient) BuildRequires: cmake(Qt5X11Extras) %elif "%{_vendor}" == "openmandriva" BuildRequires: docbook-style-xsl %else BuildRequires: docbook-style-xsl BuildRequires: kf5-rpm-macros BuildRequires: libappstream-glib BuildRequires: libzstd BuildRequires: libzstd-devel %endif Requires: polkit Requires: %{libraryname} = %{version}-%{release} Requires: libtracecmd-1 Requires: libtraceevent Requires: libtracefs %package -n %{libraryname} Summary: Library files for %{name} Requires: libtracecmd-1 Requires: libtraceevent Requires: libtracefs %package -n %{libraryname}-devel Summary: Development headers for %{name} Requires: libtracecmd-1-devel Requires: libtraceevent-devel Requires: libtracefs-devel %description KernelShark is a front end reader of trace-cmd output. "trace-cmd record" and "trace-cmd extract" create a trace.dat (trace-cmd.dat) file. kernelshark can read this file and produce a graph and list view of its data. %description -n %{libraryname} KernelShark libraries %description -n %{libraryname}-devel Development libraries for KernelShark %prep %autosetup -p1 -n %{name}-%{version} %build # MANPAGE_DOCBOOK_XSL define is hack to avoid using locate # -z muldefs to workaround the enforcing multi definition check of gcc10. # and it need to be removed once upstream fixed the variable name # Do not use parallel compile because it makes compiling fail # If we are Fedora or RHEL(ish) run this %if 0%{?fedora} || 0%{?rhel} || "%{_vendor}" == "openmandriva" echo "~ Into Fedora / RHEL / openmandriva" MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-style-xsl | grep manpages/docbook.xsl` %endif %if 0%{?is_opensuse} == 1 echo "~ Into OpenSuse" MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-xsl-stylesheets | grep manpages/docbook.xsl` %endif rpm --showrc #cd %{_builddir}/%{name}-%{version}/build %if 0%{?is_opensuse} == 1 echo "##############################" echo "$( echo "%cmake_kf5" | sed 's/-Wl,--no-undefined //g' )" echo "##############################" #%cmake_kf5 -- -D_INSTALL_PREFIX=%{_prefix} -D_DOXYGEN_DOC=1 -D_LIBDIR=%{_libdir} eval $( echo "%cmake_kf5" | sed -e 's/-Wl,--no-undefined //g' -e 's/-fasynchronous-unwind-tables //g' -e 's/-funwind-tables //g' ) -D_INSTALL_PREFIX=%{_prefix} -D_DOXYGEN_DOC=1 -D_LIBDIR=%{_libdir} %else %cmake_kf5 \ -D_INSTALL_PREFIX=%{_prefix} \ -D_DOXYGEN_DOC=1 \ -D_LIBDIR=%{_libdir} %endif echo "~ Setup done, let's run the build" %cmake_build %install #cd %{_builddir}/%{name}-%{version}/build %cmake_install find %{buildroot}%{_datadir} -type f -exec chmod u-x,g-x,o-x {} \; find %{buildroot}%{_libdir} -type f -iname "*.so" -exec chmod 0755 {} \; sed -i '/Version/d' %{buildroot}/%{_datadir}/applications/kernelshark.desktop desktop-file-validate %{buildroot}/%{_datadir}/applications/kernelshark.desktop mkdir -p %{buildroot}%{_metainfodir}/ cp %{SOURCE1} %{buildroot}%{_metainfodir}/ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml %files %license LICENSES/LGPL-2.1 %license LICENSES/GPL-2.0 %doc README %{_bindir}/kernelshark %{_bindir}/kshark-record %{_bindir}/kshark-su-record %{_datadir}/applications/kernelshark.desktop %dir %{_datadir}/icons/kernelshark %{_datadir}/icons/kernelshark/* %{_datadir}/polkit-1/actions/org.freedesktop.kshark-record.policy %{_metainfodir}/%{name}.appdata.xml %files -n %{libraryname}-devel %{_includedir}/kernelshark/ %{_libdir}/libkshark.so %{_libdir}/pkgconfig/libkshark.pc %files -n %{libraryname} %{_libdir}/%{libraryname}*.so.* %dir %{_libdir}/kernelshark %{_libdir}/kernelshark/* %changelog * Fri Jul 16 2021 John 'Warthog9' Hawley (VMware) - 2.0-1 - Update to 2.0 - Adding libkshark independent library & devel goes here * Sat Jul 10 2021 Björn Esser - 1:1.3-2 - Rebuild for versioned symbols in json-c * Tue May 11 2021 Zamir SUN - 1.3-1 - Update to 1.3 * Mon May 10 2021 Jonathan Wakely - 1:1.2-6 - Rebuilt for removed libstdc++ symbols (#1937698) * Wed Mar 31 2021 Jonathan Wakely - 1:1.2-5 - Rebuilt for removed libstdc++ symbols (#1937698) * Wed Mar 24 2021 Jerome Marchand - 1.2-3 - Rebuild with external libtracefs and libtraceevent - Misc cleanup * Tue Jan 26 2021 Fedora Release Engineering - 1:1.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Jan 09 2021 Zamir SUN - 1.2-2 - Bump epoch to allow updating. * Mon Oct 12 2020 Zamir SUN - 1.2-1 - Update to 1.2 - Uses trace event plugins from old trace-cmd dir * Thu Sep 24 2020 Zamir SUN - 1.1-1 - Package kernelshark in a standalone package with 1.1