From 6d71f62ed6b5e291be41c181b20beb0e11a6d06b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 31 Oct 2018 12:13:36 +0100 Subject: [PATCH] Adapt to new packaging Signed-off-by: Igor Gnatenko --- chrono-fix-metadata.diff | 10 ++++ rust-chrono.spec | 107 +++++++++++++++++++++++++++++++-------- 2 files changed, 96 insertions(+), 21 deletions(-) create mode 100644 chrono-fix-metadata.diff diff --git a/chrono-fix-metadata.diff b/chrono-fix-metadata.diff new file mode 100644 index 0000000..08bf4cd --- /dev/null +++ b/chrono-fix-metadata.diff @@ -0,0 +1,10 @@ +--- chrono-0.4.6/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ chrono-0.4.6/Cargo.toml 2018-10-31T12:12:22.793090+01:00 +@@ -22,6 +22,7 @@ + categories = ["date-and-time"] + license = "MIT/Apache-2.0" + repository = "https://github.com/chronotope/chrono" ++exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml", "/Makefile"] + [package.metadata.docs.rs] + all-features = true + diff --git a/rust-chrono.spec b/rust-chrono.spec index 38958dc..78c5b10 100644 --- a/rust-chrono.spec +++ b/rust-chrono.spec @@ -1,5 +1,5 @@ # Generated by rust2rpm -# Tests are run in infrastructure +# * Tests are run in infrastructure %bcond_with check %global debug_package %{nil} @@ -7,42 +7,110 @@ Name: rust-%{crate} Version: 0.4.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Date and time library for Rust +# Upstream license specification: MIT/Apache-2.0 License: MIT or ASL 2.0 URL: https://crates.io/crates/chrono Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# Initial patched metadata +# * Exclude CI files, https://github.com/chronotope/chrono/pull/283 +Patch0: chrono-fix-metadata.diff ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging -# [dependencies] BuildRequires: (crate(num-integer) >= 0.1.36 with crate(num-integer) < 0.2.0) BuildRequires: (crate(num-traits) >= 0.2.0 with crate(num-traits) < 0.3.0) -BuildRequires: (crate(rustc-serialize) >= 0.3.20 with crate(rustc-serialize) < 0.4.0) -BuildRequires: (crate(serde) >= 1.0.0 with crate(serde) < 2.0.0) -BuildRequires: (crate(time) >= 0.1.39 with crate(time) < 0.2.0) +BuildRequires: (crate(rustc-serialize/default) >= 0.3.20 with crate(rustc-serialize/default) < 0.4.0) +BuildRequires: (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0) +BuildRequires: (crate(time/default) >= 0.1.39 with crate(time/default) < 0.2.0) %if %{with check} -# [dev-dependencies] -BuildRequires: (crate(bincode) >= 0.8.0 with crate(bincode) < 0.9.0) +BuildRequires: (crate(bincode/default) >= 0.8.0 with crate(bincode/default) < 0.9.0) BuildRequires: (crate(num-iter) >= 0.1.35 with crate(num-iter) < 0.2.0) -BuildRequires: (crate(serde_derive) >= 1.0.0 with crate(serde_derive) < 2.0.0) -BuildRequires: (crate(serde_json) >= 1.0.0 with crate(serde_json) < 2.0.0) +BuildRequires: (crate(serde_derive/default) >= 1.0.0 with crate(serde_derive/default) < 2.0.0) +BuildRequires: (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0) %endif -%description -%{summary}. +%global _description \ +Date and time library for Rust. + +%description %{_description} %package devel Summary: %{summary} BuildArch: noarch -%description devel -Date and time library for Rust. +%description devel %{_description} This package contains library source intended for building other packages -which use %{crate} from crates.io. +which use "%{crate}" crate. + +%files devel +%license LICENSE.txt +%doc README.md CHANGELOG.md AUTHORS.txt +%{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}+clock-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+clock-devel %{_description} + +This package contains library source intended for building other packages +which use "clock" feature of "%{crate}" crate. + +%files -n %{name}+clock-devel +%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml + +%package -n %{name}+rustc-serialize-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+rustc-serialize-devel %{_description} + +This package contains library source intended for building other packages +which use "rustc-serialize" feature of "%{crate}" crate. + +%files -n %{name}+rustc-serialize-devel +%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml + +%package -n %{name}+serde-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+serde-devel %{_description} + +This package contains library source intended for building other packages +which use "serde" feature of "%{crate}" crate. + +%files -n %{name}+serde-devel +%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml + +%package -n %{name}+time-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+time-devel %{_description} + +This package contains library source intended for building other packages +which use "time" feature of "%{crate}" crate. + +%files -n %{name}+time-devel +%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 @@ -59,13 +127,10 @@ which use %{crate} from crates.io. %cargo_test %endif -%files devel -%license LICENSE.txt -%doc README.md CHANGELOG.md AUTHORS.txt -%{cargo_registry}/%{crate}-%{version}/ -%exclude %{cargo_registry}/%{crate}-%{version}/{Makefile,appveyor.yml} - %changelog +* Wed Oct 31 2018 Igor Gnatenko - 0.4.6-2 +- Adapt to new packaging + * Thu Aug 30 2018 Josh Stone - 0.4.6-1 - Update to 0.4.6