# Built from a vendored crate bundle (offline); no debuginfo from the cargo build. %global debug_package %{nil} Name: leangz Version: 0.1.20 Release: 2%{?dist} Summary: Compressor/archiver for Lean 4 .olean files (provides leangz and leantar) # leangz itself is Apache-2.0; the vendored Rust crates carry the usual mix. License: Apache-2.0 AND (MIT OR Apache-2.0) AND Unicode-3.0 AND BSD-3-Clause AND MIT AND Zlib URL: https://github.com/digama0/leangz Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # Offline crate bundle: produced with `cargo vendor` (70 crates). Regenerate on # version bump with: cargo vendor --versioned-dirs vendor && tar czf vendor %global copr_lookaside https://copr-dist-git.fedorainfracloud.org/repo/pkgs/mhough/neurofedora/%{name} # The cargo-vendor bundle is not an upstream artifact -- it is produced locally # with `cargo vendor` -- so a bare filename leaves rpkg nothing to fetch and every # SCM build dies at SRPM time with "Bad file: ...-vendor.tar.gz: No such file". # It is already in this project's COPR dist-git lookaside, so point at it by URL, # the same way opencv.spec does. Regenerate + re-upload on a version bump. Source1: %{copr_lookaside}/%{name}-%{version}-vendor.tar.gz/md5/5b01c73167baeed88f8c1b48a6b6ddbd/%{name}-%{version}-vendor.tar.gz BuildRequires: cargo BuildRequires: rust # zstd-sys compiles its bundled zstd C source via the cc crate. BuildRequires: gcc # The vendored crates are compiled in statically (Rust); declare the notable ones. Provides: bundled(crate(zstd)) = 0.13.3 Provides: bundled(zstd) = 1.5.7 Provides: bundled(crate(rayon)) = 1.7 Provides: bundled(crate(serde)) = 1.0 %description leangz is a (de)compressor and archiver for Lean 4 .olean files. It ships two tools: * leangz — compress/decompress individual .olean files * leantar — pack/unpack collections of .olean files into .ltar archives leantar is the tool the Lean 4 build system uses to (un)pack precompiled library archives; this package provides it for an offline, from-source Lean 4 build (replacing the prebuilt binary Lean would otherwise download). %prep %autosetup -n %{name}-%{version} # Unpack the vendored crates and point cargo at them (fully offline build). tar -xzf %{SOURCE1} mkdir -p .cargo cat > .cargo/config.toml <<'EOF' [source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "vendor" EOF %build export CARGO_HOME=.cargo cargo build --release --offline --locked --bins %install install -d %{buildroot}%{_bindir} install -m 0755 target/release/leangz %{buildroot}%{_bindir}/leangz install -m 0755 target/release/leantar %{buildroot}%{_bindir}/leantar %check # Smoke-test that the binaries run. ./target/release/leangz --help >/dev/null 2>&1 || ./target/release/leangz 2>/dev/null || : ./target/release/leantar --help >/dev/null 2>&1 || ./target/release/leantar 2>/dev/null || : %files %license LICENSE %{_bindir}/leangz %{_bindir}/leantar %changelog * Sat Sep 12 2026 Morgan Hough - 0.1.20-1 - Reconcile git spec with shipped 0.1.20 (build 10755672, all chroots) to clear version-drift * Sat Jun 20 2026 Morgan Hough - 0.1.19-1 - Initial package: leangz 0.1.19 (digama0/leangz), providing the leangz and leantar Lean 4 .olean (de)compression tools. Built offline from a vendored crate bundle. First prerequisite for packaging the Lean 4 toolchain (Lean's build otherwise downloads a prebuilt leantar binary, which Fedora/COPR forbid).