File postgresql_anonymizer.spec of Package postgresql_anonymizer

#
# spec file for package postgresql_anonymizer
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define         pg_name  @BUILD_FLAVOR@%{nil}
%define         ext_name postgresql_anonymizer



Version:        2.5.1
Release:        0
%if "%{pg_name}" == ""
BuildArch:      noarch
Name:           %{ext_name}
%else
Name:           %{pg_name}-%{ext_name}
BuildRequires:  %{pg_name}-pgrx
%{pg_version_from_name}
%pg_server_requires
%endif

Summary:        Anonymization & Data Masking for Postgres
License:        PostgreSQL
URL:            https://postgresql-anonymizer.readthedocs.io/en/stable/
Source0:        https://gitlab.com/dalibo/postgresql_anonymizer/-/archive/%{version}/postgresql_anonymizer-%{version}.tar.bz2
Source1:        vendor.tar.zst
Source99:       _service
BuildRequires:  zstd
# BuildSystem:    pgrx
# BuildOption(install): --features=pg%{pg_version}
# BuildOption(prep): -a1
# BuildOption(prep): -n %{ext_name}-%{version}

%description
PostgreSQL Anonymizer is an extension to mask or replace personally
identifiable information (PII) or commercially sensitive data from a Postgres
database.

%prep
%autosetup -p1 -a1 -n %{ext_name}-%{version}

%if "%{pg_name}" == ""
%build
rm docs/.editorconfig

%install

%package docs
Summary:        Documentation for Anonymization & Data Masking for Postgres
%description docs
PostgreSQL Anonymizer is an extension to mask or replace personally
identifiable information (PII) or commercially sensitive data from a Postgres
database.

%files docs
%license LICENSE.md
%doc docs
%doc examples

%else
%build
%pgrx_init

%install
%pgrx_package --features=pg%{pg_version}

%files
%license LICENSE.md
%doc AUTHORS.md  CHANGELOG.md  CONTRIBUTING.md  NEWS.md  README.md
%{pg_config_pkglibdir}/anon.so
%{pg_config_sharedir}/extension/anon*
%endif

%changelog
openSUSE Build Service is sponsored by