igvm/igvm.spec
Luigi Leonardi 18ce62a2b9 Initial commit on c10s
Resolves: RHEL-130925

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2026-01-26 18:58:15 +01:00

110 lines
2.6 KiB
RPMSpec

%global __brp_strip_static_archive %{nil}
%define igvm_commit 9848d1f
%define cargo_c_version 0.10.18+cargo-0.92.0
Name: igvm
Version: 0.4.0
Release: %autorelease
Summary: IGVM library
License: MIT
URL: https://github.com/microsoft/igvm
Source0: igvm-%{igvm_commit}.tar.xz
Source1: cargo-c-%{cargo_c_version}.tar.xz
Source2: build_cargo-c.sh
ExclusiveArch: %{rust_arches}
ExcludeArch: %{ix86}
%if 0%{?rhel}
BuildRequires: rust-toolset
%else
BuildRequires: rust-packaging >= 21
%endif
BuildRequires: CUnit-devel cbindgen make gcc cargo nano openssl-devel
%description
Igvm is an implementation of a parser for the Independent Guest Virtual Machine
%package libs
Summary: IGVM shared library
%description libs
Contains a shared library that applications that use %{name} will link to
%package devel
Provides: igvm-static = %{version}-%{release}
Requires: igvm-libs = %{version}-%{release}
Summary: IGVM library header files
%description devel
Contains header files and a static library for developing applications that use %{name}
%package tools
Requires: igvm-libs = %{version}-%{release}
Summary: IGVM tools
%description tools
The %{name}-tools package contains tools for
developing applications that use %{name}
%prep
%autosetup -n igvm
%cargo_prep -v vendor
rm -f Cargo.lock
cp -a -- %{SOURCE2} .
tar -a -f %{SOURCE1} -x
%define igvm_makeflags EXTRA_PARAMS="--profile rpm" TARGET_DIR="target" PROFILE=rpm
%define igvm_makeenv CARGO_HOME='.cargo' RUSTFLAGS='%{build_rustflags} -Csymbol-mangling-version=v0'
%build
# cargo-c will be installed in $HOME/.cargo/bin
export PATH="$HOME/.cargo/bin:$PATH"
./build_cargo-c.sh
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies
%cargo_vendor_manifest
# -Csymbol-mangling-version=v0 is from the upstream .cargo/config.toml.
# Enable v0 symbols to get better output from `perf` and related tools.
%{igvm_makeenv} %make_build -C igvm_c build %{igvm_makeflags}
%check
export PATH="$HOME/.cargo/bin:$PATH"
%{igvm_makeenv} %make_build -C igvm_c test %{igvm_makeflags}
%install
export PATH="$HOME/.cargo/bin:$PATH"
%{igvm_makeenv} %make_install -C igvm_c PREFIX=/usr DESTDIR=%{buildroot} %{igvm_makeflags}
%files libs
%license LICENSE
%license LICENSE.dependencies
%license cargo-vendor.txt
%{_libdir}/libigvm.so.*
%files devel
%{_includedir}/igvm
%license LICENSE
%license LICENSE.dependencies
%license cargo-vendor.txt
%doc README.md
%{_libdir}/libigvm.a
%{_libdir}/libigvm.so
%{_libdir}/pkgconfig/igvm.pc
%files tools
%{_bindir}/dump_igvm
%doc README.md
%license LICENSE
%license LICENSE.dependencies
%license cargo-vendor.txt
%changelog
%autochangelog