From 3aa0898114e5f370a55c1132f3c6710a4e5435ed Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 3 Nov 2018 14:47:36 +0100 Subject: [PATCH] Adapt to new packaging Signed-off-by: Igor Gnatenko --- ...test-0.3-unbreak-tests-on-nightly-20.patch | 43 --------------- idna-0.1.4-fix-metadata.diff | 11 ---- rust-idna.spec | 53 ++++++++++++------- tests/.fmf/version | 1 + tests/provision.fmf | 5 ++ tests/tests.yml | 13 +++++ 6 files changed, 53 insertions(+), 73 deletions(-) delete mode 100644 0001-Update-to-rustc_test-0.3-unbreak-tests-on-nightly-20.patch delete mode 100644 idna-0.1.4-fix-metadata.diff create mode 100644 tests/.fmf/version create mode 100644 tests/provision.fmf create mode 100644 tests/tests.yml diff --git a/0001-Update-to-rustc_test-0.3-unbreak-tests-on-nightly-20.patch b/0001-Update-to-rustc_test-0.3-unbreak-tests-on-nightly-20.patch deleted file mode 100644 index 9e59df2..0000000 --- a/0001-Update-to-rustc_test-0.3-unbreak-tests-on-nightly-20.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9d500e76a0e1644c93b3869588f979e4440e74d6 Mon Sep 17 00:00:00 2001 -From: Simon Sapin -Date: Sun, 25 Feb 2018 08:21:55 +0100 -Subject: [PATCH] Update to rustc_test 0.3, unbreak tests on nightly-2018-02-25 - -Version 0.2 of the crates.io package `rustc_test` uses `test` as its -rustc crate name, shadowing the `test` crate from the standard library. -This made up subject to breaking changes to its private APIs: - -https://travis-ci.org/SimonSapin/run-nightly/builds/345808272#L549 ---- - idna/tests/tests.rs | 2 +- - idna/tests/uts46.rs | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/idna/tests/tests.rs b/idna/tests/tests.rs -index 8ca2185..808ad6b 100644 ---- a/idna/tests/tests.rs -+++ b/idna/tests/tests.rs -@@ -1,6 +1,6 @@ - extern crate idna; - extern crate rustc_serialize; --extern crate test; -+extern crate rustc_test as test; - - mod punycode; - mod uts46; -diff --git a/idna/tests/uts46.rs b/idna/tests/uts46.rs -index ddc8af9..59ec1cd 100644 ---- a/idna/tests/uts46.rs -+++ b/idna/tests/uts46.rs -@@ -108,7 +108,7 @@ fn unescape(input: &str) -> String { - let c2 = chars.next().unwrap().to_digit(16).unwrap(); - let c3 = chars.next().unwrap().to_digit(16).unwrap(); - let c4 = chars.next().unwrap().to_digit(16).unwrap(); -- match char::from_u32((((c1 * 16 + c2) * 16 + c3) * 16 + c4)) -+ match char::from_u32(((c1 * 16 + c2) * 16 + c3) * 16 + c4) - { - Some(c) => output.push(c), - None => { output.push_str(&format!("\\u{:X}{:X}{:X}{:X}",c1,c2,c3,c4)); } --- -2.16.2 - diff --git a/idna-0.1.4-fix-metadata.diff b/idna-0.1.4-fix-metadata.diff deleted file mode 100644 index 4d52038..0000000 --- a/idna-0.1.4-fix-metadata.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- idna-0.1.4/Cargo.toml 2017-07-13T18:21:49+02:00 -+++ idna-0.1.4/Cargo.toml 2018-03-13T12:21:46.452973+01:00 -@@ -18,7 +18,7 @@ - name = "unit" - - [dev-dependencies] --rustc-test = "0.2" -+rustc-test = "0.3" - rustc-serialize = "0.3" - - [dependencies] diff --git a/rust-idna.spec b/rust-idna.spec index fb58756..00b85b2 100644 --- a/rust-idna.spec +++ b/rust-idna.spec @@ -1,14 +1,16 @@ # Generated by rust2rpm -%bcond_without check +# * Tests are run in infrastructure +%bcond_with check %global debug_package %{nil} %global crate idna Name: rust-%{crate} Version: 0.1.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: IDNA (Internationalizing Domain Names in Applications) and Punycode +# Upstream license specification: MIT/Apache-2.0 License: MIT or ASL 2.0 URL: https://crates.io/crates/idna Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate @@ -16,28 +18,43 @@ Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{ ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging -# [dependencies] -BuildRequires: (crate(matches) >= 0.1.0 with crate(matches) < 0.2.0) -BuildRequires: (crate(unicode-bidi) >= 0.3.0 with crate(unicode-bidi) < 0.4.0) -BuildRequires: (crate(unicode-normalization) >= 0.1.5 with crate(unicode-normalization) < 0.2.0) +BuildRequires: (crate(matches/default) >= 0.1.0 with crate(matches/default) < 0.2.0) +BuildRequires: (crate(unicode-bidi/default) >= 0.3.0 with crate(unicode-bidi/default) < 0.4.0) +BuildRequires: (crate(unicode-normalization/default) >= 0.1.5 with crate(unicode-normalization/default) < 0.2.0) %if %{with check} -# [dev-dependencies] -BuildRequires: (crate(rustc-serialize) >= 0.3.0 with crate(rustc-serialize) < 0.4.0) -BuildRequires: (crate(rustc-test) >= 0.3.0 with crate(rustc-test) < 0.4.0) +BuildRequires: (crate(rustc-serialize/default) >= 0.3.0 with crate(rustc-serialize/default) < 0.4.0) +BuildRequires: (crate(rustc-test/default) >= 0.3.0 with crate(rustc-test/default) < 0.4.0) %endif -%description -%{summary}. +%global _description \ +IDNA (Internationalizing Domain Names in Applications) and Punycode. + +%description %{_description} %package devel Summary: %{summary} BuildArch: noarch -%description devel -IDNA (Internationalizing Domain Names in Applications) and Punycode. +%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-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 %prep %autosetup -n %{crate}-%{version} -p1 @@ -54,12 +71,10 @@ which use %{crate} from crates.io. %cargo_test %endif -%files devel -%license LICENSE-MIT LICENSE-APACHE -%{cargo_registry}/%{crate}-%{version}/ -%exclude %{cargo_registry}/%{crate}-%{version}/src/{IdnaMappingTable.txt,make_uts46_mapping_table.py*} - %changelog +* Sat Nov 03 2018 Igor Gnatenko - 0.1.5-3 +- Adapt to new packaging + * Sat Jul 14 2018 Fedora Release Engineering - 0.1.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..503a97c --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- +standard-inventory-qcow2: + qemu: + # `cargo test` usually eats more than 1G. + m: 4G diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..d17de5b --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + repositories: + - repo: "https://src.fedoraproject.org/tests/rust.git" + dest: rust + tests: + - rust/cargo-test + environment: + pkg: rust-idna