From ffc0bdb036850967d37c9d7059665bb6bc6b211b Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Jun 02 2018 14:04:13 +0000 Subject: Add htmlreport tool. --- diff --git a/cppcheck-1.83-cmake.patch b/cppcheck-1.83-cmake.patch new file mode 100644 index 0000000..7bed3ff --- /dev/null +++ b/cppcheck-1.83-cmake.patch @@ -0,0 +1,24 @@ +diff -up cppcheck-1.83/CMakeLists.txt.qt5cmake cppcheck-1.83/CMakeLists.txt +--- cppcheck-1.83/CMakeLists.txt.qt5cmake 2018-06-02 14:01:44.339998373 +0200 ++++ cppcheck-1.83/CMakeLists.txt 2018-06-02 14:01:44.370997858 +0200 +@@ -1,5 +1,5 @@ + project(CppCheck) +-cmake_minimum_required(VERSION 2.8.4) ++cmake_minimum_required(VERSION 2.8.11) + + include(GNUInstallDirs) + +diff -up cppcheck-1.83/gui/CMakeLists.txt.qt5cmake cppcheck-1.83/gui/CMakeLists.txt +--- cppcheck-1.83/gui/CMakeLists.txt.qt5cmake 2018-06-02 14:01:44.372997824 +0200 ++++ cppcheck-1.83/gui/CMakeLists.txt 2018-06-02 14:02:04.869656720 +0200 +@@ -24,8 +24,8 @@ if (BUILD_GUI) + target_link_libraries(cppcheck-gui pcre) + endif() + target_link_libraries(cppcheck-gui tinyxml2) +- qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) +- ++ target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::LinguistTools) ++ + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) + install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications) + diff --git a/cppcheck.spec b/cppcheck.spec index b09fd95..c50786a 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -3,9 +3,8 @@ Name: cppcheck Version: 1.83 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tool for static C/C++ code analysis -Group: Development/Languages License: GPLv3+ URL: http://cppcheck.wiki.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -16,6 +15,8 @@ Patch0: cppcheck-1.83-tinyxml.patch Patch1: cppcheck-1.81-translations.patch # Set location of config files Patch2: cppcheck-1.78-cfgdir.patch +# Use modern qt5 cmake +Patch3: cppcheck-1.83-cmake.patch BuildRequires: gcc-c++ BuildRequires: pcre-devel @@ -47,18 +48,32 @@ errors in the code (i.e. have zero false positives). %if %{gui} %package gui Summary: Graphical user interface for cppcheck -Group: Applications/Engineering Requires: %{name}%{?_isa} = %{version}-%{release} %description gui This package contains the graphical user interface for cppcheck. %endif +%package htmlreport +Summary: HTML reporting for cppcheck +Requires: %{name}%{?_isa} = %{version}-%{release} +%if 0%{?rhel} > 0 && 0%{?rhel} < 8 +# RHEL packages aren't versioned +Requires: python-pygments +%else +Requires: python2-pygments +%endif + +%description htmlreport +This package contains the Python utility for generating html reports +from xml files first generated using cppcheck. + %prep %setup -q %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations %patch2 -p1 -b .cfgdir +%patch3 -p1 -b .qt5cmake # Make sure bundled tinyxml is not used rm -r externals/tinyxml @@ -89,6 +104,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png %endif +# Install htmlreport +install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport + + %check cd objdir-%{_target_platform}/bin ./testrunner -g -q @@ -108,7 +127,13 @@ cd objdir-%{_target_platform}/bin %{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg %endif +%files htmlreport +%{_bindir}/cppcheck-htmlreport + %changelog +* Sat Jun 02 2018 Susi Lehtola - 1.83-3 +- Add htmlreport tool. + * Thu May 17 2018 Susi Lehtola - 1.83-2 - Qt5 is available on RHEL 7 after all, re-enable gui in EPEL 7.