diff --git a/data/macros.cargo b/data/macros.cargo index 67372fa..f4fa071 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -4,8 +4,8 @@ %cargo_registry %{_usrsrc}/rust -%__cargo_is_lib() %{expand:%__cargo_inspector --target-kinds Cargo.toml | grep -q -F lib} -%__cargo_is_bin() %{expand:%__cargo_inspector --target-kinds Cargo.toml | grep -q -F bin} +%__cargo_is_lib() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F "$(printf 'lib\\\nproc-macro')" +%__cargo_is_bin() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F bin %cargo_prep (\ set -eu \ diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 0008c31..ced1092 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -221,7 +221,7 @@ def main(): kwargs = {} bins = [tgt for tgt in metadata.targets if tgt.kind == "bin"] - libs = [tgt for tgt in metadata.targets if tgt.kind == "lib"] + libs = [tgt for tgt in metadata.targets if tgt.kind in ("lib", "proc-macro")] is_bin = len(bins) > 0 is_lib = len(libs) > 0 if is_bin: