- Use %cmake_build and %cmake_install macros to fix FTBFS (#1863368)
- Rearrange BuildRequires:
  Put qt5-qtbase-devel and qt5-linguist inside if %{gui}
  Move cmake, python3-devel and z3-devel out of if %{gui}
This commit is contained in:
Wolfgang Stöggl 2020-08-04 19:28:32 +02:00
parent c2bf8eebba
commit def5035db3

View File

@ -3,7 +3,7 @@
Name: cppcheck Name: cppcheck
Version: 2.1 Version: 2.1
Release: 5%{?dist} Release: 6%{?dist}
Summary: Tool for static C/C++ code analysis Summary: Tool for static C/C++ code analysis
License: GPLv3+ License: GPLv3+
URL: http://cppcheck.wiki.sourceforge.net/ URL: http://cppcheck.wiki.sourceforge.net/
@ -21,16 +21,16 @@ BuildRequires: pcre-devel
BuildRequires: docbook-style-xsl BuildRequires: docbook-style-xsl
BuildRequires: libxslt BuildRequires: libxslt
BuildRequires: pandoc BuildRequires: pandoc
BuildRequires: cmake
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: tinyxml2-devel >= 2.1.0 BuildRequires: tinyxml2-devel >= 2.1.0
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: qt5-qtbase-devel BuildRequires: python3-devel
BuildRequires: qt5-linguist BuildRequires: z3-devel >= 4.7.1
%if %{gui} %if %{gui}
BuildRequires: python3-devel BuildRequires: qt5-qtbase-devel
BuildRequires: cmake BuildRequires: qt5-linguist
BuildRequires: z3-devel >= 4.7.1
%else %else
Obsoletes: %{name}-gui < %{version}-%{release} Obsoletes: %{name}-gui < %{version}-%{release}
%endif %endif
@ -75,16 +75,13 @@ pandoc man/manual.md -o man/manual.html -s --number-sections --toc
pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc
# Binaries # Binaries
mkdir objdir-%{_target_platform}
cd objdir-%{_target_platform}
# Upstream doesn't support shared libraries (unversioned solib) # Upstream doesn't support shared libraries (unversioned solib)
%cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=%{gui} -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck %cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=%{gui} -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck
# SMP make doesn't seem to work %cmake_build
make cppcheck
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
make -C objdir-%{_target_platform} DESTDIR=%{buildroot} install %cmake_install
install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1 install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1
%if %{gui} %if %{gui}
@ -99,7 +96,7 @@ install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppch
%check %check
cd objdir-%{_target_platform}/bin cd %{_vpath_builddir}/bin
./testrunner -g -q ./testrunner -g -q
%files %files
@ -122,6 +119,9 @@ cd objdir-%{_target_platform}/bin
%{_bindir}/cppcheck-htmlreport %{_bindir}/cppcheck-htmlreport
%changelog %changelog
* Tue Aug 04 2020 Wolfgang Stöggl <c72578@yahoo.de> - 2.1-6
- Fix FTBFS #1863368
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-5 * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-5
- Second attempt - Rebuilt for - Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild