diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a50d56 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/clap-2.27.1.crate diff --git a/0001-Update-bitflags-to-1.0.patch b/0001-Update-bitflags-to-1.0.patch new file mode 100644 index 0000000..a425cbd --- /dev/null +++ b/0001-Update-bitflags-to-1.0.patch @@ -0,0 +1,176 @@ +From 36bf14777d3ae0eab1684b3c4a80704bee2dd59f Mon Sep 17 00:00:00 2001 +From: Bastien Orivel +Date: Thu, 9 Nov 2017 18:07:31 +0100 +Subject: [PATCH] Update bitflags to 1.0 + +--- + src/app/settings.rs | 82 ++++++++++++++++++++++++++-------------------------- + src/args/settings.rs | 34 +++++++++++----------- + src/macros.rs | 2 +- + 3 files changed, 59 insertions(+), 59 deletions(-) + +diff --git a/src/app/settings.rs b/src/app/settings.rs +index 5edb7843..a2cfd54b 100644 +--- a/src/app/settings.rs ++++ b/src/app/settings.rs +@@ -60,7 +60,7 @@ impl BitOr for AppFlags { + + impl Default for AppFlags { + fn default() -> Self { +- AppFlags(NEEDS_LONG_VERSION | NEEDS_LONG_HELP | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO) ++ AppFlags(Flags::NEEDS_LONG_VERSION | Flags::NEEDS_LONG_HELP | Flags::NEEDS_SC_HELP | Flags::UTF8_NONE | Flags::COLOR_AUTO) + } + } + +@@ -69,46 +69,46 @@ impl AppFlags { + pub fn new() -> Self { AppFlags::default() } + + impl_settings! { AppSettings, +- ArgRequiredElseHelp => A_REQUIRED_ELSE_HELP, +- ArgsNegateSubcommands => ARGS_NEGATE_SCS, +- AllowExternalSubcommands => ALLOW_UNK_SC, +- AllowInvalidUtf8 => UTF8_NONE, +- AllowLeadingHyphen => LEADING_HYPHEN, +- AllowNegativeNumbers => ALLOW_NEG_NUMS, +- AllowMissingPositional => ALLOW_MISSING_POS, +- ColoredHelp => COLORED_HELP, +- ColorAlways => COLOR_ALWAYS, +- ColorAuto => COLOR_AUTO, +- ColorNever => COLOR_NEVER, +- DontDelimitTrailingValues => DONT_DELIM_TRAIL, +- DontCollapseArgsInUsage => DONT_COLLAPSE_ARGS, +- DeriveDisplayOrder => DERIVE_DISP_ORDER, +- DisableHelpSubcommand => DISABLE_HELP_SC, +- DisableVersion => DISABLE_VERSION, +- GlobalVersion => GLOBAL_VERSION, +- HidePossibleValuesInHelp => NO_POS_VALUES, +- Hidden => HIDDEN, +- LowIndexMultiplePositional => LOW_INDEX_MUL_POS, +- NeedsLongHelp => NEEDS_LONG_HELP, +- NeedsLongVersion => NEEDS_LONG_VERSION, +- NeedsSubcommandHelp => NEEDS_SC_HELP, +- NoBinaryName => NO_BIN_NAME, +- PropagateGlobalValuesDown=> PROPAGATE_VALS_DOWN, +- StrictUtf8 => UTF8_STRICT, +- SubcommandsNegateReqs => SC_NEGATE_REQS, +- SubcommandRequired => SC_REQUIRED, +- SubcommandRequiredElseHelp => SC_REQUIRED_ELSE_HELP, +- TrailingVarArg => TRAILING_VARARG, +- UnifiedHelpMessage => UNIFIED_HELP, +- NextLineHelp => NEXT_LINE_HELP, +- VersionlessSubcommands => VERSIONLESS_SC, +- WaitOnError => WAIT_ON_ERROR, +- TrailingValues => TRAILING_VALUES, +- ValidNegNumFound => VALID_NEG_NUM_FOUND, +- Propagated => PROPAGATED, +- ValidArgFound => VALID_ARG_FOUND, +- InferSubcommands => INFER_SUBCOMMANDS, +- ContainsLast => CONTAINS_LAST ++ ArgRequiredElseHelp => Flags::A_REQUIRED_ELSE_HELP, ++ ArgsNegateSubcommands => Flags::ARGS_NEGATE_SCS, ++ AllowExternalSubcommands => Flags::ALLOW_UNK_SC, ++ AllowInvalidUtf8 => Flags::UTF8_NONE, ++ AllowLeadingHyphen => Flags::LEADING_HYPHEN, ++ AllowNegativeNumbers => Flags::ALLOW_NEG_NUMS, ++ AllowMissingPositional => Flags::ALLOW_MISSING_POS, ++ ColoredHelp => Flags::COLORED_HELP, ++ ColorAlways => Flags::COLOR_ALWAYS, ++ ColorAuto => Flags::COLOR_AUTO, ++ ColorNever => Flags::COLOR_NEVER, ++ DontDelimitTrailingValues => Flags::DONT_DELIM_TRAIL, ++ DontCollapseArgsInUsage => Flags::DONT_COLLAPSE_ARGS, ++ DeriveDisplayOrder => Flags::DERIVE_DISP_ORDER, ++ DisableHelpSubcommand => Flags::DISABLE_HELP_SC, ++ DisableVersion => Flags::DISABLE_VERSION, ++ GlobalVersion => Flags::GLOBAL_VERSION, ++ HidePossibleValuesInHelp => Flags::NO_POS_VALUES, ++ Hidden => Flags::HIDDEN, ++ LowIndexMultiplePositional => Flags::LOW_INDEX_MUL_POS, ++ NeedsLongHelp => Flags::NEEDS_LONG_HELP, ++ NeedsLongVersion => Flags::NEEDS_LONG_VERSION, ++ NeedsSubcommandHelp => Flags::NEEDS_SC_HELP, ++ NoBinaryName => Flags::NO_BIN_NAME, ++ PropagateGlobalValuesDown=> Flags::PROPAGATE_VALS_DOWN, ++ StrictUtf8 => Flags::UTF8_STRICT, ++ SubcommandsNegateReqs => Flags::SC_NEGATE_REQS, ++ SubcommandRequired => Flags::SC_REQUIRED, ++ SubcommandRequiredElseHelp => Flags::SC_REQUIRED_ELSE_HELP, ++ TrailingVarArg => Flags::TRAILING_VARARG, ++ UnifiedHelpMessage => Flags::UNIFIED_HELP, ++ NextLineHelp => Flags::NEXT_LINE_HELP, ++ VersionlessSubcommands => Flags::VERSIONLESS_SC, ++ WaitOnError => Flags::WAIT_ON_ERROR, ++ TrailingValues => Flags::TRAILING_VALUES, ++ ValidNegNumFound => Flags::VALID_NEG_NUM_FOUND, ++ Propagated => Flags::PROPAGATED, ++ ValidArgFound => Flags::VALID_ARG_FOUND, ++ InferSubcommands => Flags::INFER_SUBCOMMANDS, ++ ContainsLast => Flags::CONTAINS_LAST + } + } + +diff --git a/src/args/settings.rs b/src/args/settings.rs +index 377a1bbc..325bcf31 100644 +--- a/src/args/settings.rs ++++ b/src/args/settings.rs +@@ -32,27 +32,27 @@ impl ArgFlags { + pub fn new() -> Self { ArgFlags::default() } + + impl_settings!{ArgSettings, +- Required => REQUIRED, +- Multiple => MULTIPLE, +- EmptyValues => EMPTY_VALS, +- Global => GLOBAL, +- Hidden => HIDDEN, +- TakesValue => TAKES_VAL, +- UseValueDelimiter => USE_DELIM, +- NextLineHelp => NEXT_LINE_HELP, +- RequiredUnlessAll => R_UNLESS_ALL, +- RequireDelimiter => REQ_DELIM, +- ValueDelimiterNotSet => DELIM_NOT_SET, +- HidePossibleValues => HIDE_POS_VALS, +- AllowLeadingHyphen => ALLOW_TAC_VALS, +- RequireEquals => REQUIRE_EQUALS, +- Last => LAST, +- HideDefaultValue => HIDE_DEFAULT_VAL ++ Required => Flags::REQUIRED, ++ Multiple => Flags::MULTIPLE, ++ EmptyValues => Flags::EMPTY_VALS, ++ Global => Flags::GLOBAL, ++ Hidden => Flags::HIDDEN, ++ TakesValue => Flags::TAKES_VAL, ++ UseValueDelimiter => Flags::USE_DELIM, ++ NextLineHelp => Flags::NEXT_LINE_HELP, ++ RequiredUnlessAll => Flags::R_UNLESS_ALL, ++ RequireDelimiter => Flags::REQ_DELIM, ++ ValueDelimiterNotSet => Flags::DELIM_NOT_SET, ++ HidePossibleValues => Flags::HIDE_POS_VALS, ++ AllowLeadingHyphen => Flags::ALLOW_TAC_VALS, ++ RequireEquals => Flags::REQUIRE_EQUALS, ++ Last => Flags::LAST, ++ HideDefaultValue => Flags::HIDE_DEFAULT_VAL + } + } + + impl Default for ArgFlags { +- fn default() -> Self { ArgFlags(EMPTY_VALS | DELIM_NOT_SET) } ++ fn default() -> Self { ArgFlags(Flags::EMPTY_VALS | Flags::DELIM_NOT_SET) } + } + + /// Various settings that apply to arguments and may be set, unset, and checked via getter/setter +diff --git a/src/macros.rs b/src/macros.rs +index 678bc065..dd43b9ef 100644 +--- a/src/macros.rs ++++ b/src/macros.rs +@@ -740,7 +740,7 @@ macro_rules! clap_app { + } + + macro_rules! impl_settings { +- ($n:ident, $($v:ident => $c:ident),+) => { ++ ($n:ident, $($v:ident => $c:path),+) => { + pub fn set(&mut self, s: $n) { + match s { + $($n::$v => self.0.insert($c)),+ +-- +2.15.0 + diff --git a/clap-2.27.1-fix-metadata.diff b/clap-2.27.1-fix-metadata.diff new file mode 100644 index 0000000..e1b1895 --- /dev/null +++ b/clap-2.27.1-fix-metadata.diff @@ -0,0 +1,36 @@ +--- clap-2.27.1/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ clap-2.27.1/Cargo.toml 2017-11-13T18:56:55.042557+01:00 +@@ -63,14 +63,10 @@ + debug-assertions = false + rpath = false + [dependencies.bitflags] +-version = "0.9" +- +-[dependencies.clippy] +-version = "~0.0.166" +-optional = true ++version = "1.0" + + [dependencies.ansi_term] +-version = "0.9.0" ++version = "0.10.0" + optional = true + + [dependencies.vec_map] +@@ -105,7 +101,7 @@ + version = "0.2" + + [dev-dependencies.version-sync] +-version = "0.3" ++version = "0.4" + + [features] + debug = [] +@@ -116,7 +112,6 @@ + suggestions = ["strsim"] + default = ["suggestions", "color", "vec_map"] + wrap_help = ["term_size", "textwrap/term_size"] +-lints = ["clippy"] + unstable = [] + doc = ["yaml"] + [badges.appveyor] diff --git a/rust-clap.spec b/rust-clap.spec new file mode 100644 index 0000000..d64d648 --- /dev/null +++ b/rust-clap.spec @@ -0,0 +1,101 @@ +# Generated by rust2rpm +%bcond_without check +%global debug_package %{nil} + +%global crate clap + +Name: rust-%{crate} +Version: 2.27.1 +Release: 1%{?dist} +Summary: Simple to use, efficient, and full featured Command Line Argument Parser + +License: MIT +URL: https://crates.io/crates/clap +Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# Initial patched metadata +# * clippy is nightly +# * bump ansi_term to 0.10, https://github.com/kbknapp/clap-rs/pull/1101 +# * bump bitflags to 1.0, https://github.com/kbknapp/clap-rs/pull/1063 +# * bump version-sync to 0.4, https://github.com/kbknapp/clap-rs/pull/1107 +Patch0: clap-2.27.1-fix-metadata.diff +# Real bump of bitflags +Patch1: 0001-Update-bitflags-to-1.0.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +# [dependencies] +BuildRequires: (crate(ansi_term) >= 0.10.0 with crate(ansi_term) < 0.11.0) +BuildRequires: (crate(atty) >= 0.2.2 with crate(atty) < 0.3.0) +BuildRequires: (crate(bitflags) >= 1.0.0 with crate(bitflags) < 2.0.0) +BuildRequires: (crate(strsim) >= 0.6.0 with crate(strsim) < 0.7.0) +BuildRequires: (crate(term_size) >= 0.3.0 with crate(term_size) < 0.4.0) +BuildRequires: (crate(textwrap) >= 0.9.0 with crate(textwrap) < 0.10.0) +BuildRequires: (crate(unicode-width) >= 0.1.4 with crate(unicode-width) < 0.2.0) +BuildRequires: (crate(vec_map) >= 0.8.0 with crate(vec_map) < 0.9.0) +BuildRequires: (crate(yaml-rust) >= 0.3.5 with crate(yaml-rust) < 0.4.0) +%if %{with check} +# [dev-dependencies] +BuildRequires: (crate(lazy_static) >= 0.2.0 with crate(lazy_static) < 0.3.0) +BuildRequires: (crate(regex) >= 0.2.0 with crate(regex) < 0.3.0) +BuildRequires: (crate(version-sync) >= 0.4.0 with crate(version-sync) < 0.5.0) +%endif + +%description +%{summary}. + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel +A simple to use, efficient, and full featured Command Line Argument Parser. + +This package contains library source intended for building other packages +which use %{crate} from crates.io. + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%files devel +%license LICENSE-MIT +%doc README.md CHANGELOG.md CONTRIBUTORS.md SPONSORS.md +%{cargo_registry}/%{crate}-%{version}/ +%exclude %{cargo_registry}/%{crate}-%{version}/{index.html,justfile} + +%changelog +* Thu Nov 09 2017 Igor Gnatenko - 2.27.1-1 +- Update to 2.27.1 + +* Wed Jul 05 2017 Igor Gnatenko - 2.25.0-1 +- Update to 2.25.0 + +* Thu Jun 15 2017 Igor Gnatenko - 2.24.2-1 +- Update to 2.24.2 + +* Wed Jun 14 2017 Igor Gnatenko - 2.22.1-2 +- Port to use rust-packaging + +* Thu Mar 30 2017 Igor Gnatenko - 2.22.1-1 +- Update to 2.22.1 + +* Wed Mar 15 2017 Igor Gnatenko - 2.21.1-1 +- Update to 2.21.1 + +* Tue Feb 28 2017 Igor Gnatenko - 2.20.5-2 +- Rebuild (vec_map) + +* Sat Feb 25 2017 Igor Gnatenko - 2.20.5-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..1b60770 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (clap-2.27.1.crate) = 741a7f1822bea35be6f0432084767c6c43cf5f8ac20c1fb275ef600566b9bbdfcf012932f1b700b463b10936f8c518db5fcda8a888a20c4fbfe559616bb38aa5