%bcond check 1 Name: cargo-pgrx Version: 0.18.0 Release: 1%{?dist} Summary: Cargo subcommand for managing pgrx-based Postgres extensions # Cumulative SPDX over cargo-pgrx and every statically-linked crate. License: ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 AND ISC) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR BSL-1.0 OR MIT) 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 (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND CDLA-Permissive-2.0 AND ISC AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT) AND Zlib AND (Zlib OR Apache-2.0 OR MIT) AND bzip2-1.0.6 URL: https://github.com/pgcentralfoundation/pgrx Source0: %{crates_source} Source1: %{name}-%{version}-vendor.tar.xz # The published crate omits the license text; fetch it from the matching tag. Source2: %{url}/raw/v%{version}/LICENSE # Hand-written: upstream ships no completion generator. Source3: _%{name} ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 24 # Vendoring turns off %%cargo_generate_buildrequires, so the native deps that # the linked *-sys crates pull are added by hand: gcc builds ring's C/asm and # the bundled zstd/bzip2 C and links the binary; openssl-devel satisfies # openssl-sys, which ureq's native-tls backend pulls in the default feature set. BuildRequires: gcc BuildRequires: pkgconfig(openssl) # Upstream ships no man page; generate one from --help. BuildRequires: help2man # cargo-pgrx is a cargo subcommand and shells out to cargo for every build, # install and test; the auto-generated deps only see linked libraries. Requires: cargo %description cargo-pgrx is a Cargo subcommand for managing pgrx-based PostgreSQL extensions written in Rust: scaffolding an extension crate, building and installing it against a pg_config-selected Postgres, generating its SQL schema, and running its test and regression suites. It is a build-time tool only. %prep %autosetup -n %{name}-%{version} -p1 # The published crate omits the license text; stage the tag's copy for %%license. cp -p %{SOURCE2} LICENSE tar -xJf %{SOURCE1} %cargo_prep -v vendor %build %cargo_build %{cargo_vendor_manifest} # cargo-pgrx is a cargo subcommand: the real command tree lives behind `pgrx`, # so point help2man there to capture every subcommand in the synopsis. LC_ALL=C help2man --no-info --no-discard-stderr \ --name='Cargo subcommand for managing pgrx-based Postgres extensions' \ --version-string='%{version}' \ 'target/rpm/%{name} pgrx' >%{name}.1 %install install -Dpm0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} install -Dpm0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 install -Dpm0644 %{SOURCE3} %{buildroot}%{zsh_completions_dir}/_%{name} %check %if %{with check} # The bundled test (install_pg_test_regression) drives a real Postgres through # `cargo pgrx`, which the clean chroot has no way to provide, so smoke-test the # installed binary instead. %{buildroot}%{_bindir}/%{name} pgrx --version %endif %files %license LICENSE %license cargo-vendor.txt %doc README.md %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{zsh_completions_dir}/_%{name} %changelog * Tue Jun 30 2026 Bahtiar `kalkin-` Gadimov - 0.18.0-1 - Initial package