File dba-postgresql-1610.spec of Package dba-postgresql-1610

#
# spec file for package postgresql
#

%define maketest 0

%define real_name       postgresql
%define version         16.10
%define vers            %(echo %{version} | tr -d '.')
%define prefix          /DBA/postgresql/%{version}

%define with_uuid 0
%define with_dbassl 1
%define latest_script set_postgresql_16.latest.sh
%define _build_id_links none

# exclude any non dba-* provides
%global __provides_exclude ^.*$

Name:           dba-%{real_name}-%{vers}
Summary:       	PostgreSQL Server %{version}
Vendor:         openSUSE Build Service
License:        BSD-3-Clause 
Version:        %{version}
Release:        1
Group:          Productivity/Databases/Tools
Url:            http://www.postgresql.org/
Source0:        postgresql-%version.tar.bz2
Source1:        postgresql-%version.tar.bz2.md5
Source2:        postgresql-README.SuSE.de
Source3:        postgresql-README.SuSE.en
Source8:        postgresql-sysconfig
Source9:        postgresql-init
Source10:	%{latest_script}
Source15:       postgresql-bashprofile
Source16:       postgresql-firewall
Source17:       postgresql-rpmlintrc
BuildRoot:      %{_tmppath}/%{real_name}-%{version}-build

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c dba-openssl-101e
#!BuildIgnore:  nspr dba-geoip-148 dba-geoip-160
#!BuildIgnore:  dba-libxml2-290

BuildRequires:  bison flex gettext-devel libxslt-devel
BuildRequires:  pam-devel readline-devel zlib-devel
BuildRequires:  libicu-devel

%if  0%{?centos_version} >=900 
BuildRequires:       openldap-devel
%else
BuildRequires:       openldap2-devel
%endif

BuildRequires:  ncurses-devel
BuildRequires:	libxml2-devel
%if %{with_dbassl}
BuildRequires:  dba-openssl-313-static
 %define ssldir /DBA/openssl/3.1.3
%else
BuildRequires:  openssl-devel
%endif
%if 0%{?centos_version} || 0%{?fedora_version} || 0%{?rhel_version}
Requires:       glibc-common
%else
Requires:       glibc-locale
%endif

%if 0%{?centos_version} >=600 || 0%{?fedora_version} || 0%{?rhel_version} >=600 || 0%{?suse_version} >=1100
%define with_uuid 1
%endif

%if %{with_uuid}
BuildRequires:  libuuid-devel
%endif

%if 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600 || 0%{?fedora_version}
BuildRequires:  perl(ExtUtils::MakeMaker) perl(ExtUtils::Embed)
%endif

%if 0%{?sles_version} != 9
BuildRequires:  krb5-devel
%endif

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif

BuildConflicts:	postgresql-devel


%description
PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, and user-defined
types and functions.

This package contains the basic utility and client programs necessary
to maintain and work with local or remote PostgreSQL databases as well
as manual pages for the SQL commands that PostgreSQL supports. Full
HTML documentation for PostgreSQL can be found in the postgresql-docs
package.



Authors:
--------
    Marc G. Fournier <scrappy@hub.org>
    Tom Lane <tgl@sss.pgh.pa.us>
    Vadim B. Mikheev <vadim4o@yahoo.com>
    Bruce Momjian <pgman@candle.pha.pa.us>
    Jan Wieck <JanWieck@Yahoo.com>


%prep
sed -i -e 's/ .*$//g' %{SOURCE1}
md5sum %{SOURCE0} | awk '{print $1;}' | cmp - %{SOURCE1}
%setup -q -n %{real_name}-%{version}


%build
export CFLAGS="%optflags $SP"
# uncomment the following line to enable the stack protector

%if %{with_uuid}
# CFLAGS="$CFLAGS -I/DBA/uuid/1.6.2/include"
# LDFLAGS="$LDFLAGS -L/DBA/uuid/1.6.2/lib -luuid"
%endif

%if 0%{?sles_version} >= 10
CFLAGS="$CFLAGS -fstack-protector"
%endif

%if %{with_dbassl}
export PATH=%{ssldir}/bin:$PATH
export CFLAGS="$CFLAGS -I%{ssldir}/include"
export LDFLAGS="$LDFLAGS -L/%{ssldir}/lib64"
%endif

./configure \
	--prefix=%prefix \
	--disable-rpath \
	--enable-nls \
	--enable-thread-safety \
	--enable-integer-datetimes \
	--without-python \
	--with-perl \
	--without-tcl \
	--with-openssl \
	--with-pam \
%if 0%{?sles_version} == 9 || 0%{?rhel_version} == 406
        --without-gssapi \
        --without-krb5 \
        --without-libxml \
        --without-libxslt \
%else
        --with-gssapi \
        --with-libxml \
        --with-libxslt \
%endif
	--with-ldap \
%if %{with_uuid}
	--with-uuid=e2fs \
%endif
	--with-system-tzdata=/usr/share/zoneinfo

make %{?jobs:-j%jobs} all
make %{?jobs:-j%jobs} -C contrib all

%ifnarch %arm

%check
#
# Run the regression tests.
#
%if %maketest
make check || {
  for f in log/* regression.diffs; do
    if test -f $f; then
        echo ==== $f ====================
    fi
  done
  echo ==============================
  exit 1
}
%endif
%endif


%install
make DESTDIR=%buildroot install
%{__mkdir_p} %{buildroot}%{prefix}/doc
%{__mkdir_p} %{buildroot}%{prefix}/samples
%{__mkdir_p} %{buildroot}%{prefix}/man
%{__mkdir_p} %{buildroot}%{prefix}/include
# Install and collect the contrib stuff
#
touch flag; sleep 1 # otherwise we have installed files that are not newer than flag
make DESTDIR=%buildroot -C contrib install
find %buildroot -type f -cnewer flag -printf "/%%P\n" |
     grep -v %_docdir > files.contrib
rm flag

install -m 755 %{SOURCE9} %{buildroot}%{prefix}/samples/postgresql.init
install -m 644 %{SOURCE8} %{buildroot}%{prefix}/samples/sysconfig.postgresql

%if 0%{?suse_version} > 1020
install -m 644 %{SOURCE16} %{buildroot}%{prefix}/samples/postgresql.firewall
%endif

#cp doc/KNOWN_BUGS doc/MISSING_FEATURES COPYRIGHT README HISTORY doc/bug.template %{buildroot}%{prefix}/doc

cp -a %SOURCE2 %{buildroot}%{prefix}/doc/README.SuSE.de
cp -a %SOURCE3 %{buildroot}%{prefix}/doc/README.SuSE.en

# move man pages
if test -d %{buildroot}%{_mandir}; then
  %{__mv} %{buildroot}%{_mandir}/man* %{buildroot}%{prefix}/man/
  %{__rm} -rf %{buildroot}%{_mandir}
fi

# move include files
if test -d %{buildroot}/usr/include/pgsql; then
  %{__mv} %{buildroot}/usr/include/pgsql %{buildroot}%{prefix}/include/
  %{__rm} -rf %{buildroot}/usr/include
fi

# doc files
if test -d %{buildroot}%{_docdir}/postgresql; then
  %{__mv} %{buildroot}%{_docdir}/postgresql/* %{buildroot}%{prefix}/doc/
  %{__rm} -rf %{buildroot}%{_docdir}
fi
if test -d %{buildroot}/usr/share/postgresql; then
  %{__cp} -rv %{buildroot}/usr/share/postgresql/* %{buildroot}%{prefix}/doc/
  %{__rm} -rf %{buildroot}/usr/share/postgresql
fi

%{__install} -m 0755 %{SOURCE10} %{buildroot}%{prefix}/bin/%{latest_script}


%post
cd %{prefix}/..
%{prefix}/bin/%{latest_script}



%clean
rm -rf %buildroot
rm -f %my_provides


%files
%defattr(-,root,root)
%dir %{prefix}
%{prefix}/bin
%{prefix}/doc
%{prefix}/include
%{prefix}/lib
%{prefix}/man
%{prefix}/share
%{prefix}/samples


%changelog
* Fri Oct 10 2025 Anna Kedzior <anna.kedzior@bertelsmann.de>
- initial commit
openSUSE Build Service is sponsored by