# 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 tealdeer Name: tealdeer Version: 1.9.0 Release: 1%{?dist} Summary: Fetch and show tldr help pages for many CLI commands License: (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 AND ISC) AND (Apache-2.0 OR ISC OR MIT) 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) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND Apache-2.0 AND BSD-3-Clause AND CDLA-Permissive-2.0 AND ISC AND MIT AND Zlib URL: https://crates.io/crates/tealdeer # 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 %global _description %{expand: Fetch and show tldr help pages for many CLI commands. Full featured offline client with caching support.} %description %{_description} %files %license LICENSE-APACHE %license LICENSE-MIT %license LICENSE.dependencies %doc README.md %{_bindir}/tldr %prep %autosetup -n %{crate}-%{version} -p1 # online-cargo build config — replaces terra's %%cargo_prep_online_sccache # (no external macro package involved). 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 -- --locked %if %{with check} %check %cargo_test %endif %changelog * Fri Sep 25 2026 ahsan - 1.9.0-1 - source build with the terra rust2rpm macro set (was: prebuilt-binary wrapper over the release binary)