templates: fix stripping +build metadata from crate versions
This commit is contained in:
parent
15facc465b
commit
539033b196
1 changed files with 9 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
%global crate {{ crate_name }}
|
||||
{% if crate_version != rpm_version %}
|
||||
&global crate_version {{ crate_version }}
|
||||
%global crate_version {{ crate_version }}
|
||||
{% endif %}
|
||||
|
||||
Name: {{ rpm_name }}
|
||||
|
@ -30,7 +30,11 @@ License: {{ rpm_license|default("# FIXME") }}
|
|||
{{ rpm_license_comments }}
|
||||
{% endif %}
|
||||
URL: https://crates.io/crates/{{ crate_name }}
|
||||
{% if crate_version == rpm_version %}
|
||||
Source: %{crates_source}
|
||||
{% else %}
|
||||
Source: %{crates_source %{crate} %{crate_version}}
|
||||
{% endif %}
|
||||
{% if rpm_patch_file_automatic is not none %}
|
||||
# Automatically generated patch to strip foreign dependencies
|
||||
Patch: {{ rpm_patch_file_automatic }}
|
||||
|
@ -168,7 +172,11 @@ use {% if feature is not none %}the "{{ feature }}" feature of {% endif %}the "%
|
|||
{% endif -%}
|
||||
|
||||
%prep
|
||||
{% if crate_version == rpm_version %}
|
||||
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
||||
{% else %}
|
||||
%autosetup -n %{crate}-%{crate_version} -p1
|
||||
{% endif %}
|
||||
%cargo_prep
|
||||
|
||||
{% if not include_build_requires %}
|
||||
|
|
Loading…
Reference in a new issue