From 1afe79876f8ae46d6dcf011fc9fe53236291ddf2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 12 Feb 2020 10:36:03 -0800 Subject: [PATCH] Initial package --- .gitignore | 5 +++ README.md | 4 +- rust-time0.1.spec | 95 ++++++++++++++++++++++++++++++++++++++++ sources | 1 + time-0.1-fix-tests.patch | 23 ++++++++++ time-fix-metadata.diff | 25 +++++++++++ 6 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 rust-time0.1.spec create mode 100644 sources create mode 100644 time-0.1-fix-tests.patch create mode 100644 time-fix-metadata.diff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..570fa8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/time-0.1.38.crate +/time-0.1.39.crate +/time-0.1.40.crate +/time-0.1.41.crate +/time-0.1.42.crate diff --git a/README.md b/README.md index 2a7f8b7..a8f7673 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# rust-time0.1 +# rust-time -The rust-time0.1 package \ No newline at end of file +The rust-time package \ No newline at end of file diff --git a/rust-time0.1.spec b/rust-time0.1.spec new file mode 100644 index 0000000..8dca336 --- /dev/null +++ b/rust-time0.1.spec @@ -0,0 +1,95 @@ +# Generated by rust2rpm 13 +%bcond_without check +%global debug_package %{nil} + +%global crate time + +Name: rust-%{crate}0.1 +Version: 0.1.42 +Release: 1%{?dist} +Summary: Utilities for working with time-related functions in Rust + +# Upstream license specification: MIT/Apache-2.0 +License: MIT or ASL 2.0 +URL: https://crates.io/crates/time +Source: %{crates_source} +# Initial patched metadata +# * No windows/redox +# * Exclude CI files, https://github.com/rust-lang-deprecated/time/pull/170 +Patch0: time-fix-metadata.diff + +# * Don't deny warnings +# * Adjust the recent/future test dates +Patch1: time-0.1-fix-tests.patch + +ExclusiveArch: %{rust_arches} +%if %{__cargo_skip_build} +BuildArch: noarch +%endif + +BuildRequires: rust-packaging + +%global _description %{expand: +Utilities for working with time-related functions in Rust.} + +%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 +%doc README.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 + +%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_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 +* Mon Jan 27 2020 Josh Stone - 0.1.42-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..92d4672 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (time-0.1.42.crate) = 4df662212377093b0fd8fcd88ddc30b20a8af7d989c2e100c0cf64f9741e88eea6e858e1aa4220be6b76b0cf8b62c8116b492010d74d1ebef197c66aa130aa83 diff --git a/time-0.1-fix-tests.patch b/time-0.1-fix-tests.patch new file mode 100644 index 0000000..da9e645 --- /dev/null +++ b/time-0.1-fix-tests.patch @@ -0,0 +1,23 @@ +diff --git a/src/lib.rs b/src/lib.rs +index ef44f3a1255e..be0ce334aef3 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -34,7 +34,6 @@ + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/time/")] + #![allow(trivial_numeric_casts)] +-#![cfg_attr(test, deny(warnings))] + + #[cfg(target_os = "redox")] extern crate syscall; + #[cfg(unix)] extern crate libc; +@@ -694,8 +693,8 @@ mod tests { + + #[test] + fn test_get_time() { +- static SOME_RECENT_DATE: i64 = 1325376000i64; // 2012-01-01T00:00:00Z +- static SOME_FUTURE_DATE: i64 = 1577836800i64; // 2020-01-01T00:00:00Z ++ static SOME_RECENT_DATE: i64 = 1577836800i64; // 2020-01-01T00:00:00Z ++ static SOME_FUTURE_DATE: i64 = 1893456000i64; // 2030-01-01T00:00:00Z + + let tv1 = get_time(); + debug!("tv1={} sec + {} nsec", tv1.sec, tv1.nsec); diff --git a/time-fix-metadata.diff b/time-fix-metadata.diff new file mode 100644 index 0000000..9e2abb5 --- /dev/null +++ b/time-fix-metadata.diff @@ -0,0 +1,25 @@ +--- time-0.1.42/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ time-0.1.42/Cargo.toml 2019-06-21T20:09:19.610502+00:00 +@@ -19,6 +19,7 @@ + documentation = "https://doc.rust-lang.org/time" + license = "MIT/Apache-2.0" + repository = "https://github.com/rust-lang/time" ++exclude = ["/.travis.yml", "/appveyor.yml"] + [dependencies.libc] + version = "0.2.1" + +@@ -28,14 +29,6 @@ + [dev-dependencies.log] + version = "0.4" + +-[dev-dependencies.winapi] +-version = "0.3.0" +-features = ["std", "processthreadsapi", "winbase"] +-[target."cfg(target_os = \"redox\")".dependencies.redox_syscall] +-version = "0.1" +-[target."cfg(windows)".dependencies.winapi] +-version = "0.3.0" +-features = ["std", "minwinbase", "minwindef", "ntdef", "profileapi", "sysinfoapi", "timezoneapi"] + [badges.appveyor] + repository = "alexcrichton/time" +