# Generated by rust2rpm 28 %bcond check 1 %if 0%{?el9} || 0%{?amzn} # systemd is too old %bcond systemd_logind 0 %else %bcond systemd_logind 1 %endif %if %{with systemd_logind} %global feature_flags feat_acl,feat_os_unix,feat_selinux,feat_systemd_logind,uudoc %else %global feature_flags feat_acl,feat_os_unix,feat_selinux,uudoc %endif # Peak memory usage is (on x86_64) roughly 4–5 GB in two parallel rustc # processes, building the uudoc and coreutils crates. This is OK on the # primary-architecture koji builders, but on more severely memory-constrained # systems (like some in RISC-V koji) this may cause swapping or memory # exhaustion. Setting a conservative memory limit per process helps. %global _smp_tasksize_proc 8192 %global crate coreutils %global _trivial .0 %global _buildid .1 %global __brp_mangle_shebangs /usr/bin/true Name: rust-coreutils Version: 0.7.0 Release: 1%{?dist}%{?_trivial}%{?_buildid} Summary: coreutils ~ GNU coreutils reimplementation in Rust License: MIT URL: https://crates.io/crates/coreutils Source: %{name}-%{version}-processed.tar.gz # Manually created patch for downstream crate metadata changes # * loosen selinux version bound from =0.6.0 to 0.6.0 # leaf package, SIGABRT on compile ExcludeArch: %{ix86} BuildRequires: rust-toolset BuildRequires: clang-devel BuildRequires: llvm BuildRequires: libselinux-devel BuildRequires: libacl-devel BuildRequires: systemd-devel BuildRequires: openssl-devel %if %{with systemd_logind} BuildRequires: systemd-devel %endif %global _description %{expand: coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust.} %description %{_description} %package -n uutils-coreutils Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # (MIT OR Apache-2.0) AND Zlib # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # Apache-2.0 OR Apache-2.0 WITH LLVM-exception # Apache-2.0 OR GPL-2.0-only # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause # BSD-2-Clause OR Apache-2.0 OR MIT # BSD-3-Clause # CC0-1.0 # ISC # MIT # MIT OR Apache-2.0 # MIT OR Zlib OR Apache-2.0 # MIT-0 OR Apache-2.0 # Unicode-3.0 # Unlicense OR MIT # Zlib License: %{shrink: (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT) } # LICENSE.dependencies contains a full license breakdown %description -n uutils-coreutils %{_description} %files -n uutils-coreutils %license LICENSE %license LICENSE.dependencies %license cargo-vendor.txt %doc CODE_OF_CONDUCT.md %doc CONTRIBUTING.md %doc DEVELOPMENT.md %doc README.md %doc README.package.md %doc SECURITY.md %{_bindir}/uutils-coreutils %{_bindir}/uu_* %{_mandir}/man1/* %{bash_completions_dir}/* %{fish_completions_dir}/* %{zsh_completions_dir}/* %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep -v vendor %build export OPENSSL_NO_VENDOR=1 %cargo_build -f %{feature_flags} %{cargo_license_summary -f %{feature_flags}} %{cargo_vendor_manifest} %{cargo_license -f %{feature_flags}} > LICENSE.dependencies mkdir -p data/man/man1 mkdir -p data/completions/{bash,fish,zsh} for utility in $(target/rpm/coreutils --list); do target/release/uudoc manpage $utility > data/man/man1/uu_${utility}.1 for s in bash zsh; do target/release/uudoc completion $utility $s > data/completions/$s/uu_${utility} done target/release/uudoc completion $utility fish > data/completions/fish/uu_${utility}.fish done target/release/uudoc manpage coreutils > data/man/man1/uutils-coreutils.1 for s in bash zsh; do target/release/uudoc completion coreutils $s > data/completions/$s/uutils-coreutils done target/release/uudoc completion coreutils fish > data/completions/fish/uutils-coreutils.fish %install %cargo_install -f %{feature_flags} mv %{buildroot}/%{_bindir}/coreutils %{buildroot}/%{_bindir}/uutils-coreutils for utility in $(target/rpm/coreutils --list); do ln -sr %{buildroot}%{_bindir}/uutils-coreutils %{buildroot}%{_bindir}/uu_$utility done mkdir -p %{buildroot}%{_mandir}/man1 cp -p data/man/man1/* %{buildroot}%{_mandir}/man1/ mkdir -p %{buildroot}%{bash_completions_dir} mkdir -p %{buildroot}%{fish_completions_dir} mkdir -p %{buildroot}%{zsh_completions_dir} cp -p data/completions/bash/* %{buildroot}%{bash_completions_dir}/ cp -p data/completions/fish/* %{buildroot}%{fish_completions_dir}/ cp -p data/completions/zsh/* %{buildroot}%{zsh_completions_dir}/ # unneeded, and contain compiled fixtures rm -rf %{buildroot}%{crate_instdir}/tests # unneeded at runtime rm %{buildroot}%{_bindir}/uudoc %if %{with check} %check # * --test-threads 1: tests fail with permission denied error if run with too # many threads (currently not needed) # * common::util::tests::test_compare_xattrs: operation not supported # * test_chcon / test_runcon: SELinux not supported in mock # * test_cp: operation not supported # * test_df: needs an actual filesystem to test # * test_du: expected sublink/symlink in output # * test_ls: need block/char device # * test_od: s390x failures, see # https://github.com/uutils/coreutils/issues/9017#issuecomment-4148721220 # * test_seq: tolerances too tight # * test_sort: formatting differences with recent unicode-width versions # * uudoc: missing test fixture # * various color and localization tests %{cargo_test -f %{feature_flags} -- -- %{shrink: --skip common::util::tests::test_compare_xattrs --skip test_chcon:: --skip test_runcon:: --skip test_cp::test_copy_dir_preserve_permissions --skip test_cp::test_copy_dir_preserve_permissions_inaccessible_file --skip test_cp::test_copy_dir_preserve_subdir_permissions --skip test_cp::test_copy_through_dangling_symlink_no_dereference_permissions --skip test_cp::test_cp_current_directory_preserve_attributes --skip test_cp::test_cp_debug_reflink_auto_sparse_always_non_sparse_file_with_long_zero_sequence --skip test_cp::test_cp_parents_2_dirs --skip test_cp::test_cp_parents_with_permissions_copy_dir --skip test_cp::test_cp_parents_with_permissions_copy_file --skip test_cp::test_cp_preserve_xattr --skip test_cp::test_cp_sparse_always_empty --skip test_cp::test_cp_sparse_always_non_empty --skip test_cp::test_preserve_hardlink_attributes_in_directory --skip test_cp::test_preserve_mode --skip test_df::test_exclude_all_types --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_env::test_env_french --skip test_ls::test_device_number --skip test_ls::test_localized_possible_values --skip test_ls::test_ls_allocation_size --skip test_ls::test_ls_inode --skip test_ls::test_ls_long_format --skip test_ls::test_ls_long_formats %ifarch s390x --skip test_od::test_od_options_after_filename --skip test_od::test_suppress_duplicates %endif --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_sort::test_argument_suggestion --skip test_sort::test_clap_localization_help_message --skip test_sort::test_clap_localization_invalid_value --skip test_sort::test_clap_localization_unknown_argument --skip test_sort::test_error_colors_disabled --skip test_sort::test_error_colors_enabled --skip test_sort::test_french_translations --skip test_sort::test_help_colors_disabled --skip test_sort::test_help_colors_enabled --skip test_sort::test_keys_closed_range --skip test_sort::test_keys_multiple_ranges --skip test_sort::test_keys_no_field_match --skip test_sort::test_keys_open_ended --skip test_tail::test_follow_name_truncate4 --skip test_tail::test_retry7 --skip test_tail::test_retry9 --skip test_error_messages_french_translation --skip test_french_colored_error_messages --skip test_help_messages_french_translation --skip uudoc_check_sums --skip uudoc_check_test }} %endif %changelog * Fri Jul 03 2026 AL2023 rebuild - %{version}-1 - AL2023 rust-toolset vendored binary build