File rust-thread-priority.spec of Package rust-thread-priority

# rust-thread-priority.spec
# Generated by rust2rpm 21
%bcond_with check
%global debug_package %{nil}

%global crate thread-priority

Name:           rust-%{crate}
Version:        0.8.2
Release:        1%{?dist}
Summary:        Library for managing threads priority and schedule policies

# Upstream license specification: MIT
License:        MIT
URL:            https://crates.io/crates/thread-priority
Source:         https://crates.io/api/v1/crates/%crate/%version/download#/%crate-%version.crate

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging >= 21
BuildRequires:  (crate(cfg-if/default) >= 1.0.0 with crate(cfg-if/default) < 2.0.0~)
BuildRequires:  (crate(log/default) >= 0.4.0 with crate(log/default) < 0.5.0~)
BuildRequires:  (crate(winapi/default) >= 0.3.0 with crate(winapi/default) < 0.4.0~)
BuildRequires:  (crate(winapi/errhandlingapi) >= 0.3.0 with crate(winapi/errhandlingapi) < 0.4.0~)
BuildRequires:  (crate(winapi/minwindef) >= 0.3.0 with crate(winapi/minwindef) < 0.4.0~)
BuildRequires:  (crate(winapi/processthreadsapi) >= 0.3.0 with crate(winapi/processthreadsapi) < 0.4.0~)
BuildRequires:  (crate(winapi/winbase) >= 0.3.0 with crate(winapi/winbase) < 0.4.0~)
BuildRequires:  (crate(winapi/winnt) >= 0.3.0 with crate(winapi/winnt) < 0.4.0~)
BuildRequires:  crate(libc/default) >= 0.2.123
%if %{with check}
BuildRequires:  (crate(rstest/default) >= 0.12.0 with crate(rstest/default) < 0.13.0~)
%endif

%global _description %{expand:
Library for managing threads priority and schedule policies.}

%description %{_description}

%package        devel
Summary:        %{summary}
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages which
use the "%{crate}" crate.

%files          devel
%license %{crate_instdir}/LICENSE
%doc %{crate_instdir}/README.md
%{crate_instdir}/

%package     -n %{name}+default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+default-devel %{_description}

This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif