generate cargo vendor on prep stage

This commit is contained in:
houmingyong 2025-03-12 16:10:04 +08:00
parent 224767949e
commit 150b64134d

View File

@ -1,6 +1,6 @@
Name: secGear
Version: 0.1.0
Release: 52
Release: 53
Summary: secGear is an SDK to develop confidential computing apps based on hardware enclave features
@ -157,8 +157,20 @@ The %{name}-as is package contains attestation service
%ifnarch x86_64
cd %{_builddir}/%{name}/service/attestation/attestation-agent/
tar xf %{SOURCE1}
mkdir -p .cargo
touch .cargo/config.toml
cat << EOF >> ./.cargo/config.toml
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
cd %{_builddir}/%{name}/service/attestation/attestation-service/
tar xf %{SOURCE1}
mkdir -p .cargo
cp %{_builddir}/%{name}/service/attestation/attestation-agent/.cargo/config.toml .cargo/
%endif
%build
@ -172,22 +184,9 @@ cmake -DCMAKE_BUILD_TYPE=Debug -DENCLAVE=GP
make
cd %{_builddir}/%{name}/service/attestation/attestation-agent/
mkdir -p .cargo
touch .cargo/config.toml
cat << EOF >> ./.cargo/config.toml
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
%{_cargo} build --features virtcca-attester --bins --release
mkdir -p %{_builddir}/%{name}/service/attestation/attestation-service/.cargo/
cp %{_builddir}/%{name}/service/attestation/attestation-agent/.cargo/config.toml %{_builddir}/%{name}/service/attestation/attestation-service/.cargo/
cd %{_builddir}/%{name}/service/attestation/attestation-service/
%{_cargo} build --bins --release
%endif
%install
@ -295,6 +294,9 @@ popd
systemctl restart rsyslog
%changelog
* Wed Mar 12 2025 houmingyong<houmingyong@huawei.com> - 0.1.0-53
- generate cargo vendor on %prep stage
* Tue Nov 26 2024 houmingyong<houmingyong@huawei.com> - 0.1.0-52
- fix evidence decode typos