Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37600734
en ru br
ALT Linux repos
5.0: 8.2.12-alt1
4.1: 8.2.11-alt0.M41.1

Group :: Databases
RPM: postgresql-8.2eter

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# This spec is backported to ALTLinux 4.1 automatically by rpmbph script. Do not edit it.
#
BuildRequires: prelink
# In this file you can find the default build package list macros.  These can be overridden by defining
# on the rpm command line:
# rpm --define 'packagename 1' .... to force the package to build.
# rpm --define 'packagename 0' .... to force the package NOT to build.
# The base package, the lib package, the devel package, and the server package always get built.

%define beta 0
%define plpython 1
%define pltcl 0
%define plperl 1
#define tcl 0
%define nls 1
%define pgfts 1
%define runselftest 0
%define xml 1

%define ssl 0
%define pam 0
%define test 1
%define kerberos 0
%if %_vendor == "alt"
%define icu 0
%else
# Несём с собой icu38
%define icu 1
%endif

%{!?aconfver:%define aconfver autoconf}
%define kerbdir "/usr"

%{!?test:%define test 1}
%{!?plpython:%define plpython 1}
%{!?pltcl:%define pltcl 1}
%{!?plperl:%define plperl 1}
%{!?ssl:%define ssl 1}
%{!?kerberos:%define kerberos 1}
%{!?nls:%define nls 1}
%{!?xml:%define xml 1}
%{!?pam:%define pam 0}
%{!?pgfts:%define pgfts 1}
%{!?runselftest:%define runselftest 0}

Name: postgresql-8.2eter
Version: 8.2.11
Release: alt0.M41.1
Summary: PostgreSQL client programs and libraries (Etersoft edition for Selta and 1C)
License: BSD
Group: Databases
# Packager: Sergey Alembekov <rt at altlinux.ru>
# Packager: Eugene Zagidullin <asphyx at etersoft.ru>
# Packager: Vitaly Lipatov <lav at altlinux.ru>
Packager: Boris Savelev <boris at altlinux.ru>
Url: http://www.postgresql.org/
Source: ftp://ftp.postgresql.org/pub/source/v%version/postgresql-%version.tar.bz2
Source2: postgresql.outformat
Source3: postgresql.init
Source4: Makefile.regress
Source5: pg_config.h
Source6: README.rpm-dist
Source12: http://www.postgresql.org/files/documentation/pdf/8.2/postgresql-8.2-A4.pdf
Source14: postgresql.pam
Source15: postgresql-bashprofile
Source16: filter-requires-perl-Pg.sh

Patch1: rpm-pgsql.patch
Patch4: postgresql-test.patch
Patch6: postgresql-perl-rpath.patch
Patch7: 1c_FULL_82-0.18.patch
Patch8: postgresql-1c-8.2.patch
Patch9: applock-1c-8.2.4.patch
Patch10: timestamp.c.diff
Patch11: postgresql.conf.sample.patch
Patch12: pg_hba.conf.sample.patch
Patch13: postgres_ext.h.patch
# Etersoft's fix to version and support
Patch14: postgres-etersoft-version.patch
# Etersoft's fix for 1c patches
Patch15: 1cfix_etersoft.patch

BuildRequires: rpm-build-compat
BuildRequires: perl glibc-devel bison flex autoconf perl-devel
%if %_vendor == "alt"
BuildRequires: libicu-devel
%else
# require our build of ICU
BuildRequires: libicu38-devel = 3.8
BuildRequires: libicu38 = 3.8
%endif

%if %plpython
BuildPreReq: python-devel
%endif

%if %pltcl
BuildRequires: tcl-devel
%endif

BuildRequires: libreadline-devel
BuildRequires: zlib-devel >= 1.0.4

%if %ssl
BuildRequires: openssl-devel
%endif

%if %kerberos
BuildRequires: krb5-devel
BuildRequires: e2fsprogs-devel
%endif

%if %nls
BuildRequires: gettext >= 0.10.35
%endif

%if %xml
BuildRequires: libxml2-devel libxslt-devel
%endif

%if %pam
BuildRequires: pam-devel
%endif

Obsoletes: postgresql8.2.1C
Provides: postgresql8.2.1C = %version

%description
PostgreSQL is an advanced Object-Relational database management system
(DBMS) that supports almost all SQL constructs (including
transactions, subselects and user-defined types and functions). The
postgresql package includes the client programs and libraries that
you'll need to access a PostgreSQL DBMS server.  These PostgreSQL
client programs are programs that directly manipulate the internal
structure of PostgreSQL databases on a PostgreSQL server. These client
programs can be located on the same machine with the PostgreSQL
server, or may be on a remote machine which accesses a PostgreSQL
server over a network connection. This package contains the command-line
utilities for managing PostgreSQL databases on a PostgreSQL server.

If you want to manipulate a PostgreSQL database on a local or remote PostgreSQL
server, you need this package. You also need to install this package
if you're installing the postgresql-server package.

Etersoft edition appointed for SELTA at Etersoft and 1C Enterprise Server

%package libs
Summary: The shared libraries required for any PostgreSQL clients
Group: Databases
Provides: libpq.so

%description libs
The postgresql-libs package provides the essential shared libraries for any
PostgreSQL client program or interface. You will need to install this package
to use any other PostgreSQL package or any clients that need to connect to a
PostgreSQL server.

%package server
Summary: The programs needed to create and run a PostgreSQL server
Group: Databases
#Requires: %_sbindir/useradd /sbin/chkconfig
Requires: %name = %version
Conflicts: postgresql8.3 postgresql8.2 postgresql8.1 postgresql8.0

%description server
The postgresql-server package includes the programs needed to create
and run a PostgreSQL server, which will in turn allow you to create
and maintain PostgreSQL databases.  PostgreSQL is an advanced
Object-Relational database management system (DBMS) that supports
almost all SQL constructs (including transactions, subselects and
user-defined types and functions). You should install
postgresql-server if you want to create and maintain your own
PostgreSQL databases and/or your own PostgreSQL server. You also need
to install the postgresql package.

%package docs
Summary: Extra documentation for PostgreSQL
Group: Databases
%description docs
The postgresql-docs package includes the SGML source for the documentation
as well as the documentation in PDF format and some extra documentation.
Install this package if you want to help with the PostgreSQL documentation
project, or if you want to generate printed documentation. This package also
includes HTML version of the documentation.

%package contrib
Summary: Contributed source and binaries distributed with PostgreSQL
Group: Databases
Requires: %name = %version
%add_findprov_lib_path %_libdir/pgsql

%description contrib
The postgresql-contrib package contains contributed packages that are
included in the PostgreSQL distribution.
This package include mchar additional module.

%package devel
Summary: PostgreSQL development header files and libraries
Group: Development/C
Requires: %name-libs = %version
Requires: %name = %version

%description devel
The postgresql-devel package contains the header files and libraries
needed to compile C or C++ applications which will directly interact
with a PostgreSQL database management server and the ecpg Embedded C
Postgres preprocessor. You need to install this package if you want to
develop applications which will interact with a PostgreSQL server.

%if %plperl
%package plperl
Summary: The Perl procedural language for PostgreSQL
Group: Databases
Requires: %name = %version
Requires: %name-server = %version
Obsoletes: postgresql-pl

%description plperl
PostgreSQL is an advanced Object-Relational database management
system. The postgresql-plperl package contains the PL/Perl language
for the backend.
%endif

%if %plpython
%package plpython
Summary: The Python procedural language for PostgreSQL
Group: Databases
Requires: %name = %version
Requires: %name-server = %version
Obsoletes: postgresql-pl

%description plpython
PostgreSQL is an advanced Object-Relational database management
system. The postgresql-plpython package contains the PL/Python language
for the backend.
%endif

%if %pltcl
%package pltcl
Summary: The Tcl procedural language for PostgreSQL
Group: Databases
Requires: %name = %version
Requires: %name-server = %version
Obsoletes: postgresql-pl

%description pltcl
PostgreSQL is an advanced Object-Relational database management
system. The postgresql-pltcl package contains the PL/Tcl language
for the backend.
%endif

%if %test
%package test
Summary: The test suite distributed with PostgreSQL
Group: Databases
Requires: %name = %version
Requires: %name-server = %version

%description test
PostgreSQL is an advanced Object-Relational database management
system. The postgresql-test package includes the sources and pre-built
binaries of various tests for the PostgreSQL database management
system, including regression tests and benchmarks.
%endif

%define __perl_requires %SOURCE16

%prep
%setup -q -n postgresql-%version
cd doc
tar zxf postgres.tar.gz
cd -

# Patch1: rpm-pgsql.patch

%patch1 -p1
# Patch4: postgresql-test.patch
%patch4 -p1
# Patch6: postgresql-perl-rpath.patch
%patch6 -p1
# Patch7: 1c_FULL_82-0.18.patch
%patch7 -p0
# Patch8: postgresql-1c-8.2.patch
%patch8 -p1
# Patch9: applock-1c-8.2.4.patch
%patch9 -p1
# Patch10: timestamp.c.diff
%patch10 -p1
# Patch11: postgresql.conf.sample.patch
%patch11 -p1
# Patch12: pg_hba.conf.sample.patch
%patch12 -p1
# Patch13: postgres_ext.h.patch
%patch13 -p1
# Etersoft's fix to version and support
# Patch14: postgres-etersoft-version.patch
%patch14 -p0
# Etersoft's fix for 1c patches
# Patch15: 1cfix_etersoft.patch
%patch15 -p0

cd doc
tar -zcf postgres.tar.gz *.html stylesheet.css
rm -f *.html stylesheet.css
cd -

cp -p %SOURCE12 .

%build
# FIXME: нужно ли это?
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
%if %kerberos
CPPFLAGS="${CPPFLAGS} -I%_includedir/et" ; export CPPFLAGS
CFLAGS="${CFLAGS} -I%_includedir/et" ; export CFLAGS
%endif

# Strip out -ffast-math from CFLAGS....

CFLAGS=`echo $CFLAGS|xargs -n 1|grep -v ffast-math|xargs -n 100`

export LIBNAME=%_lib
%configure --disable-rpath \
%if %beta
--enable-debug \
--enable-cassert \
%endif
%if %plperl
--with-perl \
%endif
%if %plpython
--with-python \
%endif
%if %pltcl
--with-tcl \
--with-tclconfig=%_libdir \
%endif
%if %ssl
--with-openssl \
%endif
%if %pam
--with-pam \
%endif
%if %kerberos
--with-krb5 \
--with-includes=%kerbdir/include \
--with-libraries=%kerbdir/%_lib \
%endif
%if %nls
--enable-nls \
%endif
%if %pgfts
--enable-thread-safety \
%endif
--sysconfdir=%_sysconfdir/sysconfig/pgsql \
--datadir=%_datadir/pgsql \
--with-docdir=%_docdir

%make_build all
%if  %icu
export ORIGIN=%_libdir/pgsql
%endif
%make_build -C contrib all
%if %xml
%make_build -C contrib/xml2 all
%endif

# Have to hack makefile to put correct path into tutorial scripts

sed "s|C=\`pwd\`;|C=%_libdir/pgsql/tutorial;|" < src/tutorial/Makefile > src/tutorial/GNUmakefile
%make_build -C src/tutorial NO_PGXS=1 all
rm -f src/tutorial/GNUmakefile

%if %runselftest
cd src/test/regress
make all
make MAX_CONNECTIONS=5 check
make clean
cd -
%endif

%if %test
cd src/test/regress
make RPMTESTING=1 all
cd -
%endif

%install
# do not override INSTALL
make install DESTDIR=%buildroot
make install DESTDIR=%buildroot -C contrib
%if %xml
make install DESTDIR=%buildroot -C contrib/xml2
%endif

# multilib header hack; note pg_config.h is installed in two places!

# we only apply this to known Red Hat multilib arches, per bug #177564
case `uname -i` in
i386 | x86_64 | ppc | ppc64 | s390 | s390x)
mv %buildroot%_includedir/pg_config.h %buildroot%_includedir/pg_config_`uname -i`.h
install -m 644 %SOURCE5 %buildroot%_includedir
mv %buildroot%_includedir/pgsql/server/pg_config.h %buildroot%_includedir/pgsql/server/pg_config_`uname -i`.h
install -m 644 %SOURCE5 %buildroot%_includedir/pgsql/server/
;;
*)
;;
esac

install -d %buildroot%_initdir/
sed 's/^PGVERSION=.*$/PGVERSION=%version/' <%SOURCE3 > postgresql.init
install -m 755 postgresql.init %buildroot%_initdir/postgresql
%if %_vendor == "alt"
%else
install -m 755 %SOURCE2 %buildroot%_initdir/postgresql.outformat
%endif

%if %pam
install -d %buildroot%_sysconfdir/pam.d
install -m 644 %SOURCE14 %buildroot%_sysconfdir/pam.d/postgresql
%endif

# PGDATA needs removal of group and world permissions due to pg_pwd hole.

install -d -m 700 %buildroot/var/lib/pgsql/data

# backups of data go here...

install -d -m 700 %buildroot/var/lib/pgsql/backups

# postgres' .bash_profile

install -m 644 %SOURCE15 %buildroot/var/lib/pgsql/.bash_profile

# Create the multiple postmaster startup directory

install -d -m 700 %buildroot%_sysconfdir/sysconfig/pgsql

%if %test
# tests. There are many files included here that are unnecessary, but include
# them anyway for completeness.
mkdir -p %buildroot%_libdir/pgsql/test
cp -a src/test/regress %buildroot%_libdir/pgsql/test
install -m 0755 contrib/spi/refint.so %buildroot%_libdir/pgsql/test/regress
install -m 0755 contrib/spi/autoinc.so %buildroot%_libdir/pgsql/test/regress
cd  %buildroot%_libdir/pgsql/test/regress/
strip *.so
rm -f GNUmakefile Makefile
cd -
cp %SOURCE4 %buildroot%_libdir/pgsql/test/regress/Makefile
chmod 0644 %buildroot%_libdir/pgsql/test/regress/Makefile
%endif

# Fix some more documentation

# gzip doc/internals.ps
cp %SOURCE6 README.rpm-dist
mv %buildroot%_docdir/pgsql/html doc
rm -rf %buildroot%_docdir/pgsql

# our libicu is so.38 (see files contrib too), tr links to files during copying

%if %icu
cp %_libdir/libicuuc.so.38 %buildroot/%_libdir/pgsql/
cp %_libdir/libicudata.so.38 %buildroot/%_libdir/pgsql/
cp %_libdir/libicui18n.so.38 %buildroot/%_libdir/pgsql/
%endif

%find_lang libpq
%find_lang initdb
%find_lang pg_config
%find_lang pg_ctl
%find_lang pg_dump
%find_lang postgres
%find_lang psql
%find_lang pg_resetxlog
%find_lang pg_controldata
%find_lang pgscripts

cat libpq.lang > libpq.lst
cat pg_config.lang > pg_config.lst
cat initdb.lang pg_ctl.lang psql.lang pg_dump.lang pgscripts.lang > main.lst
cat postgres.lang pg_resetxlog.lang pg_controldata.lang > server.lst

%post libs -p %post_ldconfig
%postun libs -p %postun_ldconfig

# FIXME: 26 uid!

%pre server
%groupadd -g 26 -o postgres >/dev/null 2>&1 || :
%useradd -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
-c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
touch /var/log/pgsql
chown postgres:postgres /var/log/pgsql
chmod 0700 /var/log/pgsql

%post server
%post_ldconfig
%post_service postgresql

%preun server
%preun_service postgresql
%postun server
%post_ldconfig

%if %plperl
%post -p %post_ldconfig plperl
%postun -p %post_ldconfig plperl
%endif

%if %plpython
%post -p %post_ldconfig plpython
%postun -p %post_ldconfig plpython
%endif

%if %pltcl
%post -p %post_ldconfig pltcl
%postun -p %post_ldconfig pltcl
%endif

%if %test
%post test
chown -R postgres:postgres %_datadir/pgsql/test >/dev/null 2>&1 || :
%endif

# FILES section.


%files -f main.lst
%doc doc/FAQ doc/KNOWN_BUGS doc/MISSING_FEATURES doc/README*
%doc COPYRIGHT README HISTORY doc/bug.template
%doc README.rpm-dist
%_bindir/clusterdb
%_bindir/createdb
%_bindir/createlang
%_bindir/createuser
%_bindir/dropdb
%_bindir/droplang
%_bindir/dropuser
%_bindir/pg_dump
%_bindir/pg_dumpall
%_bindir/pg_restore
%_bindir/psql
%_bindir/reindexdb
%_bindir/vacuumdb
%_man1dir/clusterdb.*
%_man1dir/createdb.*
%_man1dir/createlang.*
%_man1dir/createuser.*
%_man1dir/dropdb.*
%_man1dir/droplang.*
%_man1dir/dropuser.*
%_man1dir/pg_dump.*
%_man1dir/pg_dumpall.*
%_man1dir/pg_restore.*
%_man1dir/psql.*
%_man1dir/reindexdb.*
%_man1dir/vacuumdb.*
%_man7dir/*

%files docs
%doc doc/src/*
%doc *-A4.pdf
%doc src/tutorial
%doc doc/html

%files contrib
%_libdir/pgsql/mchar.so
%_libdir/pgsql/fulleq.so
%_libdir/pgsql/fasttrun.so
%_libdir/pgsql/_int.so
%_libdir/pgsql/autoinc.so
%_libdir/pgsql/btree_gist.so
%_libdir/pgsql/chkpass.so
%_libdir/pgsql/cube.so
%_libdir/pgsql/dblink.so
%_libdir/pgsql/earthdistance.so
%_libdir/pgsql/fuzzystrmatch.so
%_libdir/pgsql/insert_username.so
%_libdir/pgsql/int_aggregate.so
%_libdir/pgsql/isn.so
%_libdir/pgsql/hstore.so
%_libdir/pgsql/pg_freespacemap.so
%_libdir/pgsql/pgrowlocks.so
%if %ssl
%_libdir/pgsql/sslinfo.so
%endif
%_libdir/pgsql/lo.so
%_libdir/pgsql/ltree.so
%_libdir/pgsql/moddatetime.so
%_libdir/pgsql/pgcrypto.so
%_libdir/pgsql/pgstattuple.so
%_libdir/pgsql/pg_buffercache.so
%_libdir/pgsql/pg_trgm.so
%_libdir/pgsql/refint.so
%_libdir/pgsql/seg.so
%_libdir/pgsql/tablefunc.so
%_libdir/pgsql/timetravel.so
%_libdir/pgsql/tsearch2.so
%_libdir/pgsql/adminpack.so
%if %xml
%_libdir/pgsql/pgxml.so
%endif
%_datadir/pgsql/contrib/
%_bindir/oid2name
%_bindir/pgbench
%_bindir/vacuumlo
%if %icu
%_libdir/pgsql/libicuuc.so.38
%_libdir/pgsql/libicudata.so.38
%_libdir/pgsql/libicui18n.so.38
%endif
%doc contrib/*/README.* contrib/spi/*.example contrib/*/*.sql

%if %_vendor == "alt"
%else
%files libs -f libpq.lang
%_libdir/libpq.so.*
%_libdir/libecpg.so.*
%_libdir/libpgtypes.so.*
%_libdir/libecpg_compat.so.*
%endif

%files server -f server.lst
%_initdir/postgresql
%if %_vendor == "alt"
%else
%_initdir/postgresql.outformat
%endif
%if %pam
%config(noreplace) %_sysconfdir/pam.d/postgresql
%endif
%attr (755,root,root) %dir %_sysconfdir/sysconfig/pgsql
%_bindir/initdb
%_bindir/ipcclean
%_bindir/pg_controldata
%_bindir/pg_ctl
%_bindir/pg_resetxlog
%_bindir/postgres
%_bindir/postmaster
%_man1dir/initdb.*
%_man1dir/ipcclean.*
%_man1dir/pg_controldata.*
%_man1dir/pg_ctl.*
%_man1dir/pg_resetxlog.*
%_man1dir/postgres.*
%_man1dir/postmaster.*
%_datadir/pgsql/postgres.bki
%_datadir/pgsql/postgres.description
%_datadir/pgsql/postgres.shdescription
%_datadir/pgsql/system_views.sql
%_datadir/pgsql/*.sample
%_datadir/pgsql/timezone/
%_datadir/pgsql/timezonesets/
%_libdir/pgsql/plpgsql.so
%dir %_libdir/pgsql
%dir %_datadir/pgsql
%dir /var/lib/pgsql
%attr (700,postgres,postgres) %dir /var/lib/pgsql/data
%dir /var/lib/pgsql/backups
/var/lib/pgsql/.bash_profile
%_libdir/pgsql/*_and_*.so
%_datadir/pgsql/conversion_create.sql
%_datadir/pgsql/information_schema.sql
%_datadir/pgsql/sql_features.txt

%if %_vendor == "alt"
%else
%files devel -f pg_config.lst
%_includedir/*
%_bindir/ecpg
%_bindir/pg_config
%_libdir/libpq.so
%_libdir/libecpg.so
%_libdir/libpq.a
%_libdir/libecpg.a
%_libdir/libecpg_compat.so
%_libdir/libecpg_compat.a
%_libdir/libpgport.a
%_libdir/libpgtypes.so
%_libdir/libpgtypes.a
%_libdir/pgsql/pgxs/*
%_man1dir/ecpg.*
%_man1dir/pg_config.*
%endif

%if %plperl
%files plperl
%_libdir/pgsql/plperl.so
%endif

%if %pltcl
%files pltcl
%_libdir/pgsql/pltcl.so
%_bindir/pltcl_delmod
%_bindir/pltcl_listmod
%_bindir/pltcl_loadmod
%_datadir/pgsql/unknown.pltcl
%endif

%if %plpython
%files plpython
%_libdir/pgsql/plpython.so
%endif

%if %test
%files test
%_libdir/pgsql/test/*
%dir %_libdir/pgsql/test
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin