Avoid 'unexpanded macro' warning in mock srpm builds

When preparing the srpm in mock or other minimal environments, the use
of %{_emacs_version} causes a spurious warning:

  Possible unexpanded macro in: Requires: emacs-filesystem >= %{_emacs_version}

Prevent the warning with a check that the macro is defined before use.

(There is another use of %{_emacs_version}, but it only applies to EL-6
where the warning is not present.  Just ignore it.)
This commit is contained in:
Todd Zullinger 2018-10-11 15:10:03 -04:00
parent ac594c4ca5
commit 314daae243

View File

@ -221,7 +221,7 @@ Requires: perl(Term::ReadKey)
%endif # ! defined perl_bootstrap
Requires: perl-Git = %{version}-%{release}
%if %{emacs_filesystem}
%if %{emacs_filesystem} && %{defined _emacs_version}
Requires: emacs-filesystem >= %{_emacs_version}
%endif # emacs_filesystem