Skip to content

Commit

Permalink
bareos.spec: set ENABLE_PYTHON2=no when python2 is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jun 22, 2022
1 parent b13caee commit 9a5a309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/cmake/BareosFindAllLibraries.cmake
Expand Up @@ -46,6 +46,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
else()
if(ENABLE_PYTHON2)
find_package(Python2 COMPONENTS Interpreter Development)
else()
set(Python2_FOUND 0)
endif()
find_package(Python3 COMPONENTS Interpreter Development)

Expand Down
5 changes: 4 additions & 1 deletion core/platforms/packaging/bareos.spec
Expand Up @@ -1050,7 +1050,10 @@ cmake .. \
-Dincludes=yes \
-Ddefault_db_backend="XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" \
-Dwebuiconfdir=%{_sysconfdir}/bareos-webui \
-DVERSION_STRING=%version
-DVERSION_STRING=%version \
%if !0%{python2_available}
-DENABLE_PYTHON2=no \
%endif

#Add flags
%__make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags};
Expand Down

0 comments on commit 9a5a309

Please sign in to comment.