diff --git a/data/macros.cargo b/data/macros.cargo index 07fcb56..edc2f56 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -10,6 +10,8 @@ %cargo_registry %{_datadir}/cargo/registry +%crate_instdir %{cargo_registry}/%{crate}-%{version_no_tilde} + %__cargo_is_lib() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F -x "$(printf 'lib\\\nrlib\\\nproc-macro')" %__cargo_is_bin() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F -x bin diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec index 77e61a4..68d8309 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec @@ -43,7 +43,7 @@ Patch0: {{ patch_file }} ExclusiveArch: %{rust_arches} -BuildRequires: rust-packaging +BuildRequires: rust-packaging >= 21 {% if all_features %} {% set cargo_args = " -a" %} {% endif %} @@ -160,9 +160,9 @@ use {% if feature is not none %}the "{{ feature }}" feature of {% endif %}the "% {% if license_files|length > 0 %} %license {{ license_files|join(' ') }} {% endif %} -%{cargo_registry}/%{crate}-%{version_no_tilde}/ +%{crate_instdir}/ {% else %} -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml {% endif %} {% endfor %}