fish.spec: check if %rhel is defined before expanding.

Work on #5446.
This commit is contained in:
David Adam 2019-01-05 20:27:06 +08:00
parent 40fa3c21f0
commit f4790a8767

View file

@ -11,13 +11,13 @@ URL: https://fishshell.com/
Source0: %{name}_@VERSION@.orig.tar.gz Source0: %{name}_@VERSION@.orig.tar.gz
BuildRequires: ncurses-devel gettext gcc-c++ autoconf BuildRequires: ncurses-devel gettext gcc-c++ autoconf
%if 0%{?rhel} < 8 %if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: cmake3 BuildRequires: cmake3
%else %else
BuildRequires: cmake BuildRequires: cmake
%endif %endif
%if 0%{?opensuse_bs} && 0%{?rhel} < 7 %if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: gcc48 gcc48-c++ BuildRequires: gcc48 gcc48-c++
%endif %endif
@ -47,7 +47,7 @@ is simple but incompatible with other shell languages.
%setup -q -n %{name}-@VERSION@ %setup -q -n %{name}-@VERSION@
%build %build
%if 0%{?opensuse_bs} && 0%{?rhel} < 7 %if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
export CC=gcc48 export CC=gcc48
export CXX=g++48 export CXX=g++48
EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo" EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo"
@ -61,7 +61,7 @@ export CXXFLAGS="$CXXFLAGS -march=i686"
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF" EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF"
# CMake macros define the wrong sysconfdir arguments # CMake macros define the wrong sysconfdir arguments
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}" EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}"
%if 0%{?rhel} < 8 %if 0%{?rhel} && 0%{?rhel} < 8
%cmake3 $EXTRA_CMAKE_FLAGS %cmake3 $EXTRA_CMAKE_FLAGS
%else %else
%cmake $EXTRA_CMAKE_FLAGS %cmake $EXTRA_CMAKE_FLAGS