From 0df50da0c6ead5794ab27e7ffcae2a1115da42bd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 Nov 2021 05:10:42 -0500 Subject: [PATCH] import cppcheck-2.4-1.el8 --- .cppcheck.metadata | 2 +- .gitignore | 2 +- SOURCES/cppcheck-1.78-cfgdir.patch | 16 ----- SOURCES/cppcheck-1.81-translations.patch | 32 ---------- SOURCES/cppcheck-1.83-tinyxml.patch | 78 ------------------------ SPECS/cppcheck.spec | 39 ++++++------ 6 files changed, 21 insertions(+), 148 deletions(-) delete mode 100644 SOURCES/cppcheck-1.78-cfgdir.patch delete mode 100644 SOURCES/cppcheck-1.81-translations.patch delete mode 100644 SOURCES/cppcheck-1.83-tinyxml.patch diff --git a/.cppcheck.metadata b/.cppcheck.metadata index cb07d17..12748ec 100644 --- a/.cppcheck.metadata +++ b/.cppcheck.metadata @@ -1 +1 @@ -2a7da43886aa2b18ede075cb153b5cf0d569a2c2 SOURCES/cppcheck-1.83.tar.gz +b8be5b9cb040608af7bb7f9de88fd94f7cc59c12 SOURCES/cppcheck-2.4.tar.bz2 diff --git a/.gitignore b/.gitignore index 00649e7..cfb3570 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/cppcheck-1.83.tar.gz +SOURCES/cppcheck-2.4.tar.bz2 diff --git a/SOURCES/cppcheck-1.78-cfgdir.patch b/SOURCES/cppcheck-1.78-cfgdir.patch deleted file mode 100644 index f42f0bb..0000000 --- a/SOURCES/cppcheck-1.78-cfgdir.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up cppcheck-1.78/CMakeLists.txt.orig cppcheck-1.78/CMakeLists.txt -diff -up cppcheck-1.78/cmake/options.cmake.orig cppcheck-1.78/cmake/options.cmake ---- cppcheck-1.78/cmake/options.cmake.orig 2017-04-01 11:05:13.000000000 +0200 -+++ cppcheck-1.78/cmake/options.cmake 2017-04-09 14:13:30.130818011 +0200 -@@ -23,6 +23,11 @@ option(ANALYZE_DATAFLOW "Clang dynam - option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF) - option(WARNINGS_ANSI_ISO "Issue all the mandatory diagnostics Listed in C standard" ON) - -+option(CFGDIR "Configuration file directory" OFF) -+if(CFGDIR) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCFG=${CFGDIR}") -+endif(CFGDIR) -+ - set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compliler") - set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify) - if (USE_MATCHCOMPILER STREQUAL "Auto") diff --git a/SOURCES/cppcheck-1.81-translations.patch b/SOURCES/cppcheck-1.81-translations.patch deleted file mode 100644 index 9e9a662..0000000 --- a/SOURCES/cppcheck-1.81-translations.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up cppcheck-1.81/gui/CMakeLists.txt.translations cppcheck-1.81/gui/CMakeLists.txt ---- cppcheck-1.81/gui/CMakeLists.txt.translations 2017-10-18 16:41:50.647580110 +0200 -+++ cppcheck-1.81/gui/CMakeLists.txt 2017-10-18 16:42:38.432882931 +0200 -@@ -27,7 +27,7 @@ if (BUILD_GUI) - qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) - - install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) -- install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) -+ install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications) - - install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) - -diff -up cppcheck-1.81/gui/translationhandler.cpp.translations cppcheck-1.81/gui/translationhandler.cpp ---- cppcheck-1.81/gui/translationhandler.cpp.translations 2017-10-07 23:11:39.000000000 +0200 -+++ cppcheck-1.81/gui/translationhandler.cpp 2017-10-18 16:41:50.649580081 +0200 -@@ -116,15 +116,7 @@ bool TranslationHandler::setLanguage(con - if (datadir.isEmpty()) - datadir = appPath; - -- QString translationFile; -- if (QFile::exists(datadir + "/lang/" + mTranslations[index].mFilename + ".qm")) -- translationFile = datadir + "/lang/" + mTranslations[index].mFilename + ".qm"; -- -- else if (QFile::exists(datadir + "/" + mTranslations[index].mFilename + ".qm")) -- translationFile = datadir + "/" + mTranslations[index].mFilename + ".qm"; -- -- else -- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm"; -+ QString translationFile("/usr/share/CppCheck/lang/" + mTranslations[index].mFilename + ".qm"); - - if (!mTranslator->load(translationFile) && !failure) { - //If it failed, lets check if the default file exists diff --git a/SOURCES/cppcheck-1.83-tinyxml.patch b/SOURCES/cppcheck-1.83-tinyxml.patch deleted file mode 100644 index b396f48..0000000 --- a/SOURCES/cppcheck-1.83-tinyxml.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- cppcheck-1.83.orig/cli/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/cli/CMakeLists.txt 2018-04-12 12:46:04.990212969 -0400 -@@ -1,5 +1,4 @@ - include_directories(${PROJECT_SOURCE_DIR}/lib/) --include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) - include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) - - file(GLOB hdrs "*.h") -@@ -8,13 +7,14 @@ - list(REMOVE_ITEM srcs ${mainfile}) - - add_library(cli_objs OBJECT ${hdrs} ${srcs}) --add_executable(cppcheck ${hdrs} ${mainfile} $ $ $ $) -+add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) - if (HAVE_RULES) - target_link_libraries(cppcheck pcre) - endif() - if (MSVC) - target_link_libraries(cppcheck Shlwapi.lib) - endif() -+target_link_libraries(cppcheck tinyxml2) - - install(TARGETS cppcheck - RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ---- cppcheck-1.83.orig/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -16,7 +16,6 @@ - enable_testing() - endif() - --add_subdirectory(externals/tinyxml) - add_subdirectory(externals/simplecpp) - add_subdirectory(lib) # CppCheck Library - add_subdirectory(cli) # Client application ---- cppcheck-1.83.orig/gui/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/gui/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -10,7 +10,6 @@ - endif() - - include_directories(${PROJECT_SOURCE_DIR}/lib/) -- include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) - - file(GLOB hdrs "*.h") - file(GLOB srcs "*.cpp") -@@ -20,10 +19,11 @@ - QT5_ADD_RESOURCES(resources "gui.qrc") - QT5_ADD_TRANSLATION(qms ${tss}) - -- add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $ $) -+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) - if (HAVE_RULES) - target_link_libraries(cppcheck-gui pcre) - endif() -+ target_link_libraries(cppcheck-gui tinyxml2) - qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) - - install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) ---- cppcheck-1.83.orig/test/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/test/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -1,16 +1,16 @@ - if (BUILD_TESTS) - - include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/) -- include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml) - include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) - - file(GLOB hdrs "*.h") - file(GLOB srcs "*.cpp") - -- add_executable(testrunner ${hdrs} ${srcs} $ $ $ $) -+ add_executable(testrunner ${hdrs} ${srcs} $ $ $) - if (HAVE_RULES) - target_link_libraries(testrunner pcre) - endif() -+ target_link_libraries(testrunner tinyxml2) - - add_custom_target(copy_cfg ALL - COMMENT "Copying cfg files") diff --git a/SPECS/cppcheck.spec b/SPECS/cppcheck.spec index 2df67c3..1690bce 100644 --- a/SPECS/cppcheck.spec +++ b/SPECS/cppcheck.spec @@ -1,24 +1,18 @@ Name: cppcheck -Version: 1.83 +Version: 2.4 Release: 1%{?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 - -# Use system tinyxml2 -Patch0: cppcheck-1.83-tinyxml.patch -# Fix location of translations -Patch1: cppcheck-1.81-translations.patch -# Set location of config files -Patch2: cppcheck-1.78-cfgdir.patch +Source0: https://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2 BuildRequires: gcc-c++ BuildRequires: pcre-devel -BuildRequires: tinyxml2-devel >= 2.1.0 +BuildRequires: tinyxml2-devel >= 2.6.0 BuildRequires: docbook-style-xsl BuildRequires: libxslt +BuildRequires: pandoc BuildRequires: qt5-devel BuildRequires: cmake BuildRequires: desktop-file-utils @@ -41,18 +35,11 @@ This package contains the graphical user interface for cppcheck. %prep %setup -q -%patch0 -p1 -b .tinyxml -%patch1 -p1 -b .translations -%patch2 -p1 -b .cfgdir -# Make sure bundled tinyxml is not used -rm -r externals/tinyxml %build # Manuals -make DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl man -xsltproc --nonet -o man/manual.html \ - %{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl \ - man/manual.docbook +make DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl man +man/build-html.sh man/manual # Binaries mkdir objdir-%{_target_platform} @@ -78,8 +65,9 @@ cd objdir-%{_target_platform}/bin %files %doc AUTHORS COPYING man/manual.html -%{_datadir}/CppCheck/ +%{_datadir}/Cppcheck/ %{_bindir}/cppcheck +%{_bindir}/cppcheck*.qm %{_mandir}/man1/cppcheck.1* %files gui @@ -91,6 +79,17 @@ cd objdir-%{_target_platform}/bin %changelog +* Wed Jun 16 2021 Dodji Seketeli - 2.4-1 +- Update to 2.4 upstream tarball +- Drop patches: cppcheck-1.83-tinyxml.patch, cppcheck-1.81-translations.patch, cppcheck-1.78-cfgdir.patch. +- Bump BuildRequires for tinyxml2-devel to 2.6.0 at least. +- Add BuildRequires pandoc. +- There is no more bundled tinyxml in this new version of cppcheck. +- Use the man/build-html.sh script to build the html version of the manual +- Adjust $datadir/CppCheck to $datadir/Cppcheck. +- Add $bindir/cppcheck*.qm files to the package. +- Resolves: rhbz#1959478 + * Sat Apr 14 2018 Susi Lehtola - 1.83-1 - Update to 1.83.