2020-07-02 17:40:36 +00:00
|
|
|
#
|
|
|
|
# spec file for package mdevctl
|
|
|
|
#
|
2024-01-29 17:08:29 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2020-07-02 17:40:36 +00:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-07-02 19:53:32 +00:00
|
|
|
Name: mdevctl
|
2024-01-29 17:08:29 +00:00
|
|
|
Version: 1.3.0
|
2020-07-02 19:53:32 +00:00
|
|
|
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
|
2022-12-12 02:07:01 +00:00
|
|
|
Source1: vendor.tar.zst
|
|
|
|
Source2: cargo_config
|
2022-03-10 18:11:58 +00:00
|
|
|
BuildRequires: cargo
|
2022-03-14 19:36:19 +00:00
|
|
|
BuildRequires: python3-docutils
|
2022-03-10 18:11:58 +00:00
|
|
|
BuildRequires: rust
|
2022-12-12 02:07:01 +00:00
|
|
|
BuildRequires: zstd
|
2020-07-02 17:40:36 +00:00
|
|
|
BuildRequires: pkgconfig(udev)
|
|
|
|
|
|
|
|
%description
|
2020-07-02 17:51:54 +00:00
|
|
|
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.
|
2020-07-02 17:40:36 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1
|
2022-03-10 18:11:58 +00:00
|
|
|
%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
|
2020-07-02 17:40:36 +00:00
|
|
|
|
|
|
|
%build
|
2022-03-10 18:11:58 +00:00
|
|
|
export CARGO_HOME=$PWD/cargo-home
|
|
|
|
cargo build --release %{?_smp_mflags}
|
2020-07-02 17:40:36 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%make_install
|
|
|
|
|
2022-03-10 18:11:58 +00:00
|
|
|
%check
|
|
|
|
export MDEVCTL_LOG=debug RUST_BACKTRACE=full
|
|
|
|
export CARGO_HOME=$PWD/cargo-home
|
|
|
|
cargo test
|
|
|
|
|
2020-07-02 17:40:36 +00:00
|
|
|
%files
|
|
|
|
%license COPYING
|
|
|
|
%doc README.md
|
|
|
|
%{_sbindir}/mdevctl
|
|
|
|
%{_sbindir}/lsmdev
|
|
|
|
%{_udevrulesdir}/60-mdevctl.rules
|
|
|
|
%dir %{_sysconfdir}/mdevctl.d
|
2024-01-29 17:08:29 +00:00
|
|
|
%dir %{_prefix}/lib/mdevctl
|
|
|
|
%dir %{_prefix}/lib/mdevctl/scripts.d
|
2020-07-02 19:53:32 +00:00
|
|
|
%{_mandir}/man8/mdevctl.8%{?ext_man}
|
|
|
|
%{_mandir}/man8/lsmdev.8%{?ext_man}
|
2022-03-10 18:11:58 +00:00
|
|
|
%{_datadir}/bash-completion/completions/mdevctl
|
|
|
|
%{_datadir}/bash-completion/completions/lsmdev
|
2020-07-02 17:40:36 +00:00
|
|
|
|
2020-07-02 19:53:32 +00:00
|
|
|
%changelog
|