Build both the gnu and musl version of stratovirt
This commit is contained in:
parent
4fa795f1ff
commit
1d4fb8e74e
@ -6,7 +6,7 @@
|
||||
|
||||
Name: stratovirt
|
||||
Version: 2.2.0
|
||||
Release: 5
|
||||
Release: 6
|
||||
Summary: StratoVirt is an opensource VMM(Virtual Machine Manager) which aims to perform next generation virtualization.
|
||||
|
||||
License: Mulan PSL v2
|
||||
@ -31,14 +31,25 @@ BuildRequires: gcc
|
||||
BuildRequires: pixman
|
||||
BuildRequires: pixman-devel
|
||||
|
||||
%ifarch x86_64
|
||||
%define rust_gnu_target x86_64-unknown-linux-gnu
|
||||
%define rust_musl_target x86_64-unknown-linux-musl
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
%define rust_gnu_target aarch64-unknown-linux-gnu
|
||||
%define rust_musl_target aarch64-unknown-linux-musl
|
||||
%endif
|
||||
|
||||
%description
|
||||
Based on Rust programming language, StratoVirt is lightweight, efficient and safe. StratoVirt reduces memory resource consumption and improves VM startup speed while retains isolation capability and security capability of traditional virtualization. StratoVirt works with iSulad and Kata container, and can be integrated in Kubernetes ecosystem perfectly. The current version can be applied to microservices or serverless scenarios. StratoVirt reserves interface and design for importing more features, even standard virtualization.
|
||||
|
||||
Summary: %{summary}
|
||||
|
||||
%files -n stratovirt
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/stratovirt
|
||||
%{_bindir}/ozone
|
||||
%{_libdir}/stratovirt/static/stratovirt
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
@ -48,15 +59,6 @@ Summary: %{summary}
|
||||
%cargo_generate_buildrequires
|
||||
|
||||
%build
|
||||
|
||||
%ifarch aarch64
|
||||
sed -i '/\[build\]/a target="aarch64-unknown-linux-gnu"' ./.cargo/config
|
||||
%endif
|
||||
|
||||
%ifarch x86_64
|
||||
sed -i '/\[build\]/a target="x86_64-unknown-linux-gnu"' ./.cargo/config
|
||||
%endif
|
||||
|
||||
sed -i '/\[source.crates-io\]/{n;d}' ./.cargo/config
|
||||
sed -i '/\[source.local-registry\]/{n;d}' ./.cargo/config
|
||||
sed -i '/\[source.local-registry\]/a directory = "vendor"' ./.cargo/config
|
||||
@ -64,17 +66,27 @@ sed -i '/\[source.local-registry\]/a directory = "vendor"' ./.cargo/config
|
||||
%ifarch aarch64
|
||||
sed -i 's/rustflags = \[/&"-Clink-arg=-lgcc", /' ./.cargo/config
|
||||
%endif
|
||||
sed -i 's/rustflags = \[/&"-Clink-arg=-lpixman-1", /' ./.cargo/config
|
||||
|
||||
%cargo_build -a
|
||||
cargo build --release --target=%{rust_musl_target} --all-features
|
||||
|
||||
sed -i 's/rustflags = \[/&"-Clink-arg=-lpixman-1", /' ./.cargo/config
|
||||
cargo build --release --target=%{rust_gnu_target} --all-features --bin stratovirt
|
||||
|
||||
|
||||
%install
|
||||
%cargo_install -a
|
||||
chmod 555 ${RPM_BUILD_ROOT}/usr/bin/stratovirt
|
||||
chmod 555 ${RPM_BUILD_ROOT}/usr/bin/ozone
|
||||
rm -rf %{buildroot}
|
||||
install -d %{buildroot}%{_bindir}
|
||||
install -D -m555 ./target/%{rust_gnu_target}/release/stratovirt %{buildroot}%{_bindir}
|
||||
install -D -m555 ./target/%{rust_musl_target}/release/ozone %{buildroot}%{_bindir}
|
||||
|
||||
install -d %{buildroot}%{_libdir}/stratovirt/static
|
||||
install -D -m555 ./target/%{rust_musl_target}/release/stratovirt %{buildroot}%{_libdir}/stratovirt/static
|
||||
|
||||
%changelog
|
||||
* Mon Aug 29 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-5
|
||||
* Wed Sep 07 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-6
|
||||
- Build both the gnu and musl version of stratovirt
|
||||
|
||||
* Tue Sep 06 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-5
|
||||
- Update to StratoVirt 2.2.0-rc4
|
||||
|
||||
* Wed Aug 24 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-4
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user