RPM spec files can't use custom variables
Trying to use custom variables (e.g. distro_like) in a spec file fails with the following (simplified):
File "/builds/temp/openldap/.venv/lib64/python3.6/site-packages/apkg/commands/build_dep.py", line 45, in cli_build_dep
deps = build_dep(*args, **kwargs)
File "/builds/temp/openldap/.venv/lib64/python3.6/site-packages/apkg/commands/build_dep.py", line 118, in build_dep
template.path, distro=distro)
File "/builds/temp/openldap/.venv/lib64/python3.6/site-packages/apkg/pkgstyles/rpm.py", line 253, in get_build_deps_from_template
spec_text = t.render_file_content(spec_path, tvars=tvars)
File "./distro/pkg/rpm/openldap.spec", line 48, in top-level template code
{% if distro_like.match("rhel >= 9") -%}
File "/builds/temp/openldap/.venv/lib64/python3.6/site-packages/jinja2/environment.py", line 474, in getattr
return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'distro_like' is undefined
I think it's because the build_dep step doesn't use the Project() to do this like others do, not sure if that's intentional.