The package rpms/rust-coreutils.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/rust-coreutils.git/commit/?id=cc91c1....
Change: +%ifarch s390x
Thanks.
Full change: ============
commit cc91c146d367fc5359319e59f1dfd6de93febd83 Author: Michel Lind salimma@fedoraproject.org Date: Fri May 31 16:56:57 2024 -0500
Initial package (rhbz#2260598)
Signed-off-by: Michel Lind salimma@fedoraproject.org
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1678d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/coreutils-0.0.23.crate diff --git a/coreutils-drop-conv.diff b/coreutils-drop-conv.diff new file mode 100644 index 0000000..d120f8e --- /dev/null +++ b/coreutils-drop-conv.diff @@ -0,0 +1,13 @@ +--- a/tests/by-util/test_factor.rs ++++ b/tests/by-util/test_factor.rs +@@ -146,9 +146,7 @@ fn test_cli_args() { + + #[test] + fn test_random() { +- use conv::prelude::ValueFrom; +- +- let log_num_primes = f64::value_from(NUM_PRIMES).unwrap().log2().ceil(); ++ let log_num_primes = (NUM_PRIMES as f64).log2().ceil(); + let primes = Sieve::primes().take(NUM_PRIMES).collect::<Vec<u64>>(); + + let rng_seed = SystemTime::now() diff --git a/coreutils-fix-finding-uu_factor.diff b/coreutils-fix-finding-uu_factor.diff new file mode 100644 index 0000000..4487ddc --- /dev/null +++ b/coreutils-fix-finding-uu_factor.diff @@ -0,0 +1,11 @@ +--- a/tests/by-util/test_factor.rs ++++ b/tests/by-util/test_factor.rs +@@ -10,7 +10,7 @@ use crate::common::util::TestScenario; + + use std::time::{Duration, SystemTime}; + +-#[path = "../../src/uu/factor/sieve.rs"] ++#[path = "/usr/share/cargo/registry/uu_factor-0.0.23/sieve.rs"] + mod sieve; + + use self::sieve::Sieve; diff --git a/coreutils-fix-metadata.diff b/coreutils-fix-metadata.diff new file mode 100644 index 0000000..b4ce6ee --- /dev/null +++ b/coreutils-fix-metadata.diff @@ -0,0 +1,45 @@ +--- coreutils-0.0.23/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ coreutils-0.0.23/Cargo.toml 2024-02-27T21:32:15.020011+00:00 +@@ -30,6 +30,7 @@ + categories = ["command-line-utilities"] + license = "MIT" + repository = "https://github.com/uutils/coreutils" ++autobins = false + + [profile.release] + lto = true +@@ -47,11 +48,6 @@ + [[bin]] + name = "coreutils" + path = "src/bin/coreutils.rs" +- +-[[bin]] +-name = "uudoc" +-path = "src/bin/uudoc.rs" +-required-features = ["uudoc"] + + [dependencies.arch] + version = "0.0.23" +@@ -613,9 +609,6 @@ + ] + default-features = false + +-[dev-dependencies.conv] +-version = "0.3" +- + [dev-dependencies.filetime] + version = "0.2" + +@@ -671,7 +664,11 @@ + version = "0.11.2" + + [features] +-default = ["feat_common_core"] ++default = [ ++ "feat_common_core", ++ # "feat_selinux", ++ # "unix", ++] + feat_Tier1 = [ + "feat_common_core", + "arch", diff --git a/coreutils-fix-seq-neg-num-tests.diff b/coreutils-fix-seq-neg-num-tests.diff new file mode 100644 index 0000000..fd5da6e --- /dev/null +++ b/coreutils-fix-seq-neg-num-tests.diff @@ -0,0 +1,154 @@ +--- a/tests/by-util/test_seq.rs ++++ b/tests/by-util/test_seq.rs +@@ -391,97 +391,97 @@ fn test_width_negative_zero_decimal_nota + #[test] + fn test_width_negative_zero_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-0e0", "1"]) ++ .args(&["-w", "--", "-0e0", "1"]) + .succeeds() + .stdout_is("-0\n01\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2"]) ++ .args(&["-w", "--", "-0e0", "1", "2"]) + .succeeds() + .stdout_is("-0\n01\n02\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0e0", "1", "2.0"]) + .succeeds() + .stdout_is("-0\n01\n02\n") + .no_stderr(); + + new_ucmd!() +- .args(&["-w", "-0e+1", "1"]) ++ .args(&["-w", "--", "-0e+1", "1"]) + .succeeds() + .stdout_is("-00\n001\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2"]) ++ .args(&["-w", "--", "-0e+1", "1", "2"]) + .succeeds() + .stdout_is("-00\n001\n002\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2.0"]) ++ .args(&["-w", "--", "-0e+1", "1", "2.0"]) + .succeeds() + .stdout_is("-00\n001\n002\n") + .no_stderr(); + + new_ucmd!() +- .args(&["-w", "-0.000e0", "1"]) ++ .args(&["-w", "--", "-0.000e0", "1"]) + .succeeds() + .stdout_is("-0.000\n01.000\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2"]) + .succeeds() + .stdout_is("-0.000\n01.000\n02.000\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2.0"]) + .succeeds() + .stdout_is("-0.000\n01.000\n02.000\n") + .no_stderr(); + + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1"]) ++ .args(&["-w", "--", "-0.000e-2", "1"]) + .succeeds() + .stdout_is("-0.00000\n01.00000\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2"]) + .succeeds() + .stdout_is("-0.00000\n01.00000\n02.00000\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2.0"]) + .succeeds() + .stdout_is("-0.00000\n01.00000\n02.00000\n") + .no_stderr(); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_is("-000000\n0000001\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_is("-000000\n0000001\n0000002\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_is("-000000\n0000001\n0000002\n") + .no_stderr(); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_is("-000000\n0000001\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_is("-000000\n0000001\n0000002\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_is("-000000\n0000001\n0000002\n") + .no_stderr(); +@@ -525,7 +525,7 @@ fn test_width_decimal_scientific_notatio + #[test] + fn test_width_negative_decimal_notation() { + new_ucmd!() +- .args(&["-w", "-.1", ".1", ".11"]) ++ .args(&["-w", "--", "-.1", ".1", ".11"]) + .succeeds() + .stdout_is("-0.1\n00.0\n00.1\n") + .no_stderr(); +@@ -534,22 +534,22 @@ fn test_width_negative_decimal_notation( + #[test] + fn test_width_negative_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-1e-3", "1"]) ++ .args(&["-w", "--", "-1e-3", "1"]) + .succeeds() + .stdout_is("-0.001\n00.999\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-1.e-3", "1"]) ++ .args(&["-w", "--", "-1.e-3", "1"]) + .succeeds() + .stdout_is("-0.001\n00.999\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-1.0e-4", "1"]) ++ .args(&["-w", "--", "-1.0e-4", "1"]) + .succeeds() + .stdout_is("-0.00010\n00.99990\n") + .no_stderr(); + new_ucmd!() +- .args(&["-w", "-.1e2", "10", "100"]) ++ .args(&["-w", "--", "-.1e2", "10", "100"]) + .succeeds() + .stdout_is( + "-010 diff --git a/rust-coreutils.spec b/rust-coreutils.spec new file mode 100644 index 0000000..102796a --- /dev/null +++ b/rust-coreutils.spec @@ -0,0 +1,156 @@ +# Generated by rust2rpm 25 +%bcond_without check + +# cargo run manpage requires a lot of the optional crates +# we don't have yet +%bcond_with man + +%global crate coreutils + +Name: rust-coreutils +Version: 0.0.23 +Release: %autorelease +Summary: coreutils ~ GNU coreutils reimplementation in Rust + +License: MIT +URL: https://crates.io/crates/coreutils +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * don't use conv, unmaintained +# * drop uudoc, unneeded +# * TODO: enable feat_selinux +# * TODO: enable unix +Patch: coreutils-fix-metadata.diff +# Fix finding uu_factor, need to look in registry rather than relative path +Patch: coreutils-fix-finding-uu_factor.diff +# Fix test that uses conv +Patch: coreutils-drop-conv.diff +# Fix seq tests that pass negative numbers +Patch: coreutils-fix-seq-neg-num-tests.diff + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +coreutils ~ GNU coreutils (updated); implemented as universal (cross- +platform) utils, written in Rust.} + +%description %{_description} + +%package -n uutils-%{crate} +Summary: %{summary} +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# BSD-2-Clause +# CC0-1.0 +# ISC +# MIT +# MIT OR Apache-2.0 +# MIT-0 OR Apache-2.0 +# Unlicense OR MIT +License: MIT AND (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND CC0-1.0 AND ISC AND (MIT-0 OR Apache-2.0) AND (Unlicense OR MIT) +# LICENSE.dependencies contains a full license breakdown + +%description -n uutils-%{crate} %{_description} + +%files -n uutils-%{crate} +%license LICENSE +%license LICENSE.dependencies +%doc CODE_OF_CONDUCT.md +%doc CONTRIBUTING.md +%doc DEVELOPMENT.md +%doc README.md +%{_bindir}/uutils-%{crate} +%if %{with man} +%{_mandir}/man1/uu_* +%endif + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + +%if %{with man} +mkdir -p data/man/man1 + +for utility in \ + base32 \ + base64 \ + basename \ + basenc \ + cat \ + cksum \ + comm \ + cp \ + csplit \ + cut \ + date \ + df \ + dir \ + dircolors \ + dirname \ + dd \ + du \ + echo \ + env \ + expand \ + expr \ + factor \ + false \ + fmt \ + fold \ + hashsum \ + head \ + join \ + link \ + ln \ + ls \ + mkdir \ + mktemp \ + more \ + mv \ + nl \ + numfmt \ + od \ + paste \ + pr \ + printenv \ + printf \ +; do + target/rpm/coreutils manpage $utility > data/man/man1/uu_${utility}.1 +done +%endif + +%install +%cargo_install +mv %{buildroot}%{_bindir}/%{crate} %{buildroot}%{_bindir}/uutils-%{crate} +%if %{with man} +mkdir -p %{buildroot}%{_mandir}/man1 +cp -p data/man/man1/uu_* %{buildroot}%{_mandir}/man1/ +%endif + +%if %{with check} +%check +# * --test-threads 1: tests fail with permission denied error if run with too many threads +# * test_df: needs an actual filesystem to test +# * test_du: expected sublink/symlink in output +# * test_ls: need block/char device +# * test_od: endianness issue on s390x +# * test_seq: tolerances too tight +%ifarch s390x +%cargo_test -- -- --test-threads 1 --skip test_df::test_file_column_width_if_filename_contains_unicode_chars --skip test_df::test_nonexistent_file --skip test_df::test_output_file_specific_files --skip test_df::test_output_mp_repeat --skip test_df::test_output_option_without_equals_sign --skip test_df::test_total_label_in_correct_column --skip test_df::test_type_option_with_file --skip test_du::test_du_dereference_args --skip test_du::test_du_no_dereference --skip test_ls::test_device_number --skip test_tail::test_follow_when_files_are_pointing_to_same_relative_file_and_file_stays_same_size --skip test_seq::test_count_down_floats --skip test_seq::test_float_precision_increment --skip test_seq::test_inf_width --skip test_seq::test_neg_inf_width --skip test_seq::test_separator_and_terminator_floats --skip test_seq::test_width_decimal_scientific_notation_increment --skip test_seq::test_width_decimal_scientific_notation_trailing_zeros_end --skip test_seq::test_width_decimal_scientific_notation_trailing_zeros_increment --skip test_seq::test_width_floats --skip test_seq::test_width_negative_zero_decimal_notation --skip test_seq::test_width_negative_zero_scientific_notation --skip test_od::test_suppress_duplicates +%else +%cargo_test -- -- --test-threads 1 --skip test_df::test_file_column_width_if_filename_contains_unicode_chars --skip test_df::test_nonexistent_file --skip test_df::test_output_file_specific_files --skip test_df::test_output_mp_repeat --skip test_df::test_output_option_without_equals_sign --skip test_df::test_total_label_in_correct_column --skip test_df::test_type_option_with_file --skip test_du::test_du_dereference_args --skip test_du::test_du_no_dereference --skip test_ls::test_device_number --skip test_tail::test_follow_when_files_are_pointing_to_same_relative_file_and_file_stays_same_size --skip test_seq::test_count_down_floats --skip test_seq::test_float_precision_increment --skip test_seq::test_inf_width --skip test_seq::test_neg_inf_width --skip test_seq::test_separator_and_terminator_floats --skip test_seq::test_width_decimal_scientific_notation_increment --skip test_seq::test_width_decimal_scientific_notation_trailing_zeros_end --skip test_seq::test_width_decimal_scientific_notation_trailing_zeros_increment --skip test_seq::test_width_floats --skip test_seq::test_width_negative_zero_decimal_notation --skip test_seq::test_width_negative_zero_scientific_notation +%endif +%endif + +%changelog +%autochangelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..f37083d --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,34 @@ +[package] +summary = "coreutils ~ GNU coreutils reimplementation in Rust" + +[tests] +comments = [ + "--test-threads 1: tests fail with permission denied error if run with too many threads", + "test_df: needs an actual filesystem to test", + "test_du: expected sublink/symlink in output", + "test_ls: need block/char device", + "test_seq: tolerances too tight", +] +skip = [ + "test_df::test_file_column_width_if_filename_contains_unicode_chars", + "test_df::test_nonexistent_file", + "test_df::test_output_file_specific_files", + "test_df::test_output_mp_repeat", + "test_df::test_output_option_without_equals_sign", + "test_df::test_total_label_in_correct_column", + "test_df::test_type_option_with_file", + "test_du::test_du_dereference_args", + "test_du::test_du_no_dereference", + "test_ls::test_device_number", + "test_seq::test_count_down_floats", + "test_seq::test_float_precision_increment", + "test_seq::test_inf_width", + "test_seq::test_neg_inf_width", + "test_seq::test_separator_and_terminator_floats", + "test_seq::test_width_decimal_scientific_notation_increment", + "test_seq::test_width_decimal_scientific_notation_trailing_zeros_end", + "test_seq::test_width_decimal_scientific_notation_trailing_zeros_increment", + "test_seq::test_width_floats", + "test_seq::test_width_negative_zero_decimal_notation", + "test_seq::test_width_negative_zero_scientific_notation", +] diff --git a/series b/series new file mode 100644 index 0000000..3dfd16b --- /dev/null +++ b/series @@ -0,0 +1,3 @@ +coreutils-fix-finding-uu_factor.diff +coreutils-drop-conv.diff +coreutils-fix-seq-neg-num-tests.diff diff --git a/sources b/sources new file mode 100644 index 0000000..5d471e2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (coreutils-0.0.23.crate) = 216aa4acfe92867aea7bd9d11e8239c0adf1b7bc308c226d310f7f872c5353282837172e8096dda645905b084eadaae942f88084a7968ee989ec0fc47c8f7f1b