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

%global crate serde_json

Name:           rust-%{crate}0.8
Version:        0.8.6
Release:        9%{?dist}
Summary:        JSON serialization file format

# Upstream license specification: MIT/Apache-2.0
License:        MIT or ASL 2.0
URL:            https://crates.io/crates/serde_json
Source0:        https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
Source1:        https://raw.githubusercontent.com/serde-rs/json/master/LICENSE-APACHE
Source2:        https://raw.githubusercontent.com/serde-rs/json/master/LICENSE-MIT
# Initial patched metadata
Patch0:         serde_json-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging
BuildRequires:  (crate(dtoa/default) >= 0.4.0 with crate(dtoa/default) < 0.5.0)
BuildRequires:  (crate(itoa/default) >= 0.4.0 with crate(itoa/default) < 0.5.0)
BuildRequires:  (crate(linked-hash-map/default) >= 0.5.0 with crate(linked-hash-map/default) < 0.6.0)
BuildRequires:  (crate(linked-hash-map/serde_impl) >= 0.5.0 with crate(linked-hash-map/serde_impl) < 0.6.0)
BuildRequires:  (crate(num-traits/default) >= 0.1.32 with crate(num-traits/default) < 0.2.0)
BuildRequires:  (crate(serde/default) >= 0.8.13 with crate(serde/default) < 0.9.0)

%global _description \
A JSON serialization file format.

%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
%license LICENSE-MIT LICENSE-APACHE
%{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

%package     -n %{name}+linked-hash-map-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+linked-hash-map-devel %{_description}

This package contains library source intended for building other packages
which use "linked-hash-map" feature of "%{crate}" crate.

%files       -n %{name}+linked-hash-map-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml

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

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

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

%files       -n %{name}+preserve_order-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version} -p1
cp -a %{S:1} %{S:2} .
# New dtoa/itoa API
t=$(stat -c %y src/ser.rs)
# dtoa::write(wr, value) -> dtoa::write(wr, value).map(|_| ())
sed -r -i -e "s/((itoa|dtoa)::write\([^)]+\))(.*)/\1.map(|_| ())\3/" src/ser.rs
touch -d "$t" src/ser.rs
%cargo_prep

%build
%cargo_build

%install
%cargo_install

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

%changelog
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Nov 09 2018 Josh Stone <jistone@redhat.com> - 0.8.6-6
- Adapt to new packaging

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Mar 27 2018 Josh Stone <jistone@redhat.com> - 0.8.6-4
- Bump itoa to 0.4

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.8.6-2
- Rebuild for rust-packaging v5

* Sat Nov 11 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.8.6-1
- Initial package