cppcheck/cppcheck.spec
cherry530 e211c1324f Upgrade 2.11.1
Signed-off-by: cherry530 <707078654@qq.com>
2023-07-25 09:13:02 +08:00

85 lines
2.7 KiB
RPMSpec

Name: cppcheck
Version: 2.11.1
Release: 1
Summary: Tool for static C/C++ code analysis
License: GPL-3.0
URL: http://cppcheck.wiki.sourceforge.net/
Source0: https://github.com/danmar/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0000: cppcheck-2.2-translations.patch
Patch0001: cppcheck-2.11.1-versions.patch
BuildRequires: gcc-c++ pcre-devel docbook-style-xsl libxslt cmake desktop-file-utils tinyxml2-devel >= 2.1.0
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-linguist
Requires: python3-pygments python3-unversioned-command
Provides: %{name}-htmlreport = %{version}-%{release}
Obsoletes: %{name}-htmlreport < %{version}-%{release}
%description
Cppcheck is a static analysis tool for C/C++ code.
Cppcheck primarily detects only real errors in the code (i.e. have zero false positives)
instead of syntax errors which C/C++ compilers and many other analysis tools detect commonly.
%package help
Summary: Documentation for cppcheck
%description help
Documentation for cppcheck
%prep
%autosetup -p1
rm -r externals/tinyxml2
cd gui/help
qhelpgenerator-qt5 online-help.qhcp -o online-help.qhc
%build
%make_build 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-ja.docbook
mkdir objdir-%{_target_platform}
cd objdir-%{_target_platform}
%cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=1 -DUSE_MATCHCOMPILER=yes -DBUILD_GUI=0 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=1 -DCFGDIR=%{_datadir}/CppCheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF
%make_build
%install
%make_install -C objdir-%{_target_platform}
install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
%check
cd objdir-%{_target_platform}/bin
./testrunner -g -q
%files
%doc AUTHORS COPYING
%{_datadir}/Cppcheck/
%{_bindir}/cppcheck
%{_bindir}/cppcheck-htmlreport
%exclude %{_libdir}/*
%exclude %{_usrsrc}/*
%files help
%doc man/manual.html
%{_mandir}/man1/cppcheck.1*
%changelog
* Tue Jul 25 2023 xu_ping <707078654@qq.com> - 2.11.1-1
- Upgrade to version 2.11.1.
* Tue Jan 18 2022 SimpleUpdate Robot <tc@openeuler.org> - 2.6.3-1
- Upgrade to version 2.6.3
* Tue Aug 10 2021 Shenmei Tu <tushenmei@huawei.com> - 1.83-8
- bugfix-SIGSTKSZ-not-constant.patch
* Thu Mar 04 2021 maminjie <maminjie1@huawei.com> - 1.83-7
- Add requires python3-unversioned-command to resolve compatibility
* Fri Sep 11 2020 wutao <wutao61@huawei.com> - 1.83-6
- change requires to python3
* Mon Nov 18 2019 lihao <lihao129@huawei.com> - 1.83-5
- Package Init