968edaf
# Gui built in all branches
da69b0a
%global gui 1
da69b0a
f8cc68f
Name:           cppcheck
bd7178b
Version:        1.88
b1deeef
Release:        5%{?dist}
f8cc68f
Summary:        Tool for static C/C++ code analysis
f8cc68f
License:        GPLv3+
f8cc68f
URL:            http://cppcheck.wiki.sourceforge.net/
f8cc68f
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
19bffcf
aec3384
# Use system tinyxml2
bd7178b
Patch0:         cppcheck-1.88-tinyxml.patch
aec3384
# Fix location of translations
bd7178b
Patch1:         cppcheck-1.88-translations.patch
7d543fe
# Set location of config files
3d97d3e
Patch2:         cppcheck-1.87-cfgdir.patch
45daf4b
# Select python3 explicitly
45daf4b
Patch3:         cppcheck-1.88-htmlreport-python3.patch
aec3384
a0cbaee
# BZ #1733663
a0cbaee
Patch4:         https://github.com/danmar/cppcheck/pull/1939.patch
7f4c5e0
# BZ #1733663
7f4c5e0
Patch5:         https://github.com/danmar/cppcheck/pull/1943.patch
a0cbaee
c00a51e
BuildRequires:  gcc-c++
f8cc68f
BuildRequires:  pcre-devel
f8cc68f
BuildRequires:  docbook-style-xsl
f8cc68f
BuildRequires:  libxslt
aec3384
BuildRequires:  cmake
19d3766
BuildRequires:  desktop-file-utils
968edaf
BuildRequires:  tinyxml2-devel >= 2.1.0
a9e97c1
BuildRequires:  zlib-devel
deaab33
da69b0a
%if %{gui}
968edaf
%if 0%{?rhel} == 7
968edaf
# no qt5-devel metapackage!
968edaf
BuildRequires: qt5-qtbase-devel
968edaf
BuildRequires: qt5-linguist
968edaf
%else
da69b0a
BuildRequires:  qt5-devel
968edaf
%endif
da69b0a
%else
da69b0a
Obsoletes:      %{name}-gui < %{version}-%{release}
da69b0a
%endif
da69b0a
19bffcf
%description
5165102
Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++
5165102
compilers and many other analysis tools it does not detect syntax
5165102
errors in the code. Cppcheck primarily detects the types of bugs that
5165102
the compilers normally do not detect. The goal is to detect only real
5165102
errors in the code (i.e. have zero false positives).
19bffcf
da69b0a
%if %{gui}
aec3384
%package gui
aec3384
Summary:        Graphical user interface for cppcheck
aec3384
Requires:       %{name}%{?_isa} = %{version}-%{release}
aec3384
aec3384
%description gui
aec3384
This package contains the graphical user interface for cppcheck.
da69b0a
%endif
19bffcf
1d82217
%package htmlreport
1d82217
Summary:        HTML reporting for cppcheck
1d82217
Requires:       %{name}%{?_isa} = %{version}-%{release}
1d82217
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
1d82217
# RHEL packages aren't versioned
1d82217
Requires:       python-pygments
1d82217
%else
45daf4b
Requires:       python3-pygments
1d82217
%endif
1d82217
1d82217
%description htmlreport
1d82217
This package contains the Python utility for generating html reports
1d82217
from xml files first generated using cppcheck.
1d82217
19bffcf
%prep
19bffcf
%setup -q
aec3384
%patch0 -p1 -b .tinyxml
aec3384
%patch1 -p1 -b .translations
7d543fe
%patch2 -p1 -b .cfgdir
45daf4b
%patch3 -p1 -b .python3
7f4c5e0
%patch4 -p1 -b .bz1733663a
7f4c5e0
%patch5 -p1 -b .bz1733663b
3edc4fb
# Make sure bundled tinyxml is not used
3edc4fb
rm -r externals/tinyxml
3e13dbe
19bffcf
%build
aec3384
# Manuals
aec3384
make DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl man 
5165102
xsltproc --nonet -o man/manual.html \
5165102
    %{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl \
5165102
    man/manual.docbook
19bffcf
aec3384
# Binaries
aec3384
mkdir objdir-%{_target_platform}
aec3384
cd objdir-%{_target_platform}
aec3384
# Upstream doesn't support shared libraries (unversioned solib)
9d1bd55
%cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=1 -DBUILD_GUI=%{gui} -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=1 -DCFGDIR=%{_datadir}/Cppcheck
0994c5b
# SMP make doesn't seem to work
bbcef80
make cppcheck
aec3384
19bffcf
%install
19bffcf
rm -rf %{buildroot}
aec3384
make -C objdir-%{_target_platform} DESTDIR=%{buildroot} install
5165102
install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1
19bffcf
da69b0a
%if %{gui}
19d3766
# Install desktop file
1121bba
desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop
19d3766
# Install logo
1121bba
install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png
da69b0a
%endif
19d3766
1d82217
# Install htmlreport
1d82217
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
1d82217
1d82217
3edc4fb
%check
bbcef80
cd objdir-%{_target_platform}/bin
bbcef80
./testrunner -g -q
3edc4fb
19bffcf
%files
5165102
%doc AUTHORS COPYING man/manual.html
9d1bd55
%{_datadir}/Cppcheck/
19bffcf
%{_bindir}/cppcheck
5165102
%{_mandir}/man1/cppcheck.1*
19bffcf
da69b0a
%if %{gui}
aec3384
%files gui
aec3384
%{_bindir}/cppcheck-gui
1121bba
%{_datadir}/applications/cppcheck-gui.desktop
1121bba
%{_datadir}/pixmaps/cppcheck-gui.png
1121bba
%{_datadir}/icons/hicolor/64x64/apps/cppcheck-gui.png
1121bba
%{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg
da69b0a
%endif
aec3384
1d82217
%files htmlreport
1d82217
%{_bindir}/cppcheck-htmlreport
1d82217
19bffcf
%changelog
b1deeef
* Fri Aug 16 2019 Susi Lehtola <susi.lehtola@iki.fi> - 1.88-5
b1deeef
- rebuilt
b1deeef
45daf4b
* Wed Aug 14 2019 Susi Lehtola <jussilehtola@redhat.com> - 1.89-5
45daf4b
- Switch to python3 in htmlreport (BZ #1737972).
45daf4b
7f4c5e0
* Mon Jul 29 2019 Susi Lehtola <jussilehtola@redhat.com> - 1.89-4
7f4c5e0
- Second patch for another issue in BZ #1733663.
7f4c5e0
a0cbaee
* Sat Jul 27 2019 Susi Lehtola <jussilehtola@redhat.com> - 1.89-3
a0cbaee
- Fix BZ #1733663.
a0cbaee
3ea942e
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.88-2
3ea942e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
3ea942e
bd7178b
* Mon Jul 01 2019 Steve Grubb <sgrubb@redhat.com> - 1.88-1
bd7178b
- Update to 1.88
bd7178b
3d97d3e
* Sat Feb 09 2019 Steve Grubb <sgrubb@redhat.com> - 1.87-1
3d97d3e
- Update to 1.87.
3d97d3e
22538f3
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.86-2
22538f3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
22538f3
a9e97c1
* Sun Dec 16 2018 Steve Grubb <sgrubb@redhat.com> - 1.86-1
a9e97c1
- Update to 1.86.
a9e97c1
fc0d5ec
* Tue Nov 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.85-2
fc0d5ec
- Rebuild for tinyxml2 7.x
fc0d5ec
9d1bd55
* Thu Nov 08 2018 Steve Grubb <sgrubb@redhat.com> - 1.85-1
9d1bd55
- Update to 1.85.
9d1bd55
e13f8f2
* Tue Sep 11 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.84-1
e13f8f2
- Update to 1.84.
e13f8f2
d50c435
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.83-4
d50c435
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d50c435
ffc0bdb
* Sat Jun 02 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.83-3
1d82217
- Add htmlreport tool.
1d82217
968edaf
* Thu May 17 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.83-2
968edaf
- Qt5 is available on RHEL 7 after all, re-enable gui in EPEL 7.
968edaf
d4f19b3
* Sat Apr 14 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.83-1
da69b0a
- GUI no longer available on RHEL 7 due to Qt5 dependency.
d4f19b3
- Update to 1.83.
d4f19b3
c00a51e
* Wed Feb 28 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.81-5
c00a51e
- Added gcc-c++ buildrequires.
c00a51e
ae349f0
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.81-4
ae349f0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ae349f0
8815992
* Tue Jan 23 2018 Björn Esser <besser82@fedoraproject.org> - 1.81-3
8815992
- Rebuilt for tinyxml2 soname/ABI change again
8815992
24a7a83
* Tue Jan 23 2018 François Cami <fcami@fedoraproject.org> - 1.81-2
24a7a83
- Rebuilt for tinyxml2 soname/ABI change
24a7a83
c18c9f5
* Wed Oct 18 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.81-1
c18c9f5
- Update to 1.81.
c18c9f5
79cb75e
* Tue Aug 01 2017 Gwyn Ciesla <limburgher@gmail.com> - 1.80-1
79cb75e
- 1.80
79cb75e
e75bffa
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.79-2
e75bffa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e75bffa
dd7b18f
* Wed May 17 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.79-1
dd7b18f
- Update to 1.79.
dd7b18f
7d543fe
* Sun Apr 09 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.78-1
7d543fe
- Make cppcheck able to find its configs once again (bug 1427788).
7d543fe
- Update to 1.78.
7d543fe
baf899d
* Mon Feb 27 2017 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.77-4
baf899d
- Remove Patch2: fixed in gcc side (gcc-7.0.1-10.fc26)
baf899d
  (ref: bug 1423312)
baf899d
8f5d6be
* Fri Feb 17 2017 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.77-3
8f5d6be
- Fix FTBFS with gcc7 (bug 1423312, upstream ticket 7910)
8f5d6be
e08af06
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.77-2
e08af06
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e08af06
1121bba
* Tue Jan 31 2017 Jon Ciesla <limburgher@gmail.com> - 1.77-1
1121bba
- 1.77.
1121bba
d836748
* Mon Aug 08 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.75-1
d836748
- Update to 1.75.
d836748
b938d9b
* Tue Aug 02 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.74-2
b938d9b
- Re-enable tests on x86.
b938d9b
fb95062
* Mon Aug 01 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.74-1
fb95062
- Update to 1.74.
fb95062
82a9d99
* Sun May 22 2016 Rich Mattes <richmattes@gmail.com> - 1.73-2
82a9d99
- Rebuild for tinyxml2-3.0.0
82a9d99
2825eff
* Sat Apr 09 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.73-1
2825eff
- Update to 1.73.
2825eff
a56e282
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.71-2
a56e282
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a56e282
c9046e0
* Sat Nov 14 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.71-1
c9046e0
- Update to 1.71.
c9046e0
52e16fb
* Fri Nov 13 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.70-4
52e16fb
- Link whole archive (BZ #1280242), patch by Mamoru Tasaka.
bbcef80
- Compile and run tests using CMake.
52e16fb
a6ff2e0
* Wed Nov 11 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.70-3
a6ff2e0
- Enable HAVE_RULES.
a6ff2e0
19d3766
* Thu Nov 5 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.70-2
19d3766
- Include GUI (BZ #1278318).
19d3766
e4571d4
* Mon Sep 21 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.70-1
e4571d4
- Update to 1.70.
e4571d4
70cab1a
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.68-3
70cab1a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
70cab1a
ec8444f
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.68-2
ec8444f
- Rebuilt for GCC 5 C++11 ABI change
ec8444f
1e71254
* Sat Jan 03 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.68-1
1e71254
- Update to 1.68.
1e71254
979c484
* Mon Dec 01 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.67-1
979c484
- Update to 1.67.
979c484
a2f284c
* Sat Aug 23 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.66-1
a2f284c
- Update to 1.66.
a2f284c
b46ffee
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.65-3
b46ffee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
b46ffee
84ba41c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.65-2
84ba41c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
84ba41c
c43292a
* Tue May 13 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.65-1
c43292a
- Update to 1.65.
c43292a
b44144f
* Wed Jan 22 2014 François Cami <fcami@fedoraproject.org> - 1.63-3
b44144f
- Add HAVE_RULES=yes (#1056733).
b44144f
199180e
* Tue Jan 07 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.63-2
199180e
- Include cfg files as well.
199180e
e8ede0a
* Tue Jan 07 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.63-1
e8ede0a
- Update to 1.63.
e8ede0a
826a661
* Sun Oct 13 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.62-1
826a661
- Update to 1.62.
826a661
ad51908
* Sat Aug 10 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.61-1
ad51908
- Update to 1.61.
ad51908
192c4f2
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.60.1-2
192c4f2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
192c4f2
bd2c5bc
* Mon Jun 03 2013 François Cami <fcami@fedoraproject.org> - 1.60.1-1
bd2c5bc
- Update to 1.60.1.
bd2c5bc
1331bca
* Mon Apr 01 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.59-1
1331bca
- Update to 1.59.
1331bca
2483d96
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.58-2
2483d96
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2483d96
c943825
* Sun Jan 13 2013 François Cami <fcami@fedoraproject.org> - 1.58-1
c943825
- Update to 1.58.
c943825
a7dee13
* Tue Sep 18 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.57-1
a7dee13
- Update to 1.57.
a7dee13
7839e1e
* Tue Sep 18 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.56-1
7839e1e
- Update to 1.56.
7839e1e
3fec5d1
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.55-2
3fec5d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3fec5d1
b4fb2ce
* Tue Jul 10 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.55-1
b4fb2ce
- Update to 1.55.
b4fb2ce
c0488c2
* Sun Apr 15 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.54-1
c0488c2
- Update to 1.54.
c0488c2
4950016
* Sat Feb 11 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.53-1
4950016
- Update to 1.53.
4950016
0241ca4
* Thu Jan 05 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.52-2
0241ca4
- Add missing includes (fix FTBFS in rawhide).
0241ca4
a9052bd
* Sun Dec 11 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.52-1
a9052bd
- Update to 1.52.
a9052bd
5165102
* Wed Oct 26 2011 Ville Skyttä <ville.skytta@iki.fi> - 1.51-2
5165102
- Include man page and more other docs.
5165102
- Build with $RPM_LD_FLAGS.
5165102
- Improve summary and description.
5165102
07c17df
* Sun Oct 09 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.51-1
07c17df
- Update to 1.51.
07c17df
c99f4ad
* Fri Aug 19 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.50-2
c99f4ad
- Fix build on EPEL-4.
c99f4ad
ec4b373
* Sun Aug 14 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.50-1
ec4b373
- Update to 1.50.
ec4b373
66f27f4
* Mon Jun 13 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.49-1
66f27f4
- Update to 1.49.
66f27f4
3edc4fb
* Sat Apr 30 2011 Ville Skyttä <ville.skytta@iki.fi> - 1.48-2
3edc4fb
- Build with system tinyxml and support for rules.
3edc4fb
- Run test suite during build, don't include its sources in docs.
3edc4fb
- Drop readme.txt from docs, it doesn't contain useful info after installed.
3edc4fb
ba6e1d3
* Fri Apr 15 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.48-1
ba6e1d3
- Update to 1.48.
ba6e1d3
746669a
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.47-2
746669a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
746669a
05c3775
* Mon Feb 07 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.47-1
05c3775
- Update to 1.47.
05c3775
7b0f564
* Thu Dec 30 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.46.1-1
7b0f564
- Update to 1.46.1.
7b0f564
9a43d50
* Wed Dec 15 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.46-1
9a43d50
- Update to 1.46.
9a43d50
9268f9f
* Mon Oct 4 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.45-1
9268f9f
- Update to 1.45.
9268f9f
9407102
* Sat Jul 24 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.44-1
9407102
- Update to 1.44.
9407102
04f6a9f
* Sun May 9 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.43-1
04f6a9f
- Update to 1.43.
04f6a9f
3011d50
* Wed Mar 10 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.42-1
3011d50
- Update to 1.42.
3011d50
3e13dbe
* Mon Jan 18 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.40-1
3e13dbe
- Update to 1.40.
3e13dbe
fa69a69
* Sun Dec 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.39-1
fa69a69
- Update to 1.39.
fa69a69
c259711
* Sat Nov 07 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.38-1
c259711
- Update to 1.38.
c259711
3cd029b
* Tue Sep 22 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.36-1
3cd029b
- Update to 1.36.
3cd029b
6d50dff
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.34-2
6d50dff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
6d50dff
3cd029b
* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.34-1
632af98
- Update to 1.34.
632af98
3cd029b
* Mon Apr 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.31-1
19bffcf
- First release.