Blame SPECS/libpq.spec

4792ec
%global majorversion 13
650c73
%global obsoletes_version %( echo $(( %majorversion + 1 )) )
813fcf
813fcf
Summary: PostgreSQL client library
813fcf
Name: libpq
2db2cf
Version: %{majorversion}.5
699733
Release: 1%{?dist}
813fcf
813fcf
License: PostgreSQL
813fcf
Url: http://www.postgresql.org/
813fcf
650c73
Source0: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
650c73
Source1: https://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2.sha256
813fcf
813fcf
813fcf
# Comments for these patches are in the patch files.
813fcf
Patch1: libpq-10.3-rpm-pgsql.patch
813fcf
Patch2: libpq-10.3-var-run-socket.patch
4792ec
Patch3: libpq-13.1-symbol-versioning.patch
813fcf
813fcf
BuildRequires: gcc
813fcf
BuildRequires: glibc-devel bison flex gawk
813fcf
BuildRequires: zlib-devel
813fcf
BuildRequires: openssl-devel
813fcf
BuildRequires: krb5-devel
813fcf
BuildRequires: openldap-devel
813fcf
BuildRequires: gettext
813fcf
BuildRequires: multilib-rpm-config
813fcf
650c73
Obsoletes: postgresql-libs < %obsoletes_version
650c73
Provides: postgresql-libs = %version-%release
650c73
813fcf
813fcf
%description
813fcf
The libpq package provides the essential shared library for any PostgreSQL
813fcf
client program or interface.  You will need to install this package to use any
813fcf
other PostgreSQL package or any clients that need to connect to a PostgreSQL
813fcf
server.
813fcf
813fcf
813fcf
%package devel
813fcf
Summary: Development files for building PostgreSQL client tools
813fcf
Requires: %name%{?_isa} = %version-%release
813fcf
# Historically we had 'postgresql-devel' package which was used for building
813fcf
# both PG clients and PG server modules;  let's have this fake provide to cover
813fcf
# most of the depending packages and the rest (those which want to build server
813fcf
# modules) need to be fixed to require postgresql-server-devel package.
813fcf
Provides: postgresql-devel = %version-%release
650c73
Obsoletes: postgresql-devel < %obsoletes_version
813fcf
650c73
%description devel
813fcf
The libpq package provides the essential shared library for any PostgreSQL
813fcf
client program or interface.  You will need to install this package to build any
813fcf
package or any clients that need to connect to a PostgreSQL server.
813fcf
813fcf
813fcf
%prep
650c73
( cd "$(dirname "%SOURCE1")" ; sha256sum -c "%SOURCE1" )
650c73
%autosetup -n postgresql-%{version} -p1
813fcf
813fcf
# remove .gitignore files to ensure none get into the RPMs (bug #642210)
813fcf
find . -type f -name .gitignore | xargs rm
813fcf
813fcf
813fcf
%build
650c73
# complements symbol-versioning patch
813fcf
export SYMBOL_VERSION_PREFIX=RHPG_
813fcf
650c73
# We don't build server nor client (e.g. /bin/psql) binaries in this package, so
650c73
# we can disable some configure options.
813fcf
%configure \
650c73
    --disable-rpath \
650c73
    --with-ldap \
650c73
    --with-openssl \
650c73
    --with-gssapi \
650c73
    --enable-nls \
650c73
    --without-readline \
650c73
    --datadir=%_datadir/pgsql
813fcf
813fcf
%global build_subdirs \\\
650c73
        src/include \\\
650c73
        src/common \\\
650c73
        src/port \\\
650c73
        src/interfaces/libpq \\\
650c73
        src/bin/pg_config
813fcf
813fcf
for subdir in %build_subdirs; do
650c73
    %make_build -C "$subdir"
813fcf
done
813fcf
813fcf
813fcf
%install
813fcf
for subdir in %build_subdirs; do
650c73
    %make_install -C "$subdir"
813fcf
done
813fcf
813fcf
# remove files not to be packaged
650c73
find $RPM_BUILD_ROOT -name '*.a' -delete
813fcf
rm -r $RPM_BUILD_ROOT%_includedir/pgsql/server
813fcf
650c73
%multilib_fix_c_header --file "%_includedir/pg_config.h"
650c73
%multilib_fix_c_header --file "%_includedir/pg_config_ext.h"
813fcf
813fcf
find_lang_bins ()
813fcf
{
650c73
    lstfile=$1 ; shift
650c73
    cp /dev/null "$lstfile"
650c73
    for binary; do
650c73
        %find_lang "$binary"-%majorversion
650c73
        cat "$binary"-%majorversion.lang >>"$lstfile"
650c73
    done
813fcf
}
813fcf
650c73
find_lang_bins %name.lst        libpq5
650c73
find_lang_bins %name-devel.lst  pg_config
813fcf
813fcf
650c73
%files -f %name.lst
813fcf
%license COPYRIGHT
813fcf
%_libdir/libpq.so.*
813fcf
%dir %_datadir/pgsql
813fcf
%doc %_datadir/pgsql/pg_service.conf.sample
813fcf
813fcf
650c73
%files devel -f %name-devel.lst
813fcf
%_bindir/pg_config
813fcf
%_includedir/*
813fcf
%_libdir/libpq.so
813fcf
%_libdir/pkgconfig/libpq.pc
813fcf
813fcf
813fcf
%changelog
2db2cf
* Mon Nov 29 2021 Marek Kulik <mkulik@redhat.com> - 13.5-1
2db2cf
- Rebase to 13.5
2db2cf
  Resolves: #2023294
2db2cf
0f72e6
* Mon May 31 2021 Honza Horak <hhorak@redhat.com> - 13.3-1
0f72e6
- Rebase to 13.3
0f72e6
  Resolves: #1966146
0f72e6
4792ec
* Tue Feb 16 2021 Honza Horak <hhorak@redhat.com> - 13.2-1
4792ec
- Rebase to 13.2
4792ec
  Related: #1855776
4792ec
4792ec
* Tue Nov 17 2020 Patrik Novotný <panovotn@redhat.com> - 13.1-1
4792ec
- Rebase to upstream release 13.1
4792ec
  Resolves: BZ#1855776
4792ec
  (BZ#1856242 particuarly)
500610
500610
* Mon Aug 17 2020 Patrik Novotný <panovotn@redhat.com> - 12.4-1
699733
- Rebase to upstream release 12.4
699733
699733
* Tue Jun 16 2020 Patrik Novotný <panovotn@redhat.com> - 12.3-1
699733
- Rebase to upstream release 12.3
699733
650c73
* Tue Nov 19 2019 Patrik Novotný <panovotn@redhat.com> - 12.1-3
650c73
- Rebuild with rebased symbol versioning patch
650c73
650c73
* Fri Nov 15 2019 Patrik Novotný <panovotn@redhat.com> - 12.1-2
650c73
- Rebuild with rebased symbol versioning patch
650c73
650c73
* Tue Nov 12 2019 Patrik Novotný <panovotn@redhat.com> - 12.1-1
650c73
- Rebase to upstream release 12.1
650c73
650c73
* Fri Nov 08 2019 Honza Horak <hhorak@redhat.com> - 12.0-2
650c73
- Bump release for a new build with gating.yaml added
650c73
  Related: #1749461
650c73
650c73
* Thu Oct 03 2019 Patrik Novotný <panovotn@redhat.com> - 12.0-1
650c73
- Initial release for upstream version 12.0
650c73
813fcf
* Wed Aug 08 2018 Pavel Raiskup <praiskup@redhat.com> - 10.5-1
813fcf
- update to 10.5 per release notes:
813fcf
  https://www.postgresql.org/docs/10/static/release-10-5.html
813fcf
813fcf
* Fri Jul 13 2018 Pavel Raiskup <praiskup@redhat.com> - 10.4-2
813fcf
- ABI/symbol versioning
813fcf
813fcf
* Thu Jul 12 2018 Pavel Raiskup <praiskup@redhat.com> - 10.4-1
813fcf
- rebase to the latest upstream release
813fcf
813fcf
* Fri Apr 13 2018 Pavel Raiskup <praiskup@redhat.com> - 10.3-1
813fcf
- initial release, packaging inspired by postgresql.spec
813fcf
- provide postgresql-devel to avoid fixing all the client packages