## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # integration tests (make installcheck) and pg_tests are impossible to run here since postgres hardcodes # where it looks for extensions, and the pgrx_tests package also requires root access to be installed and run # therefore, tests have to be turned off %bcond check 0 %global pgrx_version 0.14.3 %global pg_config %{_bindir}/pg_config Name: postgresql_anonymizer Version: 2.3.0 Release: %autorelease Summary: Mask or replace personally identifiable information (PII) or sensitive data License: PostgreSQL URL: https://gitlab.com/dalibo/%{name} Source0: https://gitlab.com/dalibo/%{name}/-/archive/%{version}/postgresql_anonymizer-%{version}.tar.gz Source1: https://github.com/pgcentralfoundation/pgrx/archive/refs/tags/v%{pgrx_version}.tar.gz Patch: anonymizer-cargo.patch Patch: pgrx.patch # rust-cee-scape, a dependency of pgrx, does not support other architectures ExclusiveArch: x86_64 aarch64 BuildRequires: rustfmt BuildRequires: clang BuildRequires: bison-devel BuildRequires: readline-devel BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: wget BuildRequires: ccache BuildRequires: postgresql-server BuildRequires: postgresql-server-devel BuildRequires: cargo-rpm-macros >= 26 Requires: postgresql %description PostgreSQL Anonymizer is an extension to mask or replace personally identifiable information (PII) or commercially sensitive data from a PostgreSQL database. The project has a declarative approach of anonymization. This means you can declare the masking rules using the PostgreSQL Data Definition Language (DDL) and specify your anonymization policy inside the table definition itself. %prep %setup -D -a 1 -q %{__mv} pgrx-%{pgrx_version} pgrx %{__rm} pgrx/Cargo.lock %autopatch -p1 %cargo_prep %generate_buildrequires cd pgrx %cargo_generate_buildrequires cd .. %cargo_generate_buildrequires %build %{__mkdir_p} $HOME/.cargo/bin cd pgrx # cannot build all of pgrx since pgrx-pg-sys depends on `cargo pgrx init` being called first %{__cargo} build -Z avoid-dev-deps --release --workspace --exclude pgrx-pg-sys --exclude pgrx cp target/release/cargo-pgrx $HOME/.cargo/bin cd .. cargo pgrx init --pg%{postgresql_major} %{pg_config} %make_build extension PG_CONFIG=%{pg_config} PGVER=pg%{postgresql_major} %install export TARGET_DIR=target/release/anon-pg%{postgresql_major}/ export COMMON_SHAREDIR=$(%{pg_config} --sharedir) export COMMON_PKGLIBDIR=$(%{pg_config} --pkglibdir) %{__mkdir_p} %{?buildroot}$COMMON_SHAREDIR/extension %{?buildroot}$COMMON_PKGLIBDIR # unfortunate hack around an impermissive makefile %make_install PG_CONFIG=%{pg_config} PGVER=pg%{postgresql_major} \ PG_SHAREDIR=%{?buildroot}$COMMON_SHAREDIR PG_PKGLIBDIR=%{?buildroot}$COMMON_PKGLIBDIR \ TARGET_SHAREDIR=$TARGET_DIR$COMMON_SHAREDIR TARGET_PKGLIBDIR=$TARGET_DIR$COMMON_PKGLIBDIR %if %{with check} %check %endif %files %{_libdir}/pgsql/anon.so %{_datadir}/pgsql/extension/anon--%{version}.sql %{_datadir}/pgsql/extension/anon.control %{_datadir}/pgsql/extension/anon %license LICENSE.md # not copying the docs/ folder since it is too large and contains no manfiles %doc AUTHORS.md CHANGELOG.md NEWS.md README.md %changelog ## START: Generated by rpmautospec * Sat Aug 16 2025 John Doe - 2.3.0-1 - Uncommitted changes ## END: Generated by rpmautospec