Gui package is always built.

This commit is contained in:
Susi Lehtola 2020-08-18 12:42:08 +02:00
parent def5035db3
commit 563456da8e
1 changed files with 6 additions and 18 deletions

View File

@ -1,9 +1,6 @@
# Gui built in all branches
%global gui 1
Name: cppcheck Name: cppcheck
Version: 2.1 Version: 2.1
Release: 6%{?dist} Release: 7%{?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/
@ -27,13 +24,9 @@ BuildRequires: tinyxml2-devel >= 2.1.0
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: z3-devel >= 4.7.1 BuildRequires: z3-devel >= 4.7.1
%if %{gui}
BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-linguist BuildRequires: qt5-linguist
%else
Obsoletes: %{name}-gui < %{version}-%{release}
%endif
%description %description
Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++ Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++
@ -42,14 +35,12 @@ 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 the compilers normally do not detect. The goal is to detect only real
errors in the code (i.e. have zero false positives). errors in the code (i.e. have zero false positives).
%if %{gui}
%package gui %package gui
Summary: Graphical user interface for cppcheck Summary: Graphical user interface for cppcheck
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
%description gui %description gui
This package contains the graphical user interface for cppcheck. This package contains the graphical user interface for cppcheck.
%endif
%package htmlreport %package htmlreport
Summary: HTML reporting for cppcheck Summary: HTML reporting for cppcheck
@ -76,25 +67,21 @@ pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-
# Binaries # Binaries
# 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=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck
%cmake_build %cmake_build
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
%cmake_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}
# Install desktop file # Install desktop file
desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop
# Install logo # Install logo
install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png
%endif
# Install htmlreport # Install htmlreport
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
%check %check
cd %{_vpath_builddir}/bin cd %{_vpath_builddir}/bin
./testrunner -g -q ./testrunner -g -q
@ -106,19 +93,20 @@ cd %{_vpath_builddir}/bin
%{_bindir}/cppcheck %{_bindir}/cppcheck
%{_mandir}/man1/cppcheck.1* %{_mandir}/man1/cppcheck.1*
%if %{gui}
%files gui %files gui
%{_bindir}/cppcheck-gui %{_bindir}/cppcheck-gui
%{_datadir}/applications/cppcheck-gui.desktop %{_datadir}/applications/cppcheck-gui.desktop
%{_datadir}/pixmaps/cppcheck-gui.png %{_datadir}/pixmaps/cppcheck-gui.png
%{_datadir}/icons/hicolor/64x64/apps/cppcheck-gui.png %{_datadir}/icons/hicolor/64x64/apps/cppcheck-gui.png
%{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg %{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg
%endif
%files htmlreport %files htmlreport
%{_bindir}/cppcheck-htmlreport %{_bindir}/cppcheck-htmlreport
%changelog %changelog
* Tue Aug 18 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1-7
- Gui package is always built.
* Tue Aug 04 2020 Wolfgang Stöggl <c72578@yahoo.de> - 2.1-6 * Tue Aug 04 2020 Wolfgang Stöggl <c72578@yahoo.de> - 2.1-6
- Fix FTBFS #1863368 - Fix FTBFS #1863368