File pg_oidc_validator.spec of Package pg_oidc_validator

#
# spec file for package pg_oidc_validator
#
# Copyright (c) 2025 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   pg_oidc_validator
%{pg_version_from_name}

%bcond_with    meson

%if 0%{?suse_version} && 0%{?suse_version} < 1550
%global force_gcc_version 14
%endif

Name:           %{pg_name}-%{ext_name}
Version:        0
Release:        0
Summary:        OAuth validator for PostgreSQL
License:        Apache-2.0
Group:          Productivity/Databases/Tools
URL:            https://github.com/Percona-Lab/pg_oidc_validator
# Source:         https://github.com/Percona-Lab/%{ext_name}/archive/%{version}/%{ext_name}-%{version}.tar.gz
Source:         %{ext_name}-%{version}.tar.zst
%if 0%{?force_gcc_version}
Patch1:         really-force-gcc14.patch
%endif
BuildRequires:  gcc%{?force_gcc_version}-c++
BuildRequires:  zstd
BuildRequires:  %{pg_name}-server-devel
BuildRequires:  meson
BuildRequires:  pkgconfig(libcurl)
%pg_server_requires
%if "%{pg_name}" == ""
ExclusiveArch:  do_not_build
Name:           %{ext_name}
%endif

%description
OAuth validator library for PostgreSQL 18

NOTE: This library is still experimental and not intended for production use.

This library should support most providers that implement OIDC and provide a
valid JWT as an access token.

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

%build
%if 0%{?force_gcc_version}
export CC="gcc-%{?force_gcc_version}"
export CXX="g++-%{?force_gcc_version}"
%endif
%if %{with meson}
%meson
%meson_build
%else
%make_pgxs
%endif

%install
%if %{with meson}
%meson_install
%else
%make_install USE_PGXS=1
%endif

%files
%license LICENSE.txt
%doc README.md
%{pg_config_pkglibdir}/%{ext_name}*.so
#{pg_config_sharedir}/extension/#{ext_name}*

%changelog
openSUSE Build Service is sponsored by