Merge branch 'master' into f27

This commit is contained in:
Vasiliy Glazov 2018-03-12 15:47:51 +03:00
commit e548ef3011
1 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,4 @@
%global enable_tests 0
Name: scram
Version: 0.16.2
Release: 1%{?dist}
@ -13,7 +14,10 @@ BuildRequires: cmake >= 3.8.0
BuildRequires: boost-devel >= 1.61.0
BuildRequires: libxml2-devel
BuildRequires: gperftools-devel
%if 0%{?enable_tests}
BuildRequires: catch-devel
BuildRequires: jemalloc-devel
%endif
BuildRequires: cmake(Qt5)
BuildRequires: cmake(Qt5Svg)
BuildRequires: cmake(Qt5LinguistTools)
@ -41,9 +45,12 @@ scram GUI.
mkdir build
pushd build
export CXXFLAGS="%{__global_compiler_flags} -I/usr/include/catch"
%cmake .. \
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=ON
%if 0%{?enable_tests}
-DBUILD_TESTING=ON \
%endif
..
%make_build
popd
@ -53,16 +60,20 @@ pushd build
popd
install -p -D -m 644 %{SOURCE1} -t %{buildroot}%{_mandir}/man1/
install -p -D -m 644 scripts/%{name} %{buildroot}%{_datadir}/bash-completion/completions/%{name}
rm %{buildroot}%{_bindir}/%{name}_tests
rm %{buildroot}%{_bindir}/%{name}gui_test*
%if 0%{?enable_tests}
rm %{buildroot}%{_bindir}/%{name}_tests
rm %{buildroot}%{_bindir}/%{name}gui_test*
%endif
sed -i '/URL/d' %{buildroot}%{_datadir}/applications/%{name}-gui.desktop
%check
mkdir build/share/%{name}
cp share/* build/share/%{name}
pushd build
./bin/%{name}_tests -e
popd
%if 0%{?enable_tests}
mkdir build/share/%{name}
cp share/* build/share/%{name}
pushd build
./bin/%{name}_tests -e
popd
%endif
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}-gui.desktop