Generate the vendor tarball based on Fedora packages:
dnf install <all dependencies>
rpm -E '%{cargo_prep}' > cargo_prep.sh
bash cargo_prep.sh
cargo vendor --offline --respect-source-config
tar cf vendor.tar vendor/
xz --best vendor.tar.xz
mv vendor.tar.xz <dir>/<vendor-tarball-long-name>
Resolves: RHEL-73770
156 lines
5.2 KiB
RPMSpec
156 lines
5.2 KiB
RPMSpec
# Generated by rust2rpm 27
|
|
%bcond check 1
|
|
|
|
%global commit 0061d036509e451597f5f61492b41849b36a32a1
|
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
|
# numcommits is taken from git describe --tags <commit> (num commits s
|
|
%global numcommits 124
|
|
%global projectname guest-components
|
|
|
|
Name: trustee-guest-components
|
|
Version: 0.10.0^%{numcommits}.git%{shortcommit}
|
|
Release: 2%{?dist}
|
|
Summary: Tools that run in confidential VMs, attest and get secrets from Trustee
|
|
|
|
# License lines copied from the build
|
|
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
|
|
# Apache-2.0
|
|
# Apache-2.0 OR BSL-1.0
|
|
# Apache-2.0 OR ISC OR MIT
|
|
# Apache-2.0 OR MIT
|
|
# BSD-2-Clause OR Apache-2.0 OR MIT
|
|
# ISC
|
|
# MIT
|
|
# MIT OR Apache-2.0
|
|
# MIT OR Apache-2.0 OR Zlib
|
|
# MPL-2.0
|
|
# Unlicense OR MIT
|
|
# Zlib OR Apache-2.0 OR MIT
|
|
|
|
# License lines above, but sorted within and between lines
|
|
# Apache-2.0
|
|
# Apache-2.0 OR BSD-2-Clause OR MIT
|
|
# Apache-2.0 OR BSL-1.0
|
|
# Apache-2.0 OR ISC OR MIT
|
|
# Apache-2.0 OR MIT
|
|
# Apache-2.0 OR MIT
|
|
# Apache-2.0 OR MIT OR Zlib
|
|
# Apache-2.0 OR MIT OR Zlib
|
|
# ISC
|
|
# MIT
|
|
# MIT OR Unlicense
|
|
# MPL-2.0
|
|
# (Apache-2.0 OR MIT) AND Unicode-DFS-2016
|
|
|
|
|
|
License: Apache-2.0 AND (Apache-2.0 OR BSD-2-Clause OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND ISC AND MIT AND (MIT OR Unlicense) AND MPL-2.0 AND Unicode-DFS-2016
|
|
|
|
# LICENSE.dependencies contains a full license breakdown
|
|
|
|
URL: https://github.com/confidential-containers/guest-components
|
|
Source: https://github.com/confidential-containers/%{projectname}/archive/%{commit}/%{projectname}-%{shortcommit}.tar.gz
|
|
|
|
|
|
# Creating vendor tar (on latest Fedora):
|
|
# dnf install <all dependencies>
|
|
# rpm -E '% { cargo_prep}' > cargo_prep.sh
|
|
# bash cargo_prep.sh
|
|
# cargo vendor --offline --respect-source-config
|
|
# tar cf vendor.tar vendor/
|
|
# xz --best vendor.tar.xz
|
|
# mv vendor.tar.xz <dir>/<vendor-tarball-long-name>
|
|
Source1: %{name}-0.10.0_%{numcommits}.git%{shortcommit}-vendor.tar.xz
|
|
# * adapt to RHEL
|
|
# * Remove workspace members which are not built
|
|
Patch1: 0001-Fedora-Remove-workspace-members-which-are-not-built.patch
|
|
# * deps/crypto defaults to openssl
|
|
Patch2: 0002-Fedora-AA-deps-crypto-default-to-openssl.patch
|
|
# * use native-tls for reqwest
|
|
Patch3: 0003-Fedora-kbs_protocol-Cargo.toml-reqwest-use-native-TL.patch
|
|
# * remove dependency jwt-simple - not in Fedora
|
|
Patch4: 0004-Fedora-remove-jwt-simple-dependency.patch
|
|
# * remove dependency ttrpc - not in Fedora
|
|
Patch5: 0005-Fedora-remove-ttrpc-dependency.patch
|
|
# * pick attesters to build
|
|
Patch6: 0006-Fedora-attester-pick-attesters-in-all-attesters.patch
|
|
# * remove dependency testcontainers - not in Fedora
|
|
Patch7: 0007-Fedora-remove-testcontainers-dependency.patch
|
|
# * kbs_protocol defaults to openssl
|
|
Patch8: 0008-Fedora-kbs_protocol-default-to-openssl.patch
|
|
# * rstest version is 0.23
|
|
Patch9: 0009-Fedora-rstest-0.23.patch
|
|
# * clap version is ^4.2.7 -- see patch for more info
|
|
Patch10: 0010-Fedora-use-clap-4.2.7.patch
|
|
# * kbs-types version is 0.8.0
|
|
Patch11: 0011-Fedora-kbs-types-0.8.0.patch
|
|
# * add package.license to kbs_protocol/Cargo.toml
|
|
Patch12: 0012-Fedora-kbs_protocol-Cargo.toml-add-package.license.patch
|
|
# * url version is 2.5.2
|
|
Patch13: 0013-Fedora-url-version-is-2.5.2.patch
|
|
# * protobuf is 2.28
|
|
Patch14: 0014-Fedora-protobuf-is-2.28.patch
|
|
|
|
ExclusiveArch: x86_64
|
|
BuildRequires: rust-toolset
|
|
BuildRequires: /usr/bin/pkg-config
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: tpm2-tss-devel
|
|
|
|
|
|
%global _description %{expand:
|
|
Running in a confidential VM, gather confidential-computing evidence,
|
|
send it to Trustee and get secrets.
|
|
A part of the confidential-containers project}
|
|
|
|
%description %{_description}
|
|
|
|
%prep
|
|
%autosetup -n guest-components-0061d036509e451597f5f61492b41849b36a32a1 -p1 -a1
|
|
rm -f Cargo.lock
|
|
%cargo_prep -v vendor
|
|
|
|
%build
|
|
cd attestation-agent/kbs_protocol
|
|
%cargo_build
|
|
%{cargo_license_summary}
|
|
%{cargo_license} > LICENSE.dependencies
|
|
%{cargo_vendor_manifest}
|
|
mv LICENSE.dependencies ../../
|
|
mv cargo-vendor.txt ../../
|
|
# remove from cargo-vendor.txt dependencies that are in the source
|
|
# the path to them makes rpmbuild fail
|
|
cd ../../
|
|
sed -i '/^attester /d' cargo-vendor.txt
|
|
sed -i '/^crypto /d' cargo-vendor.txt
|
|
sed -i '/^resource_uri /d' cargo-vendor.txt
|
|
sed -i '/^sev /d' cargo-vendor.txt
|
|
|
|
%install
|
|
cd attestation-agent/kbs_protocol
|
|
mkdir -p %{buildroot}%{_docdir}/%{name}
|
|
install -m 0644 src/bin/trustee-attester/README.md %{buildroot}%{_docdir}/%{name}/trustee-attester-README.md
|
|
%cargo_install
|
|
|
|
%if %{with check}
|
|
%check
|
|
cd attestation-agent/kbs_protocol
|
|
%cargo_test
|
|
%endif
|
|
|
|
%files
|
|
%license LICENSE
|
|
%license LICENSE.dependencies
|
|
%license cargo-vendor.txt
|
|
%doc README.md
|
|
%doc trustee-attester-README.md
|
|
%{_bindir}/trustee-attester
|
|
|
|
%changelog
|
|
* Thu Feb 06 2025 Uri Lublin <uril@redhat.com> - 0.10.0^124.git0061d03-2
|
|
- A smaller vendor Source1
|
|
Resolves: RHEL-73770
|
|
|
|
* Tue Jan 21 2025 Uri Lublin <uril@redhat.com> 0.10.0^124.git0061d03-1
|
|
- Initial commit on c10s
|
|
Resolves: RHEL-73770
|