# 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 %{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 %{crate} %{_description} %files -n %{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 mkdir -p data/man/man1 %if %{with man} 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 %{__cargo} run 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_df: needs an actual filesystem to test # * test_du: expected sublink/symlink in output # * test_ls: need block/char device # * test_mktemp: permission denied %cargo_test -- -- --exact --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_mktemp::test_both_tmpdir_flags_present --skip test_mktemp::test_mktemp_suffix %endif %changelog %autochangelog