1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
@@generated_notice@@
# Generated by rust2rpm 13
%bcond_without check
%global __cargo_skip_build 0
%define mdevctlscriptsdir %{_prefix}/lib/mdevctl/scripts.d
%global crate mdevctl
%if ! (0%{?fedora} >= 34 || 0%{?rhel} >= 8)
%{error: RPM generation is not yet supported on this distribution}
%endif
%if 0%{?fedora} >= 34
Name: rust-%{crate}
%else
Name: mdevctl
%endif
Version: @@mdevctl_version@@
Release: 1%{?dist}
Summary: A mediated device management utility for Linux
# Upstream license specification: LGPL-2.1
License: LGPLv2
URL: https://github.com/mdevctl/mdevctl
Source0: mdevctl-%{version}.crate
%if 0%{?rhel} >= 8
Source1: mdevctl-%{version}-vendor.crate
%endif
ExclusiveArch: %{rust_arches}
%if 0%{?fedora} >= 34
BuildRequires: rust-packaging
%endif
%if 0%{?rhel}
BuildRequires: rust-toolset
%endif
BuildRequires: systemd python3-docutils
%global _description %{expand:
%{summary}.}
%description %{_description}
%if 0%{?fedora} >= 34
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%else
%files
%endif
%license COPYING
%doc README.md
%{_sbindir}/mdevctl
%{_sbindir}/lsmdev
%{_udevrulesdir}/60-mdevctl.rules
%dir %{_sysconfdir}/mdevctl.d
%dir %{mdevctlscriptsdir}/callouts
%dir %{mdevctlscriptsdir}/notifiers
%{_mandir}/man8/mdevctl.8*
%{_mandir}/man8/lsmdev.8*
%{_datadir}/bash-completion/completions/mdevctl
%{_datadir}/bash-completion/completions/lsmdev
%prep
%if 0%{?fedora} >= 34
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%else
%setup -q -n %{name}-%{version}
%cargo_prep -V 1
%endif
%build
%cargo_build
%install
make DESTDIR=%{buildroot} install
%if %{with check}
%check
export RUST_BACKTRACE=1
export MDEVCTL_LOG=debug
%cargo_test
%endif
%changelog
|