%bcond check 1 Name: sqruff Version: 0.38.0 Release: 1%{?dist} Summary: SQL linter and formatter written in Rust # Cumulative SPDX over sqruff and every statically-linked crate. License: 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 AND ((MIT OR Apache-2.0) AND Unicode-3.0) AND (MIT OR LGPL-3.0-or-later) AND (Unlicense OR MIT) AND Zlib URL: https://github.com/quarylabs/sqruff Source0: %{url}/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz Source1: %{name}-%{version}-vendor.tar.xz # Hand-written: upstream ships no completions (no `completions` subcommand). Source2: _%{name} ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 24 # Vendoring turns off %%cargo_generate_buildrequires; sqruff links only # pure-Rust crates (no *-sys), so gcc for the final link is the only native dep. BuildRequires: gcc %description %{summary}. %prep %autosetup -n %{name}-%{version} -p1 tar -xJf %{SOURCE1} %cargo_prep -v vendor %build # Upstream's release profile uses fat LTO with a single codegen unit, which # exhausts memory and gets the linker OOM-killed in the clean-chroot gate. export CARGO_PROFILE_RPM_LTO=false # Build only the CLI: the workspace also holds a PyO3 extension (cli-python) # and a wasm crate (lib-wasm) that this package does not ship. %cargo_build -- -p %{name} %{cargo_vendor_manifest} %install install -Dpm0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} install -Dpm0644 %{SOURCE2} %{buildroot}%{zsh_completions_dir}/_%{name} %check %if %{with check} # The integration suite drives the binary through assert_cmd against snapshot # fixtures and assumes a cargo dev layout, so smoke-test the installed binary. %{buildroot}%{_bindir}/%{name} --version %endif %files %license LICENSE %license cargo-vendor.txt %doc README.md %doc docs # The compiled-in default config, shipped as a reference users copy to `.sqruff`. %doc crates/lib/src/core/default_config.cfg %{_bindir}/%{name} %{zsh_completions_dir}/_%{name} %changelog * Wed Jun 24 2026 Bahtiar `kalkin-` Gadimov - 0.38.0-1 - Initial package