You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-jiff/rust-jiff.spec

206 lines
6.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Generated by rust2rpm 27
# * Since 0.1.22, src/tz/snapshots/ and src/tz/testdata/ are no longer included
# 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 crate jiff
Name: rust-jiff
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}
# 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
# * Drop dev-dependency serde_yml: not packaged; we have patched out the tests
# that require it
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
# * Downstream-only: Omit tests that require serde_yml.
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. Its
# 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
%cargo_test -f serde
%endif
%changelog
%autochangelog