From f22e71f0ea13bbaddd016f82655dbd951a800621 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sat, 29 Feb 2020 13:39:29 +0100 Subject: [PATCH] Initial import Signed-off-by: Igor Raits --- .gitignore | 1 + ...-debug-related-tests-in-release-mode.patch | 41 ++++++++++ rust-pico-args.spec | 80 +++++++++++++++++++ sources | 1 + 4 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Ignore-debug-related-tests-in-release-mode.patch create mode 100644 rust-pico-args.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca5e9ff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pico-args-0.3.1.crate diff --git a/0001-Ignore-debug-related-tests-in-release-mode.patch b/0001-Ignore-debug-related-tests-in-release-mode.patch new file mode 100644 index 0000000..e1345e9 --- /dev/null +++ b/0001-Ignore-debug-related-tests-in-release-mode.patch @@ -0,0 +1,41 @@ +From 73eb2098180c460e24eeb575efc545bdc8efcf84 Mon Sep 17 00:00:00 2001 +From: Evgeniy Reizner +Date: Thu, 20 Feb 2020 03:18:57 +0200 +Subject: [PATCH] Ignore debug related tests in release mode. + +Closes #9 +--- + tests/tests.rs | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tests/tests.rs b/tests/tests.rs +index 3ce69640caf7..bc4004344d72 100644 +--- a/tests/tests.rs ++++ b/tests/tests.rs +@@ -49,6 +49,7 @@ fn invalid_flag_01() { + assert!(args.contains("v")); + } + ++#[cfg(debug_assertions)] + #[test] + #[should_panic] + fn invalid_flag_02() { +@@ -56,6 +57,7 @@ fn invalid_flag_02() { + assert!(args.contains(["v", "--version"])); + } + ++#[cfg(debug_assertions)] + #[test] + #[should_panic] + fn invalid_flag_03() { +@@ -63,6 +65,7 @@ fn invalid_flag_03() { + assert!(args.contains(["-v", "-version"])); + } + ++#[cfg(debug_assertions)] + #[test] + #[should_panic] + fn invalid_flag_04() { +-- +2.24.1 + diff --git a/rust-pico-args.spec b/rust-pico-args.spec new file mode 100644 index 0000000..887690b --- /dev/null +++ b/rust-pico-args.spec @@ -0,0 +1,80 @@ +# Generated by rust2rpm 13 +%bcond_without check +%global debug_package %{nil} + +%global crate pico-args + +Name: rust-%{crate} +Version: 0.3.1 +Release: 1%{?dist} +Summary: Ultra simple CLI arguments parser + +# Upstream license specification: MIT +License: MIT +URL: https://crates.io/crates/pico-args +Source: %{crates_source} + +# Some tests don't work in --release mode +# https://github.com/RazrFalcon/pico-args/issues/9 +# https://github.com/RazrFalcon/pico-args/commit/73eb2098180c460e24eeb575efc545bdc8efcf84 +Patch0001: 0001-Ignore-debug-related-tests-in-release-mode.patch + +ExclusiveArch: %{rust_arches} +%if %{__cargo_skip_build} +BuildArch: noarch +%endif + +BuildRequires: rust-packaging + +%global _description %{expand: +Ultra simple CLI arguments parser.} + +%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 +%doc README.md CHANGELOG.md +%{cargo_registry}/%{crate}-%{version_no_tilde}/ + +%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_no_tilde}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Wed Feb 19 16:28:49 PST 2020 Josh Stone - 0.3.1-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..e2ad9d4 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pico-args-0.3.1.crate) = a227cbe22bf8efe6fcdf5e8917d04c902ed31f0cdce3c431e1fef1c74f468daf2af599bb167036a0cc4c1a91a249d85068bab567de5f7cfbf2a1e1958c2b905d