Restore testing by using the GitHub archive as an additional source

epel10 imports/epel10/rust-jiff-0.1.23-2.el10
Benjamin A. Beasley 3 weeks ago
parent 7503c6f733
commit d82a302d77

1
.gitignore vendored

@ -11,3 +11,4 @@
/jiff-0.1.20.crate /jiff-0.1.20.crate
/jiff-0.1.21.crate /jiff-0.1.21.crate
/jiff-0.1.23.crate /jiff-0.1.23.crate
/jiff-0.1.23.tar.gz

@ -1,5 +1,5 @@
--- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00 --- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00
+++ jiff-0.1.23/Cargo.toml 2025-01-14T02:33:55.951394+00:00 +++ jiff-0.1.23/Cargo.toml 2025-01-14T03:03:22.824286+00:00
@@ -141,7 +141,6 @@ @@ -141,7 +141,6 @@
[features] [features]
alloc = [ alloc = [

@ -1,5 +1,5 @@
--- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00 --- jiff-0.1.23/Cargo.toml 1970-01-01T00:00:01+00:00
+++ jiff-0.1.23/Cargo.toml 2025-01-14T02:33:55.952394+00:00 +++ jiff-0.1.23/Cargo.toml 2025-01-14T03:03:22.825286+00:00
@@ -118,9 +118,6 @@ @@ -118,9 +118,6 @@
[dev-dependencies.serde_json] [dev-dependencies.serde_json]
version = "1.0.117" version = "1.0.117"

@ -1,8 +1,5 @@
# Generated by rust2rpm 27 # Generated by rust2rpm 27
# * Since 0.1.22, src/tz/snapshots/ and src/tz/testdata/ are no longer included %bcond check 1
# in the crate, so it is not feasible to run the tests without a separate
# source archive.
%bcond check 0
%global debug_package %{nil} %global debug_package %{nil}
%global crate jiff %global crate jiff
@ -15,6 +12,13 @@ Summary: Date-time library that encourages you to jump into the pit of su
License: Unlicense OR MIT License: Unlicense OR MIT
URL: https://crates.io/crates/jiff URL: https://crates.io/crates/jiff
Source: %{crates_source} 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 # Automatically generated patch to strip dependencies and normalize metadata
Patch: jiff-fix-metadata-auto.diff Patch: jiff-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes # Manually created patch for downstream crate metadata changes
@ -32,9 +36,9 @@ Patch12: 0001-Downstream-only-omit-tests-that-require-serde_yml.patch
# * EPEL9: Ignore doctests that require very recent Rust compilers # * EPEL9: Ignore doctests that require very recent Rust compilers
# * In this crate, doctests and examples (but not the lib and integration tests) # * 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. Its # are allowed to use Rust features from versions newer than the MSRV. Its
# therefore necessary to ignore some of them on EPEL9. If this patch becomes # therefore necessary to ignore some of them on EPEL9. If this patch becomes too
# too unwieldy, we could choose to start skipping doctests and/or examples # unwieldy, we could choose to start skipping doctests and/or examples there
# there entirely. # entirely.
Patch1009: 0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch Patch1009: 0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch
BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-rpm-macros >= 24
@ -198,6 +202,14 @@ tomcli set Cargo.toml del dev-dependencies.icu
%if %{with check} %if %{with check}
%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 %cargo_test -f serde
%endif %endif

@ -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]] [[package.extra-patches]]
number = 10 number = 10
file = "0001-Downstream-only-Omit-doctests-that-require-hifitime.patch" file = "0001-Downstream-only-Omit-doctests-that-require-hifitime.patch"
@ -59,10 +73,10 @@ file = "0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch"
comments = [ comments = [
"EPEL9: Ignore doctests that require very recent Rust compilers", "EPEL9: Ignore doctests that require very recent Rust compilers",
"""\ """\
In this crate, doctests and examples (but not the lib and integration tests) \ 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. Its \ are allowed to use Rust features from versions newer than the MSRV. Its
therefore necessary to ignore some of them on EPEL9. If this patch becomes too \ 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 \ unwieldy, we could choose to start skipping doctests and/or examples there
entirely.\ entirely.\
""", """,
] ]
@ -75,27 +89,34 @@ build = [
[scripts.prep] [scripts.prep]
pre = [ pre = [
"# NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can", """\
"# do conditional patching, below.", # NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can
"%autopatch -M 999 -p1", # do conditional patching, below.
"# We reserved patch number 1000+<N> for EPEL<N>.", %autopatch -M 999 -p1
"%if 0%{?el9}", # We reserved patch number 1000+<N> for EPEL<N>.\
""",
# EPEL9 rpm does not support "%patch <N>", and would quietly attempt and # EPEL9 rpm does not support "%patch <N>", and would quietly attempt and
# fail to re-apply Patch0 instead of applying the desired patch. We *need* # fail to re-apply Patch0 instead of applying the desired patch. We *need*
# to use "%patch -P <N>" instead. # to use "%patch -P <N>" instead.
"%patch -P 1009 -p1", """\
"%endif", %if 0%{?el9}
"# We do not yet have a rust-icu package (although one would be desirable)", %patch -P 1009 -p1
"tomcli set Cargo.toml del dev-dependencies.icu", %endif
# We do not yet have a rust-icu package (although one would be desirable)
tomcli set Cargo.toml del dev-dependencies.icu\
"""
] ]
[scripts.check]
[tests] pre = [
comments = [
"""\ """\
Since 0.1.22, src/tz/snapshots/ and src/tz/testdata/ are no longer included \ # Copy in snapshots, integration tests, and test data required to run tests,
in the crate, so it is not feasible to run the tests without a separate \ # but not included in the released crate. By doing so here in %%check rather
source archive.\ # 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\
""", """,
] ]
run = ["none"]

@ -1 +1,2 @@
SHA512 (jiff-0.1.23.crate) = 9faac5b8f560023b68d6e0fecc2cab898deb9bee816af47994fcb9212cb49a5513fcff5031fe493b939ceb6ef907852764b78d5395d7adfc6adcba3f0191d476 SHA512 (jiff-0.1.23.crate) = 9faac5b8f560023b68d6e0fecc2cab898deb9bee816af47994fcb9212cb49a5513fcff5031fe493b939ceb6ef907852764b78d5395d7adfc6adcba3f0191d476
SHA512 (jiff-0.1.23.tar.gz) = 067adc05341143dfd539317d6b2aae3f1fc5f2127ad265462aea8aec1e07d054290eb2a245eb07f7514204920d5c066289d475f841ac4a7c9f857dbad95896c7

Loading…
Cancel
Save