Skip to content

Commit a067e64

Browse files
ppisarevan-goode
authored andcommitted
spec: Consistently use CMake RPM macros
Fedora is going to move from cmake with make to cmake with ninja <https://fedoraproject.org/wiki/Changes/CMake_ninja_default>. That would break building an RPM package from our spec file because the new %cmake macro won't produce Makefiles: + /usr/bin/make -O -j4 V=1 VERBOSE=1 make: *** No targets specified and no makefile found. Stop. The fix is to use CMake RPM macros for everything, especially not executing make manually. I tested this fix with old (make-based) and new (ninja-based) cmake-rpm-macros package successfully. Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=2381038
1 parent d5c446d commit a067e64

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

libdnf.spec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pushd build-py2
204204
%endif
205205
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \
206206
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
207-
%make_build
207+
%cmake_build
208208
popd
209209
%endif
210210
# endif with python2
@@ -218,41 +218,41 @@ pushd build-py3
218218
%endif
219219
%cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \
220220
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF}
221-
%make_build
221+
%cmake_build
222222
popd
223223
%endif
224224

225225
%check
226226
%if %{with python2}
227227
pushd build-py2
228-
make ARGS="-V" test
228+
%ctest -V
229229
popd
230230
%endif
231231
%if %{with python3}
232232
# If we didn't run the general tests yet, do it now.
233233
%if %{without python2}
234234
pushd build-py3
235-
make ARGS="-V" test
235+
%ctest -V
236236
popd
237237
%else
238238
# Otherwise, run just the Python tests, not all of
239239
# them, since we have coverage of the core from the
240240
# first build
241241
pushd build-py3/python/hawkey/tests
242-
make ARGS="-V" test
242+
%ctest -V
243243
popd
244244
%endif
245245
%endif
246246

247247
%install
248248
%if %{with python2}
249249
pushd build-py2
250-
%make_install
250+
%cmake_install
251251
popd
252252
%endif
253253
%if %{with python3}
254254
pushd build-py3
255-
%make_install
255+
%cmake_install
256256
popd
257257
%endif
258258

0 commit comments

Comments
 (0)