This fixes FTBFS with missing older tss-esapi and actix-web crate dependencies. Also fixes the %autorelease fallback.
115 lines
2.7 KiB
RPMSpec
115 lines
2.7 KiB
RPMSpec
# keylime-agent-rust.spec
|
|
# Generated by rust2rpm 20
|
|
|
|
# missing dev-dependencies: wiremock
|
|
%bcond_with check
|
|
|
|
%global crate keylime_agent
|
|
%global crate_version 0.1.0
|
|
|
|
# As the latest git version uses an unreleased tss-esapi crate, we
|
|
# stick to an older version. FIXME: once the new tss-esapi crate is
|
|
# available on crates.io, update the revision to the latest
|
|
%global commit c98e381363752fd38e4ac45d0e654c76f11b02c5
|
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
|
%global commitdate 20220602
|
|
|
|
%if 0%{?rhel}
|
|
# RHEL: Use bundled deps as it doesn't ship Rust libraries
|
|
%global bundled_rust_deps 1
|
|
%else
|
|
# Fedora: Use only system Rust libraries
|
|
%global bundled_rust_deps 0
|
|
%endif
|
|
|
|
%ifarch armv7hl
|
|
# drop debuginfo generation for armv7hl OOM problems
|
|
%global rustflags_debuginfo 0
|
|
%endif
|
|
|
|
Name: keylime-agent-rust
|
|
Version: %{crate_version}~%{commitdate}git%{shortcommit}
|
|
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
|
|
Summary: Rust agent for Keylime
|
|
|
|
# Upstream license specification: Apache-2.0
|
|
#
|
|
# The build dependencies have the following licenses:
|
|
#
|
|
# 0BSD or MIT or ASL 2.0
|
|
# ASL 2.0
|
|
# ASL 2.0 or Boost
|
|
# ASL 2.0 or MIT
|
|
# ASL 2.0 with exceptions
|
|
# BSD
|
|
# MIT
|
|
# MIT or ASL 2.0
|
|
# MIT or ASL 2.0 or zlib
|
|
# MIT or zlib or ASL 2.0
|
|
# Unlicense or MIT
|
|
# zlib or ASL 2.0 or MIT
|
|
#
|
|
License: ASL 2.0 and BSD and MIT
|
|
URL: https://github.com/keylime/rust-keylime/
|
|
# The source tarball is downloaded using the following commands:
|
|
# spectool -g keylime-agent-rust.spec
|
|
Source0: %{url}/archive/%{commit}/rust-keylime-%{version}.tar.gz
|
|
# The vendor tarball is created using cargo vendor:
|
|
# tar xf rust-keylime-%%{version}.tar.gz
|
|
# cd rust-keylime-%%{version}
|
|
# cargo vendor
|
|
# tar jcf rust-keylime-%%{version}-vendor.tar.xz vendor
|
|
Source1: rust-keylime-%{version}-vendor.tar.xz
|
|
|
|
ExclusiveArch: %{rust_arches}
|
|
|
|
%if 0%{?bundled_rust_deps}
|
|
BuildRequires: rust-toolset
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: libarchive-devel
|
|
BuildRequires: tpm2-tss-devel
|
|
%else
|
|
BuildRequires: rust-packaging >= 21-2
|
|
%endif
|
|
|
|
# Virtual Provides to support swapping between Python and Rust implementation
|
|
Provides: keylime-agent
|
|
Conflicts: keylime-agent
|
|
|
|
%description
|
|
Rust agent for Keylime
|
|
|
|
%files
|
|
%license LICENSE
|
|
%doc README.md
|
|
%{_bindir}/keylime_agent
|
|
%{_bindir}/keylime_ima_emulator
|
|
|
|
%prep
|
|
%autosetup -n rust-keylime-%{commit} -p1
|
|
%if 0%{?bundled_rust_deps}
|
|
# Source1 is vendored dependencies
|
|
%cargo_prep -V 1
|
|
%else
|
|
%cargo_prep
|
|
%endif
|
|
|
|
%if !0%{?bundled_rust_deps}
|
|
%generate_buildrequires
|
|
%cargo_generate_buildrequires
|
|
%endif
|
|
|
|
%build
|
|
%cargo_build
|
|
|
|
%install
|
|
%cargo_install
|
|
|
|
%if %{with check}
|
|
%check
|
|
%cargo_test
|
|
%endif
|
|
|
|
%changelog
|
|
%autochangelog
|