77 lines
2.4 KiB
RPMSpec
77 lines
2.4 KiB
RPMSpec
%if 0%{?rhel} || 0%{?epel}
|
|
# RHEL/EPEL: Use bundled deps as it doesn't ship Rust libraries
|
|
%global bundled_rust_deps 1
|
|
%else
|
|
# Fedora: Could use system Rust libraries, but we use vendored for simplicity
|
|
%global bundled_rust_deps 1
|
|
%endif
|
|
|
|
# GitHub tag doesn't use tilde, map it here
|
|
%global upstream_version 0.1.0
|
|
|
|
Name: clevis-pin-trustee
|
|
Version: %{upstream_version}
|
|
Release: %autorelease
|
|
Summary: Clevis PIN for Trustee attestation
|
|
|
|
License: MIT
|
|
URL: https://github.com/latchset/%{name}
|
|
Source0: https://github.com/latchset/%{name}/archive/refs/tags/v%{upstream_version}.tar.gz#/%{name}-%{upstream_version}.tar.gz
|
|
# The vendor tarball is created using cargo-vendor-filterer to remove Windows
|
|
# related files (https://github.com/cgwalters/cargo-vendor-filterer)
|
|
# tar xzf %%{name}-%%{version}.tar.gz
|
|
# cd %%{name}-%%{version}
|
|
# cargo vendor-filterer --platform x86_64-unknown-linux-gnu \
|
|
# --platform powerpc64le-unknown-linux-gnu \
|
|
# --platform aarch64-unknown-linux-gnu \
|
|
# --platform i686-unknown-linux-gnu \
|
|
# --platform s390x-unknown-linux-gnu
|
|
# --prefix=vendor --format=tar.zstd
|
|
# Rename the vendor.tar.zstd tarball to clevis-pin-trustee-%%{version}-vendor.tar.zstd
|
|
Source1: %{name}-%{version}-vendor.tar.zstd
|
|
|
|
%if 0%{?bundled_rust_deps}
|
|
BuildRequires: rust-toolset
|
|
%else
|
|
BuildRequires: rust-packaging >= 25
|
|
%endif
|
|
BuildRequires: openssl-devel
|
|
|
|
# Runtime dependencies
|
|
Requires: clevis
|
|
Requires: jose
|
|
|
|
%description
|
|
clevis-pin-trustee is a Clevis PIN that implements encryption and decryption
|
|
operations using remote attestation via a Trustee server. It enables automated
|
|
unlocking of LUKS-encrypted volumes in confidential computing environments by
|
|
fetching encryption keys from Trustee servers after successful attestation.
|
|
|
|
%prep
|
|
%autosetup -n %{name}-%{upstream_version} %{?bundled_rust_deps:-a1}
|
|
|
|
%if 0%{?bundled_rust_deps}
|
|
%cargo_prep -v vendor
|
|
%endif
|
|
|
|
%build
|
|
%cargo_build
|
|
|
|
%install
|
|
# Install the binary from the workspace
|
|
install -D -m 0755 target/release/clevis-pin-trustee %{buildroot}%{_bindir}/clevis-pin-trustee
|
|
|
|
# Install Clevis wrapper scripts
|
|
install -D -m 0755 clevis-encrypt-trustee %{buildroot}%{_bindir}/clevis-encrypt-trustee
|
|
install -D -m 0755 clevis-decrypt-trustee %{buildroot}%{_bindir}/clevis-decrypt-trustee
|
|
|
|
%check
|
|
%cargo_test
|
|
|
|
%files
|
|
%{_bindir}/%{name}
|
|
%{_bindir}/clevis-encrypt-trustee
|
|
%{_bindir}/clevis-decrypt-trustee
|
|
|
|
%changelog
|
|
%autochangelog
|