From eabda835d588c99b2aa85ef1fceb0192d342b98d Mon Sep 17 00:00:00 2001 From: Benjamin Nied Date: Sun, 30 Dec 2018 08:23:33 -0800 Subject: [PATCH] fish.spec: switch to using a common rpm macro CentOS 7 does not have rhel_version as one of its macros, so trying to build results in CMake errors, since we get `cmake` instead of `cmake3`. These additional conditions allow the spec to build successfully on CentOS 7. Using %rhel should allow one set of conditionals to work across CentOS 7 and RHEL 7. This has been tested on both. --- fish.spec.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fish.spec.in b/fish.spec.in index ed0640808..1793ae48d 100644 --- a/fish.spec.in +++ b/fish.spec.in @@ -11,13 +11,13 @@ URL: https://fishshell.com/ Source0: %{name}_@VERSION@.orig.tar.gz BuildRequires: ncurses-devel gettext gcc-c++ autoconf -%if 0%{?rhel_version} && 0%{?rhel_version} && 0%{?rhel_version} < 800 +%if 0%{?rhel} < 8 BuildRequires: cmake3 %else BuildRequires: cmake %endif -%if 0%{?opensuse_bs} && 0%{?rhel_version} && 0%{?rhel_version} < 700 +%if 0%{?opensuse_bs} && 0%{?rhel} < 7 BuildRequires: gcc48 gcc48-c++ %endif @@ -40,7 +40,7 @@ is simple but incompatible with other shell languages. %setup -q -n %{name}-@VERSION@ %build -%if 0%{?opensuse_bs} && 0%{?rhel_version} && 0%{?rhel_version} < 700 +%if 0%{?opensuse_bs} && 0%{?rhel} < 7 export CC=gcc48 export CXX=g++48 EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo" @@ -54,7 +54,7 @@ export CXXFLAGS="$CXXFLAGS -march=i686" EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF" # CMake macros define the wrong sysconfdir arguments EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}" -%if 0%{?rhel_version} && 0%{?rhel_version} < 800 +%if 0%{?rhel} < 8 %cmake3 $EXTRA_CMAKE_FLAGS %else %cmake $EXTRA_CMAKE_FLAGS