Skip to content

Commit

Permalink
feat:fedora rust packaging
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Paul <[email protected]>
  • Loading branch information
say-paul committed Oct 16, 2023
1 parent 20a9bbd commit 400166f
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions greenboot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 400166f

Please sign in to comment.