Blob Blame History Raw
# Generated by rust2rpm
%bcond_with check
%global debug_package %{nil}

%global crate atomicwrites

Name:           rust-%{crate}
Version:        0.2.2
Release:        2%{?dist}
Summary:        Atomic file-writes

License:        MIT
URL:            https://crates.io/crates/atomicwrites
Source:         %{crates_source}
# Initial patched metadata
# - Remove Windows-only dependencies
# - Bump nix to 0.13.0 https://github.com/untitaker/rust-atomicwrites/pull/29
Patch0:         atomicwrites-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging
BuildRequires:  (crate(nix/default) >= 0.13.0 with crate(nix/default) < 0.14.0)
BuildRequires:  (crate(tempdir/default) >= 0.3.0 with crate(tempdir/default) < 0.4.0)

%global _description \
Atomic file-writes.\
\
The basic idea is to write to temporary files, and move them when done writing.\
This avoids the problem of two programs writing to the same file. For\
AllowOverwrite, rename is used. For DisallowOverwrite, link + unlink is used\
instead to raise errors when the target path already exists.

%description %{_description}

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

%description    devel %{_description}

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

%files          devel
%doc README.md
%license LICENSE
%{cargo_registry}/%{crate}-%{version}/

%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 "default" feature of "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version}/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

%changelog
* Tue Apr 23 15:02:56 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.2-2
- Run tests in infrastructure

* Sat Apr 13 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.2.2-1
- Initial package