File hypopg.spec of Package hypopg

#
# spec file for package hypopg
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%define         pg_name @BUILD_FLAVOR@%{nil}
%define         ext_name hypopg
%{pg_version_from_name}

Name:           %{pg_name}-%{ext_name}
Version:        1.4.2
Release:        0
Summary:        HypoPG is a PostgreSQL extension adding support for hypothetical indexes.
License:        MIT
Group:          Productivity/Databases/Tools
Url:            https://github.com/HypoPG/hypopg
Source:         https://github.com/HypoPG/hypopg/archive/refs/tags/%{version}.tar.gz#/%{ext_name}-%{version}.tar.gz

BuildRequires:  %{pg_name}-llvmjit-devel
%pg_server_requires
%if "%{pg_name}" == ""
ExclusiveArch:  do_not_build
%endif

%description
An hypothetical -- or virtual -- index is an index that doesn't really exists, and
thus doesn't cost CPU, disk or any resource to create.  They're useful to know
if specific indexes can increase performance for problematic queries, since
you can know if PostgreSQL will use these indexes or not without having to
spend resources to create them.

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

%build
%make_pgxs

%install
%make_install

%post
%{_datadir}/postgresql/install-alternatives %{pg_version}

%postun
%{_datadir}/postgresql/install-alternatives %{pg_version}

%files
%license LICENSE
%doc CHANGELOG.md README.md
%{pg_config_sharedir}/extension/%{ext_name}*
%{pg_config_pkglibdir}/%{ext_name}.so
%if %{postgresql_has_llvm}
%{pg_config_pkglibdir}/bitcode/*
%endif

%changelog
openSUSE Build Service is sponsored by