commit 5333c1a64f62065a724e4baa1a860d74a9ba5a43 Author: MSVSphere Packaging Team Date: Fri Dec 20 16:08:21 2024 +0300 import rust-jiff-0.1.15-2.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..624e27c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/jiff-0.1.15.crate diff --git a/.rust-jiff.metadata b/.rust-jiff.metadata new file mode 100644 index 0000000..13f731f --- /dev/null +++ b/.rust-jiff.metadata @@ -0,0 +1 @@ +f7e85cd1976e73b24f81f68c844731e524e9255d SOURCES/jiff-0.1.15.crate diff --git a/SOURCES/0001-Downstream-only-Omit-doctests-that-require-hifitime.patch b/SOURCES/0001-Downstream-only-Omit-doctests-that-require-hifitime.patch new file mode 100644 index 0000000..248d1f2 --- /dev/null +++ b/SOURCES/0001-Downstream-only-Omit-doctests-that-require-hifitime.patch @@ -0,0 +1,35 @@ +From 4313121d95e9ad7ae0d4cc3c1eaf8c3b46c25ef4 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 22 Aug 2024 11:48:36 -0400 +Subject: [PATCH] Downstream-only: Omit doctests that require hifitime + +It is not worth packaging it solely for a couple of tiny examples. +--- + COMPARE.md | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/COMPARE.md b/COMPARE.md +index ccb0593..1a9257c 100644 +--- a/COMPARE.md ++++ b/COMPARE.md +@@ -1049,7 +1049,7 @@ In particular, when computing a duration from two `Epoch` values that spans + a positive leap second (a second gets repeated), `hifitime` will correctly + report the accurate duration: + +-```rust ++```ignore + use hifitime::{Duration, Epoch}; + + fn main() -> anyhow::Result<()> { +@@ -1103,7 +1103,7 @@ In contrast, `hifitime` appears to use saturating arithmetic everywhere (I've + not been able to find this behavior documented though, so I'm not clear on what + the intended semantics are): + +-```rust ++```ignore + use hifitime::{Duration, Epoch}; + + fn main() -> anyhow::Result<()> { +-- +2.46.0 + diff --git a/SOURCES/0001-Downstream-only-Omit-doctests-that-require-icu.patch b/SOURCES/0001-Downstream-only-Omit-doctests-that-require-icu.patch new file mode 100644 index 0000000..5021ad1 --- /dev/null +++ b/SOURCES/0001-Downstream-only-Omit-doctests-that-require-icu.patch @@ -0,0 +1,25 @@ +From c3b537015e5bd9ac571cac96a3967a6d9ea48989 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Mon, 11 Nov 2024 10:53:45 -0500 +Subject: [PATCH] Downstream-only: Omit doctests that require icu + +--- + COMPARE.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/COMPARE.md b/COMPARE.md +index 6ebf29c..8bdab4f 100644 +--- a/COMPARE.md ++++ b/COMPARE.md +@@ -1129,7 +1129,7 @@ timestamp or duration type. + `icu` can be used to complement `jiff` when localized date formatting or + calendar conversions are required: + +-```rust ++```ignore + use icu::{ + calendar::{japanese::Japanese, DateTime}, + datetime::TypedDateTimeFormatter, +-- +2.47.0 + diff --git a/SOURCES/0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch b/SOURCES/0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch new file mode 100644 index 0000000..daf3606 --- /dev/null +++ b/SOURCES/0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch @@ -0,0 +1,30 @@ +From 82676b976a5a6397eda4e83bcbf9af8953bfbdf3 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 19 Sep 2024 06:59:15 -0400 +Subject: [PATCH] EPEL9: Ignore doctests that require very recent Rust + compilers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In this crate, doctests and examples (but not the lib and integration tests) are allowed to use Rust features from versions newer than the MSRV. It’s therefore necessary to ignore some of them on EPEL9. If this patch becomes too unwieldy, we could choose to start skipping doctests and/or examples there entirely. +--- + src/lib.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib.rs b/src/lib.rs +index b058186..5e791fd 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -262,7 +262,7 @@ println!("{zdt}"); + You can eliminate the possibility of a panic at runtime by using `time` in + a `const` block: + +-``` ++```ignore + use jiff::{civil::time, Zoned}; + + let zdt = Zoned::now().with().time(const { time(14, 0, 0, 0) }).build()?; +-- +2.46.0 + diff --git a/SOURCES/README.md b/SOURCES/README.md new file mode 100644 index 0000000..5cbde05 --- /dev/null +++ b/SOURCES/README.md @@ -0,0 +1,3 @@ +# rust-jiff + +The rust-jiff package diff --git a/SOURCES/jiff-fix-metadata-auto.diff b/SOURCES/jiff-fix-metadata-auto.diff new file mode 100644 index 0000000..ef95507 --- /dev/null +++ b/SOURCES/jiff-fix-metadata-auto.diff @@ -0,0 +1,49 @@ +--- jiff-0.1.15/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ jiff-0.1.15/Cargo.toml 2024-12-08T19:53:18.958265+00:00 +@@ -131,46 +131,22 @@ + "tzdb-zoneinfo", + ] + js = [ +- "dep:wasm-bindgen", +- "dep:js-sys", + ] + logging = ["dep:log"] + serde = ["dep:serde"] + std = ["alloc"] + tz-system = [ + "std", +- "dep:windows-sys", + ] + tzdb-bundle-always = [ + "dep:jiff-tzdb", + "alloc", + ] + tzdb-bundle-platform = [ +- "dep:jiff-tzdb-platform", + "alloc", + ] + tzdb-zoneinfo = ["std"] + +-[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dependencies.js-sys] +-version = "0.3.50" +-optional = true +- +-[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dependencies.wasm-bindgen] +-version = "0.2.70" +-optional = true +- +-[target.'cfg(any(windows, target_family = "wasm"))'.dependencies.jiff-tzdb-platform] +-version = "0.1.1" +-optional = true +- + [target.'cfg(not(target_family = "wasm"))'.dev-dependencies.hifitime] + version = "3.9.0" + +-[target."cfg(windows)".dependencies.windows-sys] +-version = ">=0.52.0, <=0.59.*" +-features = [ +- "Win32_Foundation", +- "Win32_System_Time", +-] +-optional = true +-default-features = false diff --git a/SOURCES/jiff-fix-metadata.diff b/SOURCES/jiff-fix-metadata.diff new file mode 100644 index 0000000..e2bc734 --- /dev/null +++ b/SOURCES/jiff-fix-metadata.diff @@ -0,0 +1,18 @@ +--- jiff-0.1.15/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ jiff-0.1.15/Cargo.toml 2024-12-08T19:53:29.866324+00:00 +@@ -85,7 +85,7 @@ + features = ["serde"] + + [dev-dependencies.chrono-tz] +-version = "0.9.0" ++version = ">=0.9,<0.11" + + [dev-dependencies.icu] + version = "1.5.0" +@@ -147,6 +147,3 @@ + ] + tzdb-zoneinfo = ["std"] + +-[target.'cfg(not(target_family = "wasm"))'.dev-dependencies.hifitime] +-version = "3.9.0" +- diff --git a/SOURCES/rust-jiff.rpmlintrc b/SOURCES/rust-jiff.rpmlintrc new file mode 100644 index 0000000..0244557 --- /dev/null +++ b/SOURCES/rust-jiff.rpmlintrc @@ -0,0 +1,2 @@ +# Feature metapackages are not supposed to have documentation! +addFilter(r"\+[-_\w]+-devel.noarch: W: no-documentation") diff --git a/SOURCES/rust2rpm.toml b/SOURCES/rust2rpm.toml new file mode 100644 index 0000000..80541e3 --- /dev/null +++ b/SOURCES/rust2rpm.toml @@ -0,0 +1,82 @@ +[features] +hide = [ + # For wasm/browser targets only; rust2rpm already patches everything out of + # this feature automatically. + "js", + # We do not want to package jiff-tzdb (which bundles the timezone + # database), and we think Fedora should always be using the system tz + # database, not a bundled one. + "tzdb-bundle-always", +] +enable = [ + # Required for some doctests + "serde", +] + +[package] +cargo-toml-patch-comments = [ + # This would be a candidate for automated patching with tomcli if it were + # an unconditional dependency, but given it is + # target.'cfg(not(target_family = "wasm"))', manual patching is easier. + "Drop dev-dependency hifitime: not packaged, and only for doctests", + "Relax chrono-tz dependency to allow building with 0.9 and 0.10", +] + +[[package.extra-patches]] +number = 10 +file = "0001-Downstream-only-Omit-doctests-that-require-hifitime.patch" +comments = [ + """\ + Downstream-only: Omit doctests that require hifitime. \ + It is not worth packaging it solely for a couple of tiny examples.\ + """, +] + +[[package.extra-patches]] +number = 11 +file = "0001-Downstream-only-Omit-doctests-that-require-icu.patch" +comments = [ + """\ + Downstream-only: Omit doctests that require icu.\ + """, +] + +[[package.extra-patches]] +number = 1009 +file = "0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch" +comments = [ + "EPEL9: Ignore doctests that require very recent Rust compilers", + """\ + In this crate, doctests and examples (but not the lib and integration tests) \ + are allowed to use Rust features from versions newer than the MSRV. It’s \ + therefore necessary to ignore some of them on EPEL9. If this patch becomes too \ + unwieldy, we could choose to start skipping doctests and/or examples there \ + entirely.\ + """, +] + + +[requires] +build = [ + "tomcli", +] + +[scripts.prep] +pre = [ + "# NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can", + "# do conditional patching, below.", + "%autopatch -M 999 -p1", + "# We reserved patch number 1000+ for EPEL.", + "%if 0%{?el9}", + # EPEL9 rpm does not support "%patch ", and would quietly attempt and + # fail to re-apply Patch0 instead of applying the desired patch. We *need* + # to use "%patch -P " instead. + "%patch -P 1009 -p1", + "%endif", + "# We do not yet have a rust-icu package (although one would be desirable)", + "tomcli set Cargo.toml del dev-dependencies.icu", +] +post = [ + "# Exclude test and debug scripts that would BuildRequire sh or bash", + "tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*'", +] diff --git a/SPECS/rust-jiff.spec b/SPECS/rust-jiff.spec new file mode 100644 index 0000000..c6f5eba --- /dev/null +++ b/SPECS/rust-jiff.spec @@ -0,0 +1,229 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.7.3) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# Generated by rust2rpm 27 +%bcond check 1 +%global debug_package %{nil} + +%global crate jiff + +Name: rust-jiff +Version: 0.1.15 +Release: %autorelease +Summary: Date-time library that encourages you to jump into the pit of success + +License: Unlicense OR MIT +URL: https://crates.io/crates/jiff +Source: %{crates_source} +# Automatically generated patch to strip dependencies and normalize metadata +Patch: jiff-fix-metadata-auto.diff +# Manually created patch for downstream crate metadata changes +# * Drop dev-dependency hifitime: not packaged, and only for doctests +# * Relax chrono-tz dependency to allow building with 0.9 and 0.10 +Patch: jiff-fix-metadata.diff +# * Downstream-only: Omit doctests that require hifitime. It is not worth +# packaging it solely for a couple of tiny examples. +Patch10: 0001-Downstream-only-Omit-doctests-that-require-hifitime.patch +# * Downstream-only: Omit doctests that require icu. +Patch11: 0001-Downstream-only-Omit-doctests-that-require-icu.patch +# * EPEL9: Ignore doctests that require very recent Rust compilers +# * In this crate, doctests and examples (but not the lib and integration tests) +# are allowed to use Rust features from versions newer than the MSRV. It’s +# therefore necessary to ignore some of them on EPEL9. If this patch becomes +# too unwieldy, we could choose to start skipping doctests and/or examples +# there entirely. +Patch1009: 0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: tomcli + +%global _description %{expand: +A date-time library that encourages you to jump into the pit of success. +This library is heavily inspired by the Temporal project.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/COPYING +%license %{crate_instdir}/LICENSE-MIT +%license %{crate_instdir}/UNLICENSE +%doc %{crate_instdir}/CHANGELOG.md +%doc %{crate_instdir}/COMPARE.md +%doc %{crate_instdir}/DESIGN.md +%doc %{crate_instdir}/PLATFORM.md +%doc %{crate_instdir}/README.md +%{crate_instdir}/ + +%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 the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+alloc-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+alloc-devel %{_description} + +This package contains library source intended for building other packages which +use the "alloc" feature of the "%{crate}" crate. + +%files -n %{name}+alloc-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+logging-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+logging-devel %{_description} + +This package contains library source intended for building other packages which +use the "logging" feature of the "%{crate}" crate. + +%files -n %{name}+logging-devel +%ghost %{crate_instdir}/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 the "serde" feature of the "%{crate}" crate. + +%files -n %{name}+serde-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+std-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+std-devel %{_description} + +This package contains library source intended for building other packages which +use the "std" feature of the "%{crate}" crate. + +%files -n %{name}+std-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+tz-system-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tz-system-devel %{_description} + +This package contains library source intended for building other packages which +use the "tz-system" feature of the "%{crate}" crate. + +%files -n %{name}+tz-system-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+tzdb-bundle-platform-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tzdb-bundle-platform-devel %{_description} + +This package contains library source intended for building other packages which +use the "tzdb-bundle-platform" feature of the "%{crate}" crate. + +%files -n %{name}+tzdb-bundle-platform-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+tzdb-zoneinfo-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tzdb-zoneinfo-devel %{_description} + +This package contains library source intended for building other packages which +use the "tzdb-zoneinfo" feature of the "%{crate}" crate. + +%files -n %{name}+tzdb-zoneinfo-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version} -N +# NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can +# do conditional patching, below. +%autopatch -M 999 -p1 +# We reserved patch number 1000+ for EPEL. +%if 0%{?el9} +%patch -P 1009 -p1 +%endif +# We do not yet have a rust-icu package (although one would be desirable) +tomcli set Cargo.toml del dev-dependencies.icu +%cargo_prep +# Exclude test and debug scripts that would BuildRequire sh or bash +tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*' + +%generate_buildrequires +%cargo_generate_buildrequires -f serde + +%build +%cargo_build -f serde + +%install +%cargo_install -f serde + +%if %{with check} +%check +%cargo_test -f serde +%endif + +%changelog +* Fri Dec 20 2024 MSVSphere Packaging Team - 0.1.15-2 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Sun Dec 08 2024 Fabio Valentini - 0.1.15-2 +- Relax chrono-tz dependency to allow building with 0.9 and 0.10 + +* Sat Nov 30 2024 Benjamin A. Beasley - 0.1.15-1 +- Update to 0.1.15 (close RHBZ#2329631) + +* Mon Nov 11 2024 Benjamin A. Beasley - 0.1.14-1 +- Update to 0.1.14 (close RHBZ#2323154) + +* Thu Sep 19 2024 Benjamin A. Beasley - 0.1.13-2 +- On EPEL9, disable doctests that require a newer Rust compiler + +* Sun Sep 08 2024 Benjamin A. Beasley - 0.1.13-1 +- Update to 0.1.13 (close RHBZ#2310620) + +* Mon Sep 02 2024 Benjamin A. Beasley - 0.1.12-1 +- Update to 0.1.12 (close RHBZ#2309076) + +* Sat Aug 24 2024 Benjamin A. Beasley - 0.1.10-1 +- Update to 0.1.10 + +* Sat Aug 24 2024 Benjamin A. Beasley - 0.1.8-3 +- Stop allowing chrono-tz 0.8, since we have 0.9 + +* Sat Aug 24 2024 Benjamin A. Beasley - 0.1.8-1 +- Initial package (close RHBZ#2307325) +## END: Generated by rpmautospec