forked from pool/mdevctl
- Update to version 1.3.0 (jsc#PED-4981): * tests: add tests for live and defined support * doc: document live support and its options * cli: add live and defined parameters to modify command * callouts: add callout live event support * main: refactor jsonfile loading * main: refactor getting active devices * tests: add callout versioning tests * callouts: add warning for unknown supported actions and events * callouts: prevent repeating unsuccessful script searches * callouts: add versioning on callout scripts * callouts: make callout method reusable * callouts: add a check_result_fn to invoke_first_matching_script * Fix new clippy warnings * Cargo.toml: move tempfile to dev-dependencies * main: assemble active devices without overwriting * mdevctl.spec.in: Add systemd as build requirement * callout: ignore broken pipe on stdin * cli: improve lsmdev help * callouts: set script in callout on success only * main: fix file open error being suppressed * Fix clippy warning for useless vec * callouts: replace negated check and improve msgs * callouts: improve debug messages in get_attributes * callouts: match code format in Display for Event and Action * tests/callouts: make scripts cross distro compliant * actions: update release action to newer versions * Bump clap to 4.0 * Bump env_logger dependency to 0.9.0 * Fix deprecated github actions OBS-URL: https://build.opensuse.org/request/show/1141334 OBS-URL: https://build.opensuse.org/package/show/Virtualization/mdevctl?expand=0&rev=17
79 lines
2.2 KiB
RPMSpec
79 lines
2.2 KiB
RPMSpec
#
|
|
# spec file for package mdevctl
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: mdevctl
|
|
Version: 1.3.0
|
|
Release: 0
|
|
Summary: Mediated device management and persistence utility
|
|
License: LGPL-2.1-or-later
|
|
URL: https://github.com/mdevctl/mdevctl
|
|
Source0: %{name}-%{version}.tar.xz
|
|
Source1: vendor.tar.zst
|
|
Source2: cargo_config
|
|
BuildRequires: cargo
|
|
BuildRequires: python3-docutils
|
|
BuildRequires: rust
|
|
BuildRequires: zstd
|
|
BuildRequires: pkgconfig(udev)
|
|
|
|
%description
|
|
mdevctl is a utility for managing and persisting devices in the mediated device
|
|
framework of the Linux kernel. Mediated devices are sub-devices of a parent
|
|
device (e.g. a vGPU) which can be dynamically created and potentially used by
|
|
drivers like vfio-mdev for assignment to virtual machines.
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
%setup -q -D -T -a 1
|
|
mkdir -p cargo-home
|
|
cat >cargo-home/config <<EOF
|
|
[source.crates-io]
|
|
registry = 'https://github.com/rust-lang/crates.io-index'
|
|
replace-with = 'vendored-sources'
|
|
[source.vendored-sources]
|
|
directory = './vendor'
|
|
EOF
|
|
|
|
%build
|
|
export CARGO_HOME=$PWD/cargo-home
|
|
cargo build --release %{?_smp_mflags}
|
|
|
|
%install
|
|
%make_install
|
|
|
|
%check
|
|
export MDEVCTL_LOG=debug RUST_BACKTRACE=full
|
|
export CARGO_HOME=$PWD/cargo-home
|
|
cargo test
|
|
|
|
%files
|
|
%license COPYING
|
|
%doc README.md
|
|
%{_sbindir}/mdevctl
|
|
%{_sbindir}/lsmdev
|
|
%{_udevrulesdir}/60-mdevctl.rules
|
|
%dir %{_sysconfdir}/mdevctl.d
|
|
%dir %{_prefix}/lib/mdevctl
|
|
%dir %{_prefix}/lib/mdevctl/scripts.d
|
|
%{_mandir}/man8/mdevctl.8%{?ext_man}
|
|
%{_mandir}/man8/lsmdev.8%{?ext_man}
|
|
%{_datadir}/bash-completion/completions/mdevctl
|
|
%{_datadir}/bash-completion/completions/lsmdev
|
|
|
|
%changelog
|