commit 9d5089ce59ad5a0dc89f6f2d3b071200b5d49cec Author: MSVSphere Packaging Team Date: Fri Dec 20 15:58:28 2024 +0300 import rust-icu_collections-1.5.0-1.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9eba1df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/icu_collections-1.5.0.crate diff --git a/.rust-icu_collections.metadata b/.rust-icu_collections.metadata new file mode 100644 index 0000000..d24418f --- /dev/null +++ b/.rust-icu_collections.metadata @@ -0,0 +1 @@ +f3c61a581efb063ed6d1eb9fa8a0c9ee668ff7aa SOURCES/icu_collections-1.5.0.crate diff --git a/SOURCES/README.md b/SOURCES/README.md new file mode 100644 index 0000000..445b16f --- /dev/null +++ b/SOURCES/README.md @@ -0,0 +1,3 @@ +# rust-icu_collections + +The rust-icu_collections package diff --git a/SOURCES/icu_collections-1.5.0-no-icu-dev-dependency.patch b/SOURCES/icu_collections-1.5.0-no-icu-dev-dependency.patch new file mode 100644 index 0000000..37abbbb --- /dev/null +++ b/SOURCES/icu_collections-1.5.0-no-icu-dev-dependency.patch @@ -0,0 +1,12 @@ +diff -Naur icu_collections-1.5.0-original/src/iterator_utils.rs icu_collections-1.5.0/src/iterator_utils.rs +--- icu_collections-1.5.0-original/src/iterator_utils.rs 2006-07-23 21:21:28.000000000 -0400 ++++ icu_collections-1.5.0/src/iterator_utils.rs 2024-11-23 10:54:55.081320930 -0500 +@@ -59,6 +59,8 @@ + } + + #[cfg(test)] ++// Downstream-only: unconditionally disable these to avoid a circular dependency on the icu crate ++#[cfg(any())] + mod tests { + use core::fmt::Debug; + use icu::collections::codepointinvlist::CodePointInversionListBuilder; diff --git a/SOURCES/icu_collections-1.5.0-no-postcard.patch b/SOURCES/icu_collections-1.5.0-no-postcard.patch new file mode 100644 index 0000000..b780669 --- /dev/null +++ b/SOURCES/icu_collections-1.5.0-no-postcard.patch @@ -0,0 +1,24 @@ +diff -Naur icu_collections-1.5.0-original/src/codepointinvlist/cpinvlist.rs icu_collections-1.5.0/src/codepointinvlist/cpinvlist.rs +--- icu_collections-1.5.0-original/src/codepointinvlist/cpinvlist.rs 2006-07-23 21:21:28.000000000 -0400 ++++ icu_collections-1.5.0/src/codepointinvlist/cpinvlist.rs 2024-11-23 10:42:53.464004825 -0500 +@@ -1034,6 +1034,8 @@ + } + + #[test] ++ // Downstream-only: unconditionally disable this because we lack postcard ++ #[cfg(any())] + fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> { + let set = CodePointInversionList::bmp(); + let set_serialized: Vec = postcard::to_allocvec(&set).unwrap(); +diff -Naur icu_collections-1.5.0-original/src/codepointtrie/cptrie.rs icu_collections-1.5.0/src/codepointtrie/cptrie.rs +--- icu_collections-1.5.0-original/src/codepointtrie/cptrie.rs 2006-07-23 21:21:28.000000000 -0400 ++++ icu_collections-1.5.0/src/codepointtrie/cptrie.rs 2024-11-23 10:42:58.801073739 -0500 +@@ -1082,6 +1082,8 @@ + + #[test] + #[cfg(feature = "serde")] ++ // Downstream-only: unconditionally disable this because we lack postcard ++ #[cfg(any())] + fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> { + let trie = crate::codepointtrie::planes::get_planes_trie(); + let trie_serialized: Vec = postcard::to_allocvec(&trie).unwrap(); diff --git a/SOURCES/icu_collections-fix-metadata.diff b/SOURCES/icu_collections-fix-metadata.diff new file mode 100644 index 0000000..3aa20c6 --- /dev/null +++ b/SOURCES/icu_collections-fix-metadata.diff @@ -0,0 +1,9 @@ +--- icu_collections-1.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ icu_collections-1.5.0/Cargo.toml 2024-12-10T19:11:54.241538+00:00 +@@ -124,6 +124,3 @@ + "zerovec/serde", + ] + std = [] +- +-[target."cfg(not(target_arch = \"wasm32\"))".dev-dependencies.criterion] +-version = "0.5.0" diff --git a/SOURCES/rust-icu_collections.rpmlintrc b/SOURCES/rust-icu_collections.rpmlintrc new file mode 100644 index 0000000..2a74ae8 --- /dev/null +++ b/SOURCES/rust-icu_collections.rpmlintrc @@ -0,0 +1,4 @@ +# Feature metapackages are not supposed to have documentation! +addFilter(r"\+[-_\w]+-devel.noarch: W: no-documentation") +# Duplicate test data files are small and not worth attempting to hardlink +addFilter(r"files-duplicate .*/tests/data/") diff --git a/SOURCES/rust2rpm.toml b/SOURCES/rust2rpm.toml new file mode 100644 index 0000000..190c113 --- /dev/null +++ b/SOURCES/rust2rpm.toml @@ -0,0 +1,68 @@ +[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_arch = \"wasm32\"))', manual patching is easier. + "Drop benchmark-only criterion dependency", +] + +[[package.extra-patches]] +number = 10 +file = "icu_collections-1.5.0-no-postcard.patch" +comments = [ + """\ + Downstream-only: unconditionally skip compiling tests that would require \ + postcard.\ + """ +] +[[package.extra-patches]] +number = 11 +file = "icu_collections-1.5.0-no-icu-dev-dependency.patch" +comments = [ + """\ + Downstream-only: unconditionally skip compiling tests that would require \ + the circular (path-based) dev-dependency on the icu crate.\ + """ +] + +[features] +enable = [ + # Required for tests: + "databake", + "serde", +] + +[tests] +comments = [ + """\ + All doc tests use icu::collections, which would require the circular \ + (path-based) dev-dependency on the icu crate.\ + """, + """\ + Tests using databake may fail due to trivial differences in the string \ + representations of generated code, such as trailing commas without semantic \ + significance.\ + """, +] +run = [ + "lib", + "tests", +] +skip-exact = true +skip = [ + "codepointinvlist::cpinvlist::tests::databake", + "codepointtrie::cptrie::tests::databake", +] + +[requires] +build = [ + "tomcli", +] + +[scripts.prep] +pre = [ + "# Do not depend on postcard; it is needed only for one (skipped) test.", + "tomcli set Cargo.toml del dev-dependencies.postcard", + "# Avoid a dependency on the internal icu_benchmark_macros crate", + "rm -rv examples/", +] diff --git a/SPECS/rust-icu_collections.spec b/SPECS/rust-icu_collections.spec new file mode 100644 index 0000000..146334a --- /dev/null +++ b/SPECS/rust-icu_collections.spec @@ -0,0 +1,159 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.7.3) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 1; + 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 icu_collections + +Name: rust-icu_collections +Version: 1.5.0 +Release: %autorelease +Summary: Collection of API for use in ICU libraries + +License: Unicode-3.0 +URL: https://crates.io/crates/icu_collections +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * Drop benchmark-only criterion dependency +Patch: icu_collections-fix-metadata.diff +# * Downstream-only: unconditionally skip compiling tests that would require +# postcard. +Patch10: icu_collections-1.5.0-no-postcard.patch +# * Downstream-only: unconditionally skip compiling tests that would require the +# circular (path-based) dev-dependency on the icu crate. +Patch11: icu_collections-1.5.0-no-icu-dev-dependency.patch + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: tomcli + +%global _description %{expand: +Collection of API for use in ICU libraries.} + +%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}/LICENSE +%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}+bench-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+bench-devel %{_description} + +This package contains library source intended for building other packages which +use the "bench" feature of the "%{crate}" crate. + +%files -n %{name}+bench-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+databake-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+databake-devel %{_description} + +This package contains library source intended for building other packages which +use the "databake" feature of the "%{crate}" crate. + +%files -n %{name}+databake-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 + +%prep +%autosetup -n %{crate}-%{version} -p1 +# Do not depend on postcard; it is needed only for one (skipped) test. +tomcli set Cargo.toml del dev-dependencies.postcard +# Avoid a dependency on the internal icu_benchmark_macros crate +rm -rv examples/ +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires -f databake,serde + +%build +%cargo_build -f databake,serde + +%install +%cargo_install -f databake,serde + +%if %{with check} +%check +# * All doc tests use icu::collections, which would require the circular +# (path-based) dev-dependency on the icu crate. +# * Tests using databake may fail due to trivial differences in the string +# representations of generated code, such as trailing commas without semantic +# significance. +%{cargo_test -f databake,serde -- --lib -- --exact %{shrink: + --skip codepointinvlist::cpinvlist::tests::databake + --skip codepointtrie::cptrie::tests::databake +}} +%{cargo_test -f databake,serde -- --tests -- --exact %{shrink: + --skip codepointinvlist::cpinvlist::tests::databake + --skip codepointtrie::cptrie::tests::databake +}} +%endif + +%changelog +* Fri Dec 20 2024 MSVSphere Packaging Team - 1.5.0-1 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Tue Dec 10 2024 Benjamin A. Beasley - 1.5.0-1 +- Initial package (close RHBZ#2328487) +- Re-generate with rust2rpm 27 for a slightly nicer spec file +## END: Generated by rpmautospec