From 400166fea1b0e784d2d30f0580b745f6b9e302fd Mon Sep 17 00:00:00 2001 From: Sayan Paul Date: Mon, 16 Oct 2023 11:02:12 +0000 Subject: [PATCH] feat:fedora rust packaging Signed-off-by: Sayan Paul --- greenboot.spec | 44 +++++++------------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/greenboot.spec b/greenboot.spec index ebc5cd1..14e7c02 100644 --- a/greenboot.spec +++ b/greenboot.spec @@ -27,7 +27,7 @@ Source1: %{name}-%{version}-vendor.tar.gz ExcludeArch: s390x i686 %{power64} -%if 0%{?rhel} && !0%{?eln} +%if 0%{?rhel} BuildRequires: rust-toolset %else BuildRequires: rust-packaging @@ -158,44 +158,14 @@ Requires: jq %{summary}. %prep -%forgeautosetup -%if ! 0%{?with_packit} -tar xvf %{SOURCE1} -%endif -%if ! 0%{?with_bundled} -%cargo_prep -%else -mkdir -p .cargo -cat >.cargo/config << EOF -[build] -rustc = "%{__rustc}" -rustdoc = "%{__rustdoc}" -%if 0%{?rhel} && !0%{?eln} -rustflags = %{__global_rustflags_toml} -%else -rustflags = "%{__global_rustflags_toml}" -%endif - -[profile.rpm] -inherits = "release" - -[install] -root = "%{buildroot}%{_prefix}" - -[term] -verbose = true - -[source.crates-io] -replace-with = "vendored-sources" - -[source.vendored-sources] -directory = "vendor" -EOF -%endif +%autosetup -p1 -n %{name}-rs-%{version} -%if ! 0%{?with_bundled} +%if 0%{?rhel} +%cargo_prep -V 1 +%else +%cargo_prep %generate_buildrequires -%cargo_generate_buildrequires +%cargo_generate_buildrequires -a %endif %build