X-Git-Url: https://git.tld-linux.org/?p=packages%2Frpm-tld-macros.git;a=blobdiff_plain;f=macros.rust;fp=macros.rust;h=e8992926669874bf164e770ab03767c392e0986c;hp=0000000000000000000000000000000000000000;hb=2eb3b8233652e3dc3720c3699d7519e5ad6a6687;hpb=15821de235983981f5a9f64be847d85f7a80f81e diff --git a/macros.rust b/macros.rust new file mode 100644 index 0000000..e899292 --- /dev/null +++ b/macros.rust @@ -0,0 +1,23 @@ +%debuginforustflags -C debuginfo=%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:2}%{!?__dic_1:0}%{expand:%%undefine __dic_%{?_enable_debug_packages}} +%rpmrustflags %debuginforustflags +%rust_arches %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl + +%__cargo /usr/bin/cargo +%__cargo_common_opts -v --offline +%cargo_build \\\ + RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\ + %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\ + %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\ +%ifarch x32 \ + --target x86_64-unknown-linux-gnux32 \\\ +%endif \ +%{nil} + +%cargo_install \\\ + RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\ + %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\ + %{__cargo} %{__cargo_common_opts} install \\\ +%ifarch x32 \ + --target x86_64-unknown-linux-gnux32 \\\ +%endif \ +%{nil}