From 97d94d26d33fa14172512dd4d49161665d9bb180 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2019 02:35:12 +0000 Subject: import cppcheck-1.83-1.el8 --- diff --git a/.cppcheck.metadata b/.cppcheck.metadata new file mode 100644 index 0000000..cb07d17 --- /dev/null +++ b/.cppcheck.metadata @@ -0,0 +1 @@ +2a7da43886aa2b18ede075cb153b5cf0d569a2c2 SOURCES/cppcheck-1.83.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..00649e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/cppcheck-1.83.tar.gz diff --git a/SOURCES/cppcheck-1.78-cfgdir.patch b/SOURCES/cppcheck-1.78-cfgdir.patch new file mode 100644 index 0000000..f42f0bb --- /dev/null +++ b/SOURCES/cppcheck-1.78-cfgdir.patch @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000..9e9a662 --- /dev/null +++ b/SOURCES/cppcheck-1.81-translations.patch @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..b396f48 --- /dev/null +++ b/SOURCES/cppcheck-1.83-tinyxml.patch @@ -0,0 +1,78 @@ +--- 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 new file mode 100644 index 0000000..2df67c3 --- /dev/null +++ b/SPECS/cppcheck.spec @@ -0,0 +1,318 @@ +Name: cppcheck +Version: 1.83 +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 + +BuildRequires: gcc-c++ +BuildRequires: pcre-devel +BuildRequires: tinyxml2-devel >= 2.1.0 +BuildRequires: docbook-style-xsl +BuildRequires: libxslt +BuildRequires: qt5-devel +BuildRequires: cmake +BuildRequires: desktop-file-utils + +%description +Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++ +compilers and many other analysis tools it does not detect syntax +errors in the code. Cppcheck primarily detects the types of bugs that +the compilers normally do not detect. The goal is to detect only real +errors in the code (i.e. have zero false positives). + +%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. + + +%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 + +# Binaries +mkdir objdir-%{_target_platform} +cd objdir-%{_target_platform} +# Upstream doesn't support shared libraries (unversioned solib) +%cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=1 -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=1 -DCFGDIR=%{_datadir}/CppCheck +# SMP make doesn't seem to work +make cppcheck + +%install +rm -rf %{buildroot} +make -C objdir-%{_target_platform} DESTDIR=%{buildroot} install +install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1 + +# Install desktop file +desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop +# Install logo +install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png + +%check +cd objdir-%{_target_platform}/bin +./testrunner -g -q + +%files +%doc AUTHORS COPYING man/manual.html +%{_datadir}/CppCheck/ +%{_bindir}/cppcheck +%{_mandir}/man1/cppcheck.1* + +%files gui +%{_bindir}/cppcheck-gui +%{_datadir}/applications/cppcheck-gui.desktop +%{_datadir}/pixmaps/cppcheck-gui.png +%{_datadir}/icons/hicolor/64x64/apps/cppcheck-gui.png +%{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg + + +%changelog +* Sat Apr 14 2018 Susi Lehtola - 1.83-1 +- Update to 1.83. + +* Wed Feb 28 2018 Susi Lehtola - 1.81-5 +- Added gcc-c++ buildrequires. + +* Wed Feb 07 2018 Fedora Release Engineering - 1.81-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 23 2018 Björn Esser - 1.81-3 +- Rebuilt for tinyxml2 soname/ABI change again + +* Tue Jan 23 2018 François Cami - 1.81-2 +- Rebuilt for tinyxml2 soname/ABI change + +* Wed Oct 18 2017 Susi Lehtola - 1.81-1 +- Update to 1.81. + +* Tue Aug 01 2017 Gwyn Ciesla - 1.80-1 +- 1.80 + +* Wed Jul 26 2017 Fedora Release Engineering - 1.79-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed May 17 2017 Susi Lehtola - 1.79-1 +- Update to 1.79. + +* Sun Apr 09 2017 Susi Lehtola - 1.78-1 +- Make cppcheck able to find its configs once again (bug 1427788). +- Update to 1.78. + +* Mon Feb 27 2017 Mamoru TASAKA - 1.77-4 +- Remove Patch2: fixed in gcc side (gcc-7.0.1-10.fc26) + (ref: bug 1423312) + +* Fri Feb 17 2017 Mamoru TASAKA - 1.77-3 +- Fix FTBFS with gcc7 (bug 1423312, upstream ticket 7910) + +* Fri Feb 10 2017 Fedora Release Engineering - 1.77-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jan 31 2017 Jon Ciesla - 1.77-1 +- 1.77. + +* Mon Aug 08 2016 Susi Lehtola - 1.75-1 +- Update to 1.75. + +* Tue Aug 02 2016 Susi Lehtola - 1.74-2 +- Re-enable tests on x86. + +* Mon Aug 01 2016 Susi Lehtola - 1.74-1 +- Update to 1.74. + +* Sun May 22 2016 Rich Mattes - 1.73-2 +- Rebuild for tinyxml2-3.0.0 + +* Sat Apr 09 2016 Susi Lehtola - 1.73-1 +- Update to 1.73. + +* Wed Feb 03 2016 Fedora Release Engineering - 1.71-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sat Nov 14 2015 Susi Lehtola - 1.71-1 +- Update to 1.71. + +* Fri Nov 13 2015 Susi Lehtola - 1.70-4 +- Link whole archive (BZ #1280242), patch by Mamoru Tasaka. +- Compile and run tests using CMake. + +* Wed Nov 11 2015 Susi Lehtola - 1.70-3 +- Enable HAVE_RULES. + +* Thu Nov 5 2015 Susi Lehtola - 1.70-2 +- Include GUI (BZ #1278318). + +* Mon Sep 21 2015 Susi Lehtola - 1.70-1 +- Update to 1.70. + +* Wed Jun 17 2015 Fedora Release Engineering - 1.68-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - 1.68-2 +- Rebuilt for GCC 5 C++11 ABI change + +* Sat Jan 03 2015 Susi Lehtola - 1.68-1 +- Update to 1.68. + +* Mon Dec 01 2014 Susi Lehtola - 1.67-1 +- Update to 1.67. + +* Sat Aug 23 2014 Susi Lehtola - 1.66-1 +- Update to 1.66. + +* Sat Aug 16 2014 Fedora Release Engineering - 1.65-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.65-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 13 2014 Susi Lehtola - 1.65-1 +- Update to 1.65. + +* Wed Jan 22 2014 François Cami - 1.63-3 +- Add HAVE_RULES=yes (#1056733). + +* Tue Jan 07 2014 Susi Lehtola - 1.63-2 +- Include cfg files as well. + +* Tue Jan 07 2014 Susi Lehtola - 1.63-1 +- Update to 1.63. + +* Sun Oct 13 2013 Susi Lehtola - 1.62-1 +- Update to 1.62. + +* Sat Aug 10 2013 Susi Lehtola - 1.61-1 +- Update to 1.61. + +* Sat Aug 03 2013 Fedora Release Engineering - 1.60.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 03 2013 François Cami - 1.60.1-1 +- Update to 1.60.1. + +* Mon Apr 01 2013 Susi Lehtola - 1.59-1 +- Update to 1.59. + +* Wed Feb 13 2013 Fedora Release Engineering - 1.58-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Jan 13 2013 François Cami - 1.58-1 +- Update to 1.58. + +* Tue Sep 18 2012 Jussi Lehtola - 1.57-1 +- Update to 1.57. + +* Tue Sep 18 2012 Jussi Lehtola - 1.56-1 +- Update to 1.56. + +* Wed Jul 18 2012 Fedora Release Engineering - 1.55-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 10 2012 Jussi Lehtola - 1.55-1 +- Update to 1.55. + +* Sun Apr 15 2012 Jussi Lehtola - 1.54-1 +- Update to 1.54. + +* Sat Feb 11 2012 Jussi Lehtola - 1.53-1 +- Update to 1.53. + +* Thu Jan 05 2012 Jussi Lehtola - 1.52-2 +- Add missing includes (fix FTBFS in rawhide). + +* Sun Dec 11 2011 Jussi Lehtola - 1.52-1 +- Update to 1.52. + +* Wed Oct 26 2011 Ville Skyttä - 1.51-2 +- Include man page and more other docs. +- Build with $RPM_LD_FLAGS. +- Improve summary and description. + +* Sun Oct 09 2011 Jussi Lehtola - 1.51-1 +- Update to 1.51. + +* Fri Aug 19 2011 Jussi Lehtola - 1.50-2 +- Fix build on EPEL-4. + +* Sun Aug 14 2011 Jussi Lehtola - 1.50-1 +- Update to 1.50. + +* Mon Jun 13 2011 Jussi Lehtola - 1.49-1 +- Update to 1.49. + +* Sat Apr 30 2011 Ville Skyttä - 1.48-2 +- Build with system tinyxml and support for rules. +- Run test suite during build, don't include its sources in docs. +- Drop readme.txt from docs, it doesn't contain useful info after installed. + +* Fri Apr 15 2011 Jussi Lehtola - 1.48-1 +- Update to 1.48. + +* Tue Feb 08 2011 Fedora Release Engineering - 1.47-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Feb 07 2011 Jussi Lehtola - 1.47-1 +- Update to 1.47. + +* Thu Dec 30 2010 Jussi Lehtola - 1.46.1-1 +- Update to 1.46.1. + +* Wed Dec 15 2010 Jussi Lehtola - 1.46-1 +- Update to 1.46. + +* Mon Oct 4 2010 Jussi Lehtola - 1.45-1 +- Update to 1.45. + +* Sat Jul 24 2010 Jussi Lehtola - 1.44-1 +- Update to 1.44. + +* Sun May 9 2010 Jussi Lehtola - 1.43-1 +- Update to 1.43. + +* Wed Mar 10 2010 Jussi Lehtola - 1.42-1 +- Update to 1.42. + +* Mon Jan 18 2010 Jussi Lehtola - 1.40-1 +- Update to 1.40. + +* Sun Dec 27 2009 Jussi Lehtola - 1.39-1 +- Update to 1.39. + +* Sat Nov 07 2009 Jussi Lehtola - 1.38-1 +- Update to 1.38. + +* Tue Sep 22 2009 Jussi Lehtola - 1.36-1 +- Update to 1.36. + +* Fri Jul 24 2009 Fedora Release Engineering - 1.34-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 16 2009 Jussi Lehtola - 1.34-1 +- Update to 1.34. + +* Mon Apr 27 2009 Jussi Lehtola - 1.31-1 +- First release.