Improve compatibility with new CMake macro

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-07-04 10:09:43 +02:00
parent bc00f0444d
commit ebd76695e4
No known key found for this signature in database
GPG Key ID: 115D5AB89C5C1E1E

View File

@ -72,24 +72,17 @@ gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%autosetup -p1 %autosetup -p1
%build %build
if test ! -e "obj"; then %cmake \
mkdir obj
fi
pushd obj
%cmake .. \
-DUNIT_TESTING=ON \ -DUNIT_TESTING=ON \
-DCLIENT_TESTING=ON \ -DCLIENT_TESTING=ON \
-DSERVER_TESTING=ON \ -DSERVER_TESTING=ON \
-DGLOBAL_CLIENT_CONFIG="%{_sysconfdir}/libssh/libssh_client.config" \ -DGLOBAL_CLIENT_CONFIG="%{_sysconfdir}/libssh/libssh_client.config" \
-DGLOBAL_BIND_CONFIG="%{_sysconfdir}/libssh/libssh_server.config" -DGLOBAL_BIND_CONFIG="%{_sysconfdir}/libssh/libssh_server.config"
%make_build VERBOSE=1 %cmake_build
popd
%install %install
make DESTDIR=%{buildroot} install/fast -C obj %cmake_install
install -d -m755 %{buildroot}%{_sysconfdir}/libssh install -d -m755 %{buildroot}%{_sysconfdir}/libssh
install -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/libssh/libssh_client.config install -m644 %{SOURCE3} %{buildroot}%{_sysconfdir}/libssh/libssh_client.config
install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/libssh/libssh_server.config install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/libssh/libssh_server.config
@ -115,9 +108,7 @@ popd
%ldconfig_scriptlets %ldconfig_scriptlets
%check %check
pushd obj %ctest
ctest --output-on-failure
popd
%files %files
%doc AUTHORS BSD ChangeLog README %doc AUTHORS BSD ChangeLog README