Add versioned provide to the default version

Obsolete versioned is no more needed since only default stream provides
postgresql symbol
This commit is contained in:
Filip Janus 2024-02-05 15:04:15 +01:00
parent 9114cc0efe
commit ceda0e6f43

View File

@ -48,7 +48,7 @@
Summary: PostgreSQL client programs
Name: %{majorname}%{majorversion}
Version: %{majorversion}.1
Release: 4%{?dist}
Release: 5%{?dist}
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
# recognizes it as an independent license, so we do as well.
@ -175,16 +175,13 @@ BuildRequires: libselinux-devel
BuildRequires: libicu-devel
%endif
# Let's remove versioned provides in default version
# It should ensure that unversioned(default version) postgresql stream
# will be preferable to an versioned one.
# postgresql-16.0-1 will replace postgresql16-16.0-1
%if %?postgresql_default
%define obsoletes_postgresqlXX_if_default() %{expand:\
Obsoletes: postgresql%{majorversion}%{?1:-%{1}}\
%define postgresqlXX_if_default() %{expand:\
Provides: postgresql%{majorversion}%{?1:-%{1}} = %precise_version\
Provides: postgresql%{majorversion}%{?1:-%{1}}%{?_isa} = %precise_version\
}
%else
%define obsoletes_postgresqlXX_if_default() %{nil}
%define postgresqlXX_if_default() %{nil}
%endif
%define conflict_with_other_streams() %{expand:\
@ -196,7 +193,7 @@ Provides: %{pkgname} = %precise_version
Provides: %{pkgname}%{?_isa} = %precise_version
%conflict_with_other_streams
%obsoletes_postgresqlXX_if_default
%postgresqlXX_if_default
# https://bugzilla.redhat.com/1464368
# and do not provide pkgconfig RPM provides (RHBZ#1980992) and #2121696
@ -231,7 +228,7 @@ Requires(postun): glibc
Provides: %{pkgname}-private-libs = %precise_version
Provides: %{pkgname}-private-libs%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default private-libs
%postgresqlXX_if_default private-libs
%conflict_with_other_streams private-libs
%description -n %{pkgname}-private-libs
@ -250,7 +247,7 @@ Conflicts: libpq-devel
Provides: %{pkgname}-devel = %precise_version
Provides: %{pkgname}-devel%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default private-devel
%postgresqlXX_if_default private-devel
%conflict_with_other_streams private-devel
%description -n %{pkgname}-private-devel
@ -286,7 +283,7 @@ Provides: %{pkgname}-server%{?_isa} = %precise_version
# Provide symbol regardless version. This symbol is present in every single
# postgresql stream
%obsoletes_postgresqlXX_if_default server
%postgresqlXX_if_default server
%conflict_with_other_streams server
%description -n %{pkgname}-server
@ -302,7 +299,7 @@ Requires: %{pkgname}%{?_isa} = %precise_version
Provides: %{pkgname}-doc = %precise_version
Provides: %{pkgname}-docs = %precise_version
%obsoletes_postgresqlXX_if_default docs
%postgresqlXX_if_default docs
%conflict_with_other_streams docs
%description -n %{pkgname}-docs
@ -317,7 +314,7 @@ Requires: %{pkgname}%{?_isa} = %precise_version
Provides: %{pkgname}-contrib = %precise_version
Provides: %{pkgname}-contrib%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default contrib
%postgresqlXX_if_default contrib
%conflict_with_other_streams contrib
%description -n %{pkgname}-contrib
@ -347,7 +344,7 @@ Requires: %{pkgname}-private-devel
Provides: %{pkgname}-server-devel = %precise_version
Provides: %{pkgname}-server-devel%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default server-devel
%postgresqlXX_if_default server-devel
%conflict_with_other_streams server-devel
%description -n %{pkgname}-server-devel
@ -360,9 +357,6 @@ Requires: %{pkgname}-server = %precise_version
BuildArch: noarch
Provides: %{pkgname}-test-rpm-macros = %precise_version
%if %?postgresql_default
Obsoletes: postgresql%{majorversion}-test-rpm-macros
%endif
%conflict_with_other_streams test-rpm-macros
%description -n %{pkgname}-test-rpm-macros
@ -376,7 +370,7 @@ Requires: %{pkgname}-server-devel%{?_isa} = %precise_version
Provides: %{pkgname}-static = %precise_version
Provides: %{pkgname}-static%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default static
%postgresqlXX_if_default static
%conflict_with_other_streams static
%description -n %{pkgname}-static
@ -392,7 +386,7 @@ Provides: bundled(postgresql-server) = %prevversion
Provides: %{pkgname}-upgrade = %precise_version
Provides: %{pkgname}-upgrade%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default upgrade
%postgresqlXX_if_default upgrade
%conflict_with_other_streams upgrade
%description -n %{pkgname}-upgrade
@ -407,7 +401,7 @@ Requires: %{pkgname}-upgrade%{?_isa} = %precise_version
Provides: %{pkgname}-upgrade-devel = %precise_version
Provides: %{pkgname}-upgrade-devel%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default upgrade-devel
%postgresqlXX_if_default upgrade-devel
%conflict_with_other_streams upgrade-devel
%description -n %{pkgname}-upgrade-devel
@ -429,7 +423,7 @@ BuildRequires: perl(Data::Dumper)
Provides: %{pkgname}-plperl = %precise_version
Provides: %{pkgname}-plperl%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default plperl
%postgresqlXX_if_default plperl
%conflict_with_other_streams plperl
%description -n %{pkgname}-plperl
@ -446,7 +440,7 @@ Requires: %{pkgname}-server%{?_isa} = %precise_version
Provides: %{pkgname}-plpython3 = %precise_version
Provides: %{pkgname}-plpython3%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default python3
%postgresqlXX_if_default python3
%conflict_with_other_streams python3
%description -n %{pkgname}-plpython3
@ -463,7 +457,7 @@ Requires: %{pkgname}-server%{?_isa} = %precise_version
Provides: %{pkgname}-pltcl = %precise_version
Provides: %{pkgname}-pltcl%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default pltcl
%postgresqlXX_if_default pltcl
%conflict_with_other_streams plctl
%description -n %{pkgname}-pltcl
@ -482,7 +476,7 @@ Requires: %{pkgname}-contrib%{?_isa} = %precise_version
Provides: %{pkgname}-test = %precise_version
Provides: %{pkgname}-test%{?_isa} = %precise_version
%obsoletes_postgresqlXX_if_default test
%postgresqlXX_if_default test
%conflict_with_other_streams test
%description -n %{pkgname}-test
@ -506,7 +500,7 @@ Provides: %{pkgname}-llvmjit%{?_isa} = %precise_version
BuildRequires: llvm-devel >= 5.0 clang-devel >= 5.0
%obsoletes_postgresqlXX_if_default llvmjit
%postgresqlXX_if_default llvmjit
%conflict_with_other_streams llvmjit
%description -n %{pkgname}-llvmjit
@ -1352,6 +1346,11 @@ make -C postgresql-setup-%{setup_version} check
%changelog
* Mon Feb 5 2024 Filip Janus <fjanus@redhat.com> - 16.1-5
- Add versioned provide to the default version
- Obsolete versioned is no more needed since only default stream provides
postgresql symbol
* Wed Jan 31 2024 Pete Walter <pwalter@fedoraproject.org> - 16.1-4
- Rebuild for ICU 74