diff --git a/.gitignore b/.gitignore index fc1f43b..51020eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/jiff-0.1.21.crate +SOURCES/jiff-0.1.23.crate +SOURCES/jiff-0.1.23.tar.gz diff --git a/.rust-jiff.metadata b/.rust-jiff.metadata index f40c99d..16e7d0e 100644 --- a/.rust-jiff.metadata +++ b/.rust-jiff.metadata @@ -1 +1,2 @@ -c17b6b7c05b00b98501d121e80b32ef5a9011770 SOURCES/jiff-0.1.21.crate +d77ec234f4bdec3608025aab3d94b96c4f485023 SOURCES/jiff-0.1.23.crate +6e7d0eb8401a7567309d3ab66eb6981ae1570bb1 SOURCES/jiff-0.1.23.tar.gz diff --git a/SOURCES/jiff-fix-metadata-auto.diff b/SOURCES/jiff-fix-metadata-auto.diff index dc8f8e8..7849e87 100644 --- a/SOURCES/jiff-fix-metadata-auto.diff +++ b/SOURCES/jiff-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- jiff-0.1.21/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ jiff-0.1.21/Cargo.toml 2025-01-05T18:56:41.617601+00:00 -@@ -137,7 +137,6 @@ +--- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ jiff-0.1.23/Cargo.toml 2025-01-14T03:03:22.824286+00:00 +@@ -141,7 +141,6 @@ [features] alloc = [ "serde?/alloc", @@ -8,8 +8,8 @@ ] default = [ "std", -@@ -146,8 +145,6 @@ - "tzdb-zoneinfo", +@@ -151,8 +150,6 @@ + "tzdb-concatenated", ] js = [ - "dep:wasm-bindgen", @@ -17,7 +17,7 @@ ] logging = ["dep:log"] serde = ["dep:serde"] -@@ -158,46 +155,16 @@ +@@ -163,47 +160,17 @@ ] tz-system = [ "std", @@ -31,6 +31,7 @@ - "dep:jiff-tzdb-platform", "alloc", ] + tzdb-concatenated = ["std"] tzdb-zoneinfo = ["std"] -[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dependencies.js-sys] diff --git a/SOURCES/jiff-fix-metadata.diff b/SOURCES/jiff-fix-metadata.diff index 837fdd0..37ae527 100644 --- a/SOURCES/jiff-fix-metadata.diff +++ b/SOURCES/jiff-fix-metadata.diff @@ -1,6 +1,6 @@ ---- jiff-0.1.21/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ jiff-0.1.21/Cargo.toml 2025-01-05T18:56:41.619601+00:00 -@@ -114,9 +114,6 @@ +--- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ jiff-0.1.23/Cargo.toml 2025-01-14T03:03:22.825286+00:00 +@@ -118,9 +118,6 @@ [dev-dependencies.serde_json] version = "1.0.117" @@ -10,8 +10,8 @@ [dev-dependencies.tabwriter] version = "1.4.0" -@@ -165,6 +162,3 @@ - ] +@@ -171,6 +168,3 @@ + tzdb-concatenated = ["std"] tzdb-zoneinfo = ["std"] -[target.'cfg(not(target_family = "wasm"))'.dev-dependencies.hifitime] diff --git a/SOURCES/rust2rpm.toml b/SOURCES/rust2rpm.toml index 15f29ac..7ebf5a8 100644 --- a/SOURCES/rust2rpm.toml +++ b/SOURCES/rust2rpm.toml @@ -25,6 +25,20 @@ cargo-toml-patch-comments = [ """, ] +[[package.extra-sources]] +number = 10 +file = "https://github.com/BurntSushi/jiff/archive/%{version}/jiff-%{version}.tar.gz" +comments = [ + """\ + Since 0.1.22, the published crates no longer include “non-essential files \ + (including tests and test data).” Since we would like to run the tests, we \ + use the GitHub archive as an additonal source as permitted in \ + https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_sources, \ + waiting until %%check to copy in the extra files to prove they are not \ + included in the crate sources shipped in the binary RPMs.\ + """, +] + [[package.extra-patches]] number = 10 file = "0001-Downstream-only-Omit-doctests-that-require-hifitime.patch" @@ -59,11 +73,11 @@ 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.\ +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.\ """, ] @@ -75,20 +89,34 @@ build = [ [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}", + """\ +# 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.\ +""", # 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", + """\ +%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\ +""" ] -post = [ - "# Exclude test and debug scripts that would BuildRequire sh or bash", - "tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*'", + +[scripts.check] +pre = [ + """\ +# Copy in snapshots, integration tests, and test data – required to run tests, +# but not included in the released crate. By doing so here in %%check rather +# than in %%prep, we prove that the binary RPMs are derived solely from the +# published crate sources. +tar -xzvf '%{SOURCE10}' --strip-components=1 \\ + jiff-%{version}/src/tz/snapshots \\ + jiff-%{version}/src/tz/testdata \\ + jiff-%{version}/tests\ +""", ] diff --git a/SPECS/rust-jiff.spec b/SPECS/rust-jiff.spec index 9f0fc4d..b8c30dd 100644 --- a/SPECS/rust-jiff.spec +++ b/SPECS/rust-jiff.spec @@ -2,7 +2,7 @@ ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 1; + 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}} @@ -15,13 +15,20 @@ %global crate jiff Name: rust-jiff -Version: 0.1.21 +Version: 0.1.23 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} +# * Since 0.1.22, the published crates no longer include “non-essential files +# (including tests and test data).” Since we would like to run the tests, we +# use the GitHub archive as an additonal source as permitted in +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_sources, +# waiting until %%check to copy in the extra files to prove they are not +# included in the crate sources shipped in the binary RPMs. +Source10: https://github.com/BurntSushi/jiff/archive/%{version}/jiff-%{version}.tar.gz # Automatically generated patch to strip dependencies and normalize metadata Patch: jiff-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes @@ -39,9 +46,9 @@ Patch12: 0001-Downstream-only-omit-tests-that-require-serde_yml.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. +# 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 @@ -157,6 +164,18 @@ 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-concatenated-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tzdb-concatenated-devel %{_description} + +This package contains library source intended for building other packages which +use the "tzdb-concatenated" feature of the "%{crate}" crate. + +%files -n %{name}+tzdb-concatenated-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+tzdb-zoneinfo-devel Summary: %{summary} BuildArch: noarch @@ -181,8 +200,6 @@ use the "tzdb-zoneinfo" feature of the "%{crate}" crate. # 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 @@ -195,11 +212,25 @@ tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*' %if %{with check} %check +# Copy in snapshots, integration tests, and test data – required to run tests, +# but not included in the released crate. By doing so here in %%check rather +# than in %%prep, we prove that the binary RPMs are derived solely from the +# published crate sources. +tar -xzvf '%{SOURCE10}' --strip-components=1 \ + jiff-%{version}/src/tz/snapshots \ + jiff-%{version}/src/tz/testdata \ + jiff-%{version}/tests %cargo_test -f serde %endif %changelog ## START: Generated by rpmautospec +* Tue Jan 14 2025 Benjamin A. Beasley - 0.1.23-2 +- Restore testing by using the GitHub archive as an additional source + +* Tue Jan 14 2025 Benjamin A. Beasley - 0.1.23-1 +- Update to 0.1.23 (close RHBZ#2337484) + * Sun Jan 05 2025 Benjamin A. Beasley - 0.1.21-1 - Update to 0.1.21 (close RHBZ#2335585)