# Generated by rust2rpm 28, adapted to this repo's conventions: # spelled-out crates.io Source URL (the CI submit job fetches sources before # buildroot macros exist), online cargo prep/license macros (inline in this # spec), tests disabled, explicit Release + changelog. %undefine __brp_mangle_shebangs %define debug_package %{nil} # no debuginfo in the compiled objects either — nothing consumes it and it # is a large share of compile time on big dependency trees %define rustflags_debuginfo 0 %bcond check 0 %global crate eza Name: eza Version: 0.23.5 Release: 1%{?dist} Summary: Modern replacement for ls License: ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR CC0-1.0) AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND EUPL-1.2 AND MIT AND MPL-2.0 URL: https://crates.io/crates/eza # the crates.io download URL spelled out: mock fetches sources at # SRPM-build time, before any buildroot macro exists Source0: https://static.crates.io/crates/%{crate}/%{crate}-%{version}.crate BuildRequires: cargo-rpm-macros >= 24 BuildRequires: mold # compilation cache server — its cache dir lives on the workspace via the # mock config's bind mount, shared across all rust source builds BuildRequires: sccache BuildRequires: cmake %global _description %{expand: A modern replacement for ls.} %description %{_description} %files %license LICENSE.txt %license LICENSES/CC-BY-4.0.txt %license LICENSES/EUPL-1.2.txt %license LICENSES/MIT.txt %license LICENSE.dependencies %doc CHANGELOG.md %doc CODE_OF_CONDUCT.md %doc CONTRIBUTING.md %doc INSTALL.md %doc README.md %doc SECURITY.md %doc TESTING.md %{_bindir}/eza %prep %autosetup -n %{crate}-%{version} -p1 # upstream's Cargo.lock pairs palette 0.7.5 with palette_derive 0.7.7, whose # generated code no longer compiles against it (xyz.meta / lms errors) — pin # the derive to the matching 0.7.6. cargo_install must NOT get --locked: # the pin changes the resolution and --locked would reject it, while -Z # avoid-dev-deps would drift past the lock again (CI 2026-09-25). cat >> Cargo.toml <<'EOF' [dependencies.palette_derive] version = "=0.7.6" EOF # online-cargo build config — replaces terra's %%cargo_prep_online_sccache # (anda-srpm-macros is no longer a build input). Same shape: the [profile.rpm] # the Fedora cargo macros build with, the redhat flag env, sccache as the # rustc wrapper, the install root — with no [net] offline and no # local-registry replacement, so crates fetch from crates.io at build time. %{expand:%{!?_cargo_home:%%global _cargo_home %{rpmbuilddir}%{?buildsubdir:/%{buildsubdir}}/.cargo}} %global __sccache %{_bindir}/sccache mkdir -p %{_cargo_home} target/rpm ln -s rpm target/release cat > %{_cargo_home}/config.toml <<'EOF' [profile.rpm] inherits = "release" opt-level = %{rustflags_opt_level} codegen-units = %{rustflags_codegen_units} debug = %{rustflags_debuginfo} strip = "none" [build] rustc = "%__rustc" rustdoc = "%__rustdoc" rustc-wrapper = "%__sccache" [env] CFLAGS = "%build_cflags" CXXFLAGS = "%build_cxxflags" LDFLAGS = "%build_ldflags" [install] root = "%buildroot%{_prefix}" [term] verbose = true EOF rm -f Cargo.toml.orig %{expand:%global __cargo /usr/bin/env CARGO_HOME=%{_cargo_home} RUSTC_BOOTSTRAP=1 RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo} %build # cache dir on the workspace bind mount (see mock config) — survives across # builds and is shared by every rust source build export SCCACHE_DIR=/sccache # license reports (terra's cargo_license_*_online logic, inline): the # cargo-to-rpm license commands hardcode --offline, which breaks the # online build %{__cargo} tree -Z avoid-dev-deps --workspace --edges no-build,no-dev,no-proc-macro \ --no-dedupe --target all --prefix none --format "# {l}" | sort -u %{__cargo} tree -Z avoid-dev-deps --workspace --edges no-build,no-dev,no-proc-macro \ --no-dedupe --target all --prefix none --format "{l}: {p}" \ | sed -e "s: (proc-macro)::" | sort -u > LICENSE.dependencies %install export SCCACHE_DIR=/sccache %cargo_install # the crate is a lib+bin crate, so cargo_install copies the crate # source into the cargo registry for a -devel subpackage; the devel # subpackages are dropped here (plain package names, bin-only), so # the registry copy goes with them rm -rf %{buildroot}%{_datadir}/cargo/registry/%{crate}-%{version} %if %{with check} %check %cargo_test %endif %changelog * Fri Sep 25 2026 ahsan - 0.23.5-1 - source build with the terra rust2rpm macro set (was: prebuilt-binary wrapper over the release binary)