# TODO:
# - python 3 and python 2 subpackages?
+# - think about pg_upgrade integration (sysconfig variable to allow upgrade from 8.3+ without dump/restore?)
# - test init script (db initialization)
-# - test generally
#
# Conditional build:
%bcond_without tests # disable testing
Summary(uk.UTF-8): PostgreSQL - система керування базами даних
Summary(zh_CN.UTF-8): PostgreSQL 客户端程序和库文件
Name: postgresql
-Version: %{mver}.0
-Release: 0.1
+Version: %{mver}.2
+Release: 1
License: BSD
Group: Applications/Databases
Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.bz2
-# Source0-md5: 14c2122cc322e69ab2ab702ed7714bbe
+# Source0-md5: fc79ef32b602f75f2ccd37647bc008e9
Source1: %{name}.init
Source2: pgsql-Database-HOWTO-html.tar.gz
# Source2-md5: 5b656ddf1db41965761f85204a14398e
Patch3: %{name}-ac_version.patch
Patch4: %{name}-disable_horology_test.patch
Patch5: %{name}-pg_ctl-fix.patch
+Patch6: %{name}-heimdal.patch
URL: http://www.postgresql.org/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: libxml2-devel >= 2.6.23
BuildRequires: libxslt-devel
+BuildRequires: libxslt-progs
BuildRequires: ncurses-devel >= 5.0
%{?with_ldap:BuildRequires: openldap-devel}
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: readline-devel >= 4.2
BuildRequires: rpmbuild(macros) >= 1.268
%{?with_tcl:BuildRequires: tcl-devel >= 8.4.3}
+%{?with_tests:BuildRequires: tzdata}
BuildRequires: zlib-devel
Requires(post,preun): /sbin/chkconfig
Requires(pre): /bin/id
Requires: %{name}-libs = %{version}-%{release}
Requires: rc-scripts >= 0.4.3.0
Requires: tzdata
+Obsoletes: postgresql-module-plpgsql
Obsoletes: postgresql-module-tsearch2
Obsoletes: postgresql-server
Obsoletes: postgresql-test
%define _ulibdir /usr/lib
-%define contrib_modules auto_explain adminpack btree_gin btree_gist chkpass citext cube dblink dict_int dict_xsyn earthdistance fuzzystrmatch hstore intagg intarray isn lo ltree oid2name pageinspect pgbench pg_buffercache pgcrypto pg_freespacemap pgrowlocks pg_standby pg_stat_statements pgstattuple pg_trgm pldebugger seg sslinfo tablefunc uuid-ossp vacuumlo xml2
+# omitted contribs:
+# spi and test_parser - examples
+# tsearch2 - old module for compatibility only
+%define contrib_modules adminpack auto_explain btree_gin btree_gist chkpass citext cube dblink dict_int dict_xsyn earthdistance fuzzystrmatch hstore intagg intarray isn lo ltree oid2name pageinspect passwordcheck pg_archivecleanup pg_buffercache pg_freespacemap pg_standby pg_stat_statements pg_trgm pg_upgrade pg_upgrade_support pgbench pgcrypto pgrowlocks pgstattuple pldebugger seg sslinfo tablefunc unaccent uuid-ossp vacuumlo xml2
## to be moved to rpm-build-macros
## TODO: handle RPM_SKIP_AUTO_RESTART
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
tar xzf %{SOURCE4} -C contrib
%endif
# find locales
-for f in libpq5 pg_controldata pg_dump pg_resetxlog pgscripts postgres psql initdb pg_ctl pg_config plpgsql ecpg ecpglib6 plperl plpgsql plpython; do
+for f in libpq5 pg_controldata pg_dump pg_resetxlog pgscripts postgres psql initdb pg_ctl pg_config plpgsql ecpg ecpglib6 %{?with_perl:plperl} plpgsql %{?with_python: plpython}; do
%find_lang $f-%{mver}
done
# merge locales
%clean
rm -rf $RPM_BUILD_ROOT
-%pretrans
+%pre
PG_DB_CLUSTERS=""
if [ -f /etc/sysconfig/postgresql ]; then
. /etc/sysconfig/postgresql
echo "restore all data (using pg_restore or psql)."
echo "Remember to stop the daemon before upgrading!"
echo
+ echo "Alternatively you can use pg_upgrade for 8.3+ online upgrade with"
+ echo "some restrictions: http://www.postgresql.org/docs/9.0/static/pgupgrade.html"
+ echo
echo "Warning for upgrade from version *before* 7.2."
echo "Please note, that postgresql module path changed from"
- echo "/usr/lib/pgsql/module to /usr/lib/postgresql. Change the path"
+ echo "%{_libdir}/pgsql/module to %{_libdir}/postgresql. Change the path"
echo "in dump file before restore."
echo
echo "Warning for upgrade from version *before* 7.3."
echo "http://www.ca.postgresql.org/docs/momjian/upgrade_tips_7.3"
exit 1
fi
-
-%pre
%groupadd -g 88 -r postgres
%useradd -M -o -r -u 88 -d /home/services/postgres -s /bin/sh -g postgres -c "PostgreSQL Server" postgres
%attr(755,root,root) %{_bindir}/pg_controldata
%attr(755,root,root) %{_bindir}/pg_ctl
%attr(755,root,root) %{_bindir}/pg_resetxlog
+%attr(755,root,root) %{_bindir}/pg_upgrade
%attr(755,root,root) %{_bindir}/postgres
%attr(755,root,root) %{_bindir}/postmaster
-%attr(755,root,root) %{_pgmoduledir}/ascii*
-%attr(755,root,root) %{_pgmoduledir}/cyrillic*
-%attr(755,root,root) %{_pgmoduledir}/dict_*
-%attr(755,root,root) %{_pgmoduledir}/euc*
-%attr(755,root,root) %{_pgmoduledir}/latin*
-%attr(755,root,root) %{_pgmoduledir}/libpqwalreceiver*
-%attr(755,root,root) %{_pgmoduledir}/plpgsql*
-%attr(755,root,root) %{_pgmoduledir}/utf*
+%attr(755,root,root) %{_pgmoduledir}/ascii_and_mic.so
+%attr(755,root,root) %{_pgmoduledir}/cyrillic_and_mic.so
+%attr(755,root,root) %{_pgmoduledir}/dict_int.so
+%attr(755,root,root) %{_pgmoduledir}/dict_snowball.so
+%attr(755,root,root) %{_pgmoduledir}/dict_xsyn.so
+%attr(755,root,root) %{_pgmoduledir}/euc*.so
+%attr(755,root,root) %{_pgmoduledir}/latin2_and_win1250.so
+%attr(755,root,root) %{_pgmoduledir}/latin_and_mic.so
+%attr(755,root,root) %{_pgmoduledir}/libpqwalreceiver.so
+%attr(755,root,root) %{_pgmoduledir}/pg_upgrade_support.so
+%attr(755,root,root) %{_pgmoduledir}/plpgsql.so
+%attr(755,root,root) %{_pgmoduledir}/utf8_and_*.so
%dir %{_pgsqldir}
%dir %{_datadir}/postgresql
%{_includedir}/postgresql/internal/libpq
%{_includedir}/libpq
%{_mandir}/man1/pg_config.1*
-%{_mandir}/man3/*.3*
%files backend-devel
%defattr(644,root,root,755)
%dir %{_pgmoduledir}/pgxs
%attr(755,root,root) %{_pgmoduledir}/pgxs/config
%{_pgmoduledir}/pgxs/src
+%{_mandir}/man3/SPI_*.3*
%files static
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%attr(755,root,root) %{_pgmoduledir}/dblink.so
%{_pgsqldir}/*dblink.sql
+%{_mandir}/man3/dblink*.3*
%files module-lo
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%doc contrib/README contrib/pldebugger/README.pl*
%attr(755,root,root) %{_bindir}/oid2name
+%attr(755,root,root) %{_bindir}/pg_archivecleanup
%attr(755,root,root) %{_bindir}/pg_standby
%attr(755,root,root) %{_bindir}/pgbench
%attr(755,root,root) %{_bindir}/vacuumlo
%attr(755,root,root) %{_pgmoduledir}/isn.so
%attr(755,root,root) %{_pgmoduledir}/ltree.so
%attr(755,root,root) %{_pgmoduledir}/pageinspect.so
+%attr(755,root,root) %{_pgmoduledir}/passwordcheck.so
%attr(755,root,root) %{_pgmoduledir}/pg_buffercache.so
%attr(755,root,root) %{_pgmoduledir}/pg_freespacemap.so
%attr(755,root,root) %{_pgmoduledir}/pg_stat_statements.so
%attr(755,root,root) %{_pgmoduledir}/seg.so
%attr(755,root,root) %{_pgmoduledir}/sslinfo.so
%attr(755,root,root) %{_pgmoduledir}/targetinfo.so
+%attr(755,root,root) %{_pgmoduledir}/unaccent.so
%attr(755,root,root) %{_pgmoduledir}/uuid-ossp.so
%{_pgsqldir}/_int.sql
%{_pgsqldir}/adminpack.sql
%{_pgsqldir}/pldbgapi.sql
%{_pgsqldir}/seg.sql
%{_pgsqldir}/sslinfo.sql
+%{_pgsqldir}/unaccent.sql
%{_pgsqldir}/uuid-ossp.sql
%{_pgsqldir}/uninstall__int.sql
%{_pgsqldir}/uninstall_adminpack.sql
%{_pgsqldir}/uninstall_pgstattuple.sql
%{_pgsqldir}/uninstall_seg.sql
%{_pgsqldir}/uninstall_sslinfo.sql
+%{_pgsqldir}/uninstall_unaccent.sql
%{_pgsqldir}/uninstall_uuid-ossp.sql