https://bugzilla.redhat.com/show_bug.cgi?id=2168255
--- Comment #4 from Ondrej Mosnáček omosnacek@gmail.com --- +1 to Neil's comments, with one note:
(In reply to Neal Gompa from comment #3)
%if 0%{?rhel} == 7 %{configure} --without-check %else %{configure} %endif
You should be able to just use "%configure" here, since you always have check available in the build environment (even in EL7).
Looking at the sources, you probably want to conditionalize the inclusion of "BuildRequires: check-devel" and "BuildRequires: check". That may give you the same effect.
Plain %configure unfortunately fail in an epel-7 chroot. Probably the check in RHEL-7 is too old...
Still, I would suggest to rewrite the conditionals like this (or similar), so that the RHEL-7 check is in one place & it's possible to build --with/--without tests locally for debugging:
diff --git a/selint/selint.spec b/selint/selint.spec index 9616554f3e0a6cf5aca8104e142b07b3d81a22ea..58334077c80357573305b5ca9577abcb319b0e6b 100644 --- a/selint/selint.spec +++ b/selint/selint.spec @@ -1,5 +1,12 @@ # % global selint_pre_ver rc
+# RHEL-7 has too old check +%if 0%{?rhel} <= 7 +%bcond_with tests +%else +%bcond_without tests +%endif + Summary: Static code analysis tool for SELinux policy source files Name: selint Version: 1.4.0 @@ -8,11 +15,9 @@ URL: https://github.com/SELinuxProject/selint License: ASL 2.0 Source: https://github.com/SELinuxProject/selint/releases/download/v%%7Bversion%7D%%...
-BuildRequires: autoconf autoconf-archive automake bison check check-devel flex gcc help2man libconfuse libconfuse-devel uthash-devel -# pkgconfig -Requires: libconfuse -%if 0%{?fedora} || 0%{?rhel} >= 8 -Requires: check +BuildRequires: autoconf autoconf-archive automake bison flex gcc help2man libconfuse-devel uthash-devel +%if %{with tests} +BuildRequires: check-devel %endif
%description @@ -29,10 +34,10 @@ challenging policy issues. %build # autogen.sh autoreconf -fiv -Wall -Wno-portability -%if 0%{?rhel} == 7 -%{configure} --without-check -%else +%if %{with tests} %{configure} +%else +%{configure} --without-check %endif
%{make_build} @@ -40,7 +45,10 @@ autoreconf -fiv -Wall -Wno-portability %install %{make_install}
+%if %{with tests} %check +%make_build check +%endif
%files %license LICENSE