Skip to content

Commit

Permalink
rpm/fedora: Update rust macro usage
Browse files Browse the repository at this point in the history
Changes based on patch by Yaakov Selkowitz on Fedora

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
  • Loading branch information
ansasaki committed Jun 7, 2024
1 parent 0aad36e commit 8c8abd0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions rpm/fedora/keylime-agent-rust.spec
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,11 @@ Conflicts: keylime-agent
Rust agent for Keylime

%prep
%autosetup -n rust-keylime-%{version} -N
%autosetup -n rust-keylime-%{version} -N %{?bundled_rust_deps:-a1}
%if 0%{?bundled_rust_deps}
%autopatch -m 100 -p1
# Source1 contains vendored dependencies
%cargo_prep
tar -xoaf %{SOURCE1}
sed -i 's/^\(replace-with\).*$/\1 = "vendored-sources"/g' .cargo/config
cat >> .cargo/config << EOF
[source.vendored-sources]
directory = "./vendor"
EOF

%cargo_prep -v vendor
%cargo_generate_buildrequires
%else
%autopatch -M 99 -p1
Expand All @@ -102,6 +94,11 @@ EOF

%build
%cargo_build -ftesting
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies
%if 0%{?bundled_rust_deps}
%cargo_vendor_manifest
%endif

%install

Expand Down Expand Up @@ -149,6 +146,8 @@ chown -R keylime:keylime %{_sysconfdir}/keylime

%files
%license LICENSE
%license LICENSE.dependencies
%license cargo-vendor.txt
%doc README.md
%attr(500,keylime,keylime) %dir %{_sysconfdir}/keylime
%attr(500,keylime,keylime) %dir %{_sysconfdir}/keylime/agent.conf.d
Expand Down

0 comments on commit 8c8abd0

Please sign in to comment.