Improve compatibility with new CMake macro

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-07-05 19:25:19 +02:00
commit 4eb8a38640
No known key found for this signature in database
GPG key ID: 115D5AB89C5C1E1E

View file

@ -1,3 +1,4 @@
%global __cmake_in_source_build 1
%bcond_with pfring
%bcond_without hiredis
%bcond_with mongodb
@ -45,10 +46,6 @@ scanning.
%prep
%setup -q
# RHEL6 ld is too old.
%{?el6:sed -i 's|-z relro -z now||g' CMakeLists.txt}
# EL7 has 2.8.11
%{?el7:sed -i -e 's|2.8.12|2.8.11|' CMakeLists.txt}
# https://github.com/zmap/zmap/pull/332
sed -i 's|${CMAKE_C_FLAGS} ${GCCWARNINGS}|${GCCWARNINGS} ${CMAKE_C_FLAGS}|g;s|${CMAKE_EXE_LINKER_FLAGS} ${LDHARDENING}|${LDHARDENING} ${CMAKE_EXE_LINKER_FLAGS}|g' CMakeLists.txt
@ -61,16 +58,15 @@ sed -i 's|${CMAKE_C_FLAGS} ${GCCWARNINGS}|${GCCWARNINGS} ${CMAKE_C_FLAGS}|g;s|${
%if %{with hiredis}
-DWITH_REDIS=ON \
%endif
-DWITH_PFRING=OFF \
.
-DWITH_PFRING=OFF
make %{?_smp_mflags}
%cmake_build
chmod 644 -v examples/udp-probes/*
find ./examples/ -type f -exec sed -i 's/\r$//' {} \+
%install
%make_install
%cmake_install
%files
%doc AUTHORS CHANGELOG.md README.md examples/