%global debug_package %{nil} %define build_efi_apps 0 Name: virt-firmware-rs Version: 25.4 Release: %autorelease Summary: virt firmware rust tools and efi apps License: MIT URL: https://gitlab.com/kraxel/virt-firmware-rs Source: https://gitlab.com/kraxel/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.gz BuildRequires: cargo-rpm-macros >= 24 BuildRequires: pkgconfig(libudev) %if %{build_efi_apps} %ifarch x86_64 %define efiarch x64 BuildRequires: rust-std-static-x86_64-unknown-uefi %endif %ifarch aarch64 %define efiarch aa64 BuildRequires: rust-std-static-aarch64-unknown-uefi %endif %endif # build_efi_apps %description virt firmware rust tools and efi apps %prep %autosetup -n %{name}-v%{version} -p1 %cargo_prep sed -i Cargo.toml -e '/varstore/d' %if !%{build_efi_apps} sed -i Cargo.toml -e '/efi-apps/d' %endif %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build -- --package virtfw-efi-tools %cargo_build -- --package virtfw-igvm-tools %if %{build_efi_apps} %cargo_build -- --package virtfw-efi-apps --target $(uname -m)-unknown-uefi %endif %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # efi-tools + igvm-tools install -d %{buildroot}%{_bindir} install -v -s -m 755 target/rpm/generate-boot-csv %{buildroot}%{_bindir} install -v -s -m 755 target/rpm/mini-bootcfg %{buildroot}%{_bindir} install -v -s -m 755 target/rpm/uefi-boot-menu %{buildroot}%{_bindir} install -v -s -m 755 target/rpm/igvm-inspect %{buildroot}%{_bindir} install -v -s -m 755 target/rpm/igvm-wrap %{buildroot}%{_bindir} %if %{build_efi_apps} # efi-apps install -d %{buildroot}%{_datadir}/%{name}/%{efiarch} install -v -s -m 644 target/*-unknown-uefi/rpm/*.efi %{buildroot}%{_datadir}/%{name}/%{efiarch} %endif %if %{with check} %check %cargo_test %endif %files %license LICENSE %{_bindir}/generate-boot-csv %{_bindir}/mini-bootcfg %{_bindir}/uefi-boot-menu %{_bindir}/igvm-inspect %{_bindir}/igvm-wrap %if %{build_efi_apps} %dir %{_datadir}/%{name}/%{efiarch} %{_datadir}/%{name}/%{efiarch}/*.efi %endif %changelog %autochangelog