{% macro describe_source(source_type_text, source_json_dict, is_package=False) %}
Source Type:
{% if is_package and (source_type_text == "link" or source_type_text == "upload") %}
No default source
{# source types link & upload only make sense for builds, not for packages #} {% else %}
{{ source_type_text | build_source_description }}
{% endif %} {% if source_type_text == "link" and not is_package %}
Package URL:
{{ source_json_dict["url"] }}
{% elif source_type_text == "upload" and not is_package %}
File Name:
{{ source_json_dict["pkg"] }}
{% elif source_type_text == "scm" %}
SCM type:
{{ source_json_dict["type"] }}
Clone URL:
{{ source_json_dict["clone_url"] }}
{% if source_json_dict["committish"] %}
Committish:
{{ source_json_dict["committish"] }}
{% endif %} {% if source_json_dict["subdirectory"] %}
Subdirectory:
{{ source_json_dict["subdirectory"] }}
{% endif %} {% if source_json_dict["spec"] %}
Path to .spec file:
{{ source_json_dict["spec"] }}
{% endif %} {% if source_json_dict["srpm_build_method"] %}
Build SRPM with:
{{ source_json_dict["srpm_build_method"] }}
{% endif %} {% elif source_type_text == "pypi" %}
PyPI package name
{{ source_json_dict["pypi_package_name"] }}
{% if source_json_dict["pypi_package_version"] %}
PyPI package version
{{ source_json_dict["pypi_package_version"] }}
{% endif %} {% if source_json_dict["spec_generator"] %}
Spec generator
{{ source_json_dict["spec_generator"] }}
{% endif %} {# These options are not available for pyp2spec #} {% if source_json_dict["spec_generator"] == "pyp2rpm" %} {% if source_json_dict["spec_template"] %}
Spec template
{{ source_json_dict["spec_template"] }}
{% endif %}
for Python
{{ ', '.join(source_json_dict["python_versions"]).strip(', ') }}
{% endif %} {% endif %} {% if source_type_text == "rubygems" %}
Gem name:
{{ source_json_dict["gem_name"] }}
{% endif %} {% if source_type_text == "distgit" %} {% for info in ["distgit", "committish", "clone_url"] %} {% if source_json_dict.get(info) %}
{{ info.title() }}:
{{ source_json_dict[info] }}
{% endif %} {% endfor %} {% endif %} {% endmacro %}