|
|
# Generated by rust2rpm 27
|
|
|
%bcond check 1
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
%global crate jiff
|
|
|
|
|
|
Name: rust-jiff
|
|
|
Version: 0.1.29
|
|
|
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
|
|
|
# * Drop dev-dependency hifitime: not packaged, and only for doctests
|
|
|
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-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
|
|
|
|
|
|
%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+<N> for EPEL<N>.
|
|
|
%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
|
|
|
|
|
|
%generate_buildrequires
|
|
|
%cargo_generate_buildrequires -f serde
|
|
|
|
|
|
%build
|
|
|
%cargo_build -f serde
|
|
|
|
|
|
%install
|
|
|
%cargo_install -f serde
|
|
|
|
|
|
%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
|
|
|
%autochangelog
|