如何.rpm根据_foobar是否设置定义有条件地包含文件?定义_foobar将包含构建根目录内的绝对路径。文件在那里。
根据文档,我希望以下工作(注意:本%files节中有更多文件,但这是要点):
%files
%if %{_foobar}
%{_foobar}
%endif
但是,这给了我错误:
error: parse error in expression
error: /path/to/specfile:LINENO: parseExpressionBoolean returns -1
其中/path/to/specfile:LINENO是.spec文件的路径和带有 . 的行的行号%if。