Can't you check that rhel is not defined and different than 0? Something like the following. It is untested as I don't have commit access; but at least fedpkg prep on the mesa clone does not give me any error.
$ git diff
diff --git a/mesa.spec b/mesa.spec
index 150a5bc..a61185c 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -302,7 +302,7 @@ export CXXFLAGS="$RPM_OPT_FLAGS"
--enable-gles1 \
--enable-gles2 \
--disable-gallium-egl \
- --with-egl-platforms=x11,drm%{!?rhel:,wayland} \
+ --with-egl-platforms=x11,drm%{!0%{?rhel}:,wayland} \
--enable-shared-glapi \
--enable-gbm \
%if %{with_hardware}
Or since you are using already the %if statements elsewhere you can add another one with the 2 different config lines, like
$ git diff
diff --git a/mesa.spec b/mesa.spec
index 150a5bc..764449a 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -302,7 +302,11 @@ export CXXFLAGS="$RPM_OPT_FLAGS"
--enable-gles1 \
--enable-gles2 \
--disable-gallium-egl \
- --with-egl-platforms=x11,drm%{!?rhel:,wayland} \
+%if 0%{?rhel}
+ --with-egl-platforms=x11,drm} \
+%else
+ --with-egl-platforms=x11,drm,wayland} \
+%endif
--enable-shared-glapi \
--enable-gbm \
%if %{with_hardware}
The packaging guidelines say that a "0" should be used when checking for conditions:
http://fedoraproject.org/wiki/Packaging:DistTagWith the old one I had to check like this (first line) for building; which is not correct anyway as the behaviour was different as well between fedpkg and rpmbuild/mock:
-%if (0%{?fedora} == 16 || 0%{?fedora} == 17) && !0%{?rhel}
+%if 0%{?fedora} == 16 || 0%{?fedora} == 17