]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/blobdiff - macros.rust
- merged 2006 from PLD
[packages/rpm-tld-macros.git] / macros.rust
diff --git a/macros.rust b/macros.rust
new file mode 100644 (file)
index 0000000..e899292
--- /dev/null
@@ -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}