Improve compatibility with new CMake macro

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-07-04 21:17:24 +02:00
parent 2722d9d6ae
commit a8a0affb4c
No known key found for this signature in database
GPG Key ID: 115D5AB89C5C1E1E

View File

@ -263,39 +263,33 @@ Systemd units that can periodically download package upgrades and apply them.
%prep
%autosetup -p1
mkdir build-py2
mkdir build-py3
%build
%if %{with python2}
pushd build-py2
%cmake .. -DPYTHON_DESIRED:FILEPATH=%{__python2} -DDNF_VERSION=%{version}
%make_build
make doc-man
popd
%global _vpath_builddir build-py2
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DDNF_VERSION=%{version}
%cmake_build
%cmake_build --target doc-man
%endif
%if %{with python3}
pushd build-py3
%cmake .. -DPYTHON_DESIRED:FILEPATH=%{__python3} -DDNF_VERSION=%{version}
%make_build
make doc-man
popd
%global _vpath_builddir build-py3
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DDNF_VERSION=%{version}
%cmake_build
%cmake_build --target doc-man
%endif
%install
%if %{with python2}
pushd build-py2
%make_install
popd
%global _vpath_builddir build-py2
%cmake_install
%endif
%if %{with python3}
pushd build-py3
%make_install
popd
%global _vpath_builddir build-py3
%cmake_install
%endif
%find_lang %{name}
@ -352,15 +346,13 @@ ln -sr %{buildroot}%{confdir}/vars %{buildroot}%{_sysconfdir}/yum/vars
%check
%if %{with python2}
pushd build-py2
ctest -VV
popd
%global _vpath_builddir build-py2
%ctest
%endif
%if %{with python3}
pushd build-py3
ctest -VV
popd
%global _vpath_builddir build-py3
%ctest
%endif