diff --git a/bacula.spec b/bacula.spec index d8a4ca4..55cb3f3 100644 --- a/bacula.spec +++ b/bacula.spec @@ -5,7 +5,9 @@ %global uid 133 %global username bacula -%bcond qt %[%{undefined rhel} || 0%{?rhel} < 10] +%if 0%{?rhel} <= 10 +%bcond_with qt +%endif Name: bacula Version: 13.0.4 @@ -312,6 +314,13 @@ autoconf -I autoconf/ -o configure autoconf/configure.in find updatedb -type f | xargs chmod -x %build +# Set correct build options for libs3 if not on EL10+ or Fedora: +%if 0%{?rhel} < 10 +%set_build_flags +export CFLAGS="%{optflags} -fPIC" +export CXXFLAGS="%{optflags} -fPIC" +%endif + pushd libs3-%{commit} patch -p1 -i %{SOURCE21} @@ -320,7 +329,7 @@ patch -p1 -i %{SOURCE21} popd export CFLAGS="%{optflags} -I%{_includedir}/ncurses" -export CPPFLAGS="%{optflags} -I%{_includedir}/ncurses" +export CXXFLAGS="%{optflags} -I%{_includedir}/ncurses" %if %{with qt} export PATH="$PATH:%{_qt5_bindir}" %endif