#
-# - put pgcrypto docs into docdir
-# - put pgcrypto sql files in %{_datadir}/postgresql
-# - remove postgresql-configure patch and create postgresql-doc patch,
-# which will prevent documentation and manuals installation (the routine
-# is bad and we install docs and mans manually, at all) or create good
-# routine and send it to postgresql team...
+# - pg_autovacuum init support? look at its readme file, please
+# - pg_ctl uses psql again, current patch2 doesn't eliminate this
#
# Conditional build:
-# _with_jdbc - with JDBC driver
-# _with_absolute_dbpaths - allow absolute paths to create database
-# (disallowed by default because it is a security risk)
-#
+%bcond_without tests # disable testing
+%bcond_without tcl # disables Tcl support
+%bcond_without kerberos5 # disable kerberos5 support
+%bcond_without perl # disable perl support
+%bcond_without pgsql_locale # disable PostgreSQL locale
+%bcond_without pgsql_multibyte # disable PostgreSQL multibyte
+%bcond_without python # disable python support
+%bcond_with jdbc # enable JDBC driver
+%bcond_with absolute_dbpaths # enable absolute paths to create database
+ # (disabled by default because it is a security risk)
%include /usr/lib/rpm/macros.python
-
+
Summary: PostgreSQL Data Base Management System
Summary(de): PostgreSQL Datenbankverwaltungssystem
Summary(es): Gestor de Banco de Datos PostgreSQL
Summary(uk): PostgreSQL - ÓÉÓÔÅÍÁ ËÅÒÕ×ÁÎÎÑ ÂÁÚÁÍÉ ÄÁÎÉÈ
Summary(zh_CN): PostgreSQL ¿Í»§¶Ë³ÌÐòºÍ¿âÎļþ
Name: postgresql
-Version: 7.3.4
-Release: 0.2
+Version: 7.4
+Release: 0.9
License: BSD
Group: Applications/Databases
-Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 82878d6d74c36384af3595d26ed38067
+##Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.bz2
+Source0: ftp://ftp2.pl.postgresql.org/mirrors/ftp.postgresql.org/source/v%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 9db7432c431d1570b1f605727daf27bc
Source1: %{name}.init
Source2: pgsql-Database-HOWTO-html.tar.gz
# Source2-md5: 5b656ddf1db41965761f85204a14398e
Source3: %{name}.sysconfig
-Patch0: %{name}-configure.patch
+Patch0: %{name}-doc.patch
Patch1: %{name}-pg_ctl-silent.patch
Patch2: %{name}-pg_ctl-nopsql.patch
Patch3: %{name}-conf.patch
Patch4: %{name}-absolute_dbpaths.patch
Patch5: %{name}-link.patch
+Patch6: %{name}-com_err.patch
+Patch7: %{name}-ecpg_link.patch
+Patch8: %{name}-ecpg-includedir.patch
+Patch9: %{name}-contrib_install.patch
+Patch10: %{name}-tsearch2-compound_word_support_20031210.patch
+Patch11: %{name}-ssl-libpq-mem-leak-1.patch
Icon: postgresql.xpm
URL: http://www.postgresql.org/
-BuildRequires: XFree86-devel
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: libtool
+BuildRequires: bison >= 1.875
+%{?with_kerberos5:BuildRequires: heimdal-devel}
BuildRequires: ncurses-devel >= 5.0
BuildRequires: openssl-devel >= 0.9.7c
BuildRequires: pam-devel
-BuildRequires: perl-devel
-BuildRequires: python-devel >= 2.3
+%{?with_perl:BuildRequires: perl-devel}
+%{?with_python:BuildRequires: python-devel >= 2.3}
BuildRequires: readline-devel >= 4.2
BuildRequires: rpm-pythonprov
-BuildRequires: tcl-devel >= 8.4.3
-BuildRequires: tk-devel >= 8.4.3
+%{?with_tcl:BuildRequires: tcl-devel >= 8.4.3}
+%{?with_tcl:BuildRequires: tk-devel >= 8.4.3}
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
PreReq: rc-scripts
ôÅÐÅÒ ÐÁËÅÔÉ Ú Â¦Â̦ÏÔÅËÁÍÉ ÄÌÑ Ò¦ÚÎÉÈ ÍÏ× ÐÒÏÇÒÁÍÕ×ÁÎÎÑ (C, C++, PERL
¦ TCL) ÒÏÚĦÌÅΦ. ãÅÊ ÐÁËÅÔ Í¦ÓÔÉÔØ Ô¦ÌØËÉ Â¦Â̦ÏÔÅËÉ ÄÌÑ ÍÏ×É C.
-%package -n python-postgresql
-Summary: The python-based client programs needed for accessing a PostgreSQL server
-Summary(es): Módulo Python para acceder un servidor PostgreSQL
-Summary(pl): Programy klienckie do dostêpu do serwera PostgreSQL napisane w Pythonie
-Summary(pt_BR): Módulo Python para acesso ao servidor PostgreSQL
-Summary(zh_CN): Python ³ÌÐò·ÃÎÊ PostgreSQL Êý¾Ý¿âËùÐèµÄ¿ª·¢Ä£¿é
-Group: Libraries/Python
-Requires: python >= 2.0
-Requires: python-mx-DateTime
-Requires: %{name}-libs = %{version}
-Obsoletes: python-PyGreSQL
-Obsoletes: postgresql-python
-
-%description -n python-postgresql
-postgresql-python includes the python-based client programs and client
-libraries that you'll need to access a PostgreSQL database management
-system server.
-
-%description -n python-postgresql -l es
-Módulo Python para acceder un servidor PostgreSQL.
-
-%description -n python-postgresql -l pl
-Pakiet ten zawiera napisane w Pythonie programy i biblioteki klienckie
-do dostêpu do serwera baz danych PostgreSQL.
-
-%description -n python-postgresql -l pt_BR
-Módulo Python para acesso ao servidor PostgreSQL.
-
%package doc
Summary: Documentation for PostgreSQL
Summary(pl): Dodatkowa dokumantacja dla PostgreSQL
Este pacote contém a biblioteca compartilhada para acesso ao
PostgreSQL.
+%package ecpg
+Summary: Embedded SQL in C interface
+Summary(pl): Interfejs wbudowanego SQL-a w jêzyk C
+Group: Libraries
+
+%description ecpg
+Embedded SQL in C interface.
+
+%description ecpg -l pl
+Interfejs wbudowanego SQL-a w jêzyk C.
+
+%package ecpg-devel
+Summary: Embedded SQL in C interface files
+Summary(pl): Pliki programistyczne interfejsu wbudowanego SQL-a w jêzyk C
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}
+
+%description ecpg-devel
+Embedded SQL in C interface files.
+
+%description ecpg-devel -l pl
+Pliki programistyczne interfejsu wbudowanego SQL-a w jêzyk C.
+
%package static
Summary: PostgreSQL static libraries
Summary(es): Bibliotecas estaticas PostgreSQL
Summary(pl): PL/perl jêzyk proceduralny bazy danych PostgreSQL
Group: Applications/Databases
Requires: %{name} = %{version}
-%requires_eq perl
+%requires_eq perl-base
%description module-plperl
From PostgreSQL documentation.
Summary: Cryptographic functions for PostgreSQL
Summary(pl): Funkcje kryptograficzne dla PostgreSQL
Group: Applications/Databases
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}
%description module-pgcrypto
Cryptographic functions for PostgreSQL.
%description module-pgcrypto -l pl
Funkcje kryptograficzne dla PostgreSQL.
+%package module-tsearch2
+Summary: Full text extension for PostgreSQL
+Summary(pl): Rozszerzenie pe³notekstowe dla PostgreSQL-a
+Group: Applications/Databases
+Requires: %{name} = %{version}
+
+%description module-tsearch2
+Implementation of a new data type tsvector - a searchable data type
+with indexed access:
+http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
+
+%description module-tsearch2 -l pl
+Implementacja nowego typu danych tsvector - typu danych podlegaj±cego
+przeszukiwaniu z dostêpem poprzez indeksy:
+http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
+
%prep
-%setup -q
+%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p0
%patch3 -p1
-%{?_with_absolute_dbpaths:%patch4 -p1}
+%{?with_absolute_dbpaths:%patch4 -p1}
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p0
tar xzf doc/man*.tar.gz
tar zxf doc/postgres.tar.gz -C doc/unpacked
# Erase all CVS dir
-rm -fR `find contrib -type d -name CVS`
+find contrib -type d -name CVS -exec rm -rf {} \;
%build
rm -f config/libtool.m4
+install /usr/share/automake/config.* config/
%{__aclocal} -I config
%{__autoconf}
-%configure \
- %{!?_without_pgsql_locale:--enable-locale} \
- %{!?_without_pgsql_multibyte:--enable-multibyte} \
+%configure CFLAGS="%{rpmcflags} -DNEED_REENTRANT_FUNCS"\
+ %{?with_pgsql_locale:--enable-locale} \
+ %{?with_pgsql_multibyte:--enable-multibyte} \
--disable-rpath \
+ --enable-nls \
+ --enable-thread-safety \
+ --enable-integer-datetimes \
--enable-depend \
--enable-recode \
--enable-syslog \
+ --with-pam \
--enable-unicode-conversion \
--with-CXX \
- --with-tcl \
- --with-tk \
- --with-pam \
- --with-perl \
- --with-python \
+ %{?with_tcl:--with-tcl} \
+ %{?with_tcl:--with-tk} \
+ %{?with_perl:--with-perl} \
+ %{?with_python:--with-python} \
+ %{?with_kerberos5:--with-krb5=%{_prefix}} \
--with-openssl \
--with-x \
-%{?_with_jdbc: --with-java}
+ %{?with_jdbc:--with-java}
%{__make}
+%{__make} -C contrib/pg_autovacuum
+%{__make} -C contrib/pgcrypto
+%{__make} -C contrib/tsearch2
%ifnarch sparc sparcv9 sparc64 alpha ppc
-%{!?_without_tests: %{__make} check }
+%{?with_tests:%{__make} check}
%endif
-cd contrib/pgcrypto
-%{__make}
-
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
- $RPM_BUILD_ROOT{/var/{lib/pgsql,log},%{_pgsqldir}} \
- $RPM_BUILD_ROOT{%{_applnkdir}/System,%{_pixmapsdir}} \
+ $RPM_BUILD_ROOT{/var/{lib/pgsql,log},%{_pgsqldir}} \
+ $RPM_BUILD_ROOT%{_mandir} \
$RPM_BUILD_ROOT/home/services/postgres
%{__make} install install-all-headers \
DESTDIR=$RPM_BUILD_ROOT
-%{__make} install -C src/pl/plperl \
+%{?with_perl:%{__make} install -C src/pl/plperl DESTDIR=$RPM_BUILD_ROOT}
+
+%{__make} -C contrib/pg_autovacuum install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__make} -C contrib/pgcrypto install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__make} -C contrib/tsearch2 install \
DESTDIR=$RPM_BUILD_ROOT
touch $RPM_BUILD_ROOT/var/log/pgsql
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql
-cp -a man? $RPM_BUILD_ROOT%{_mandir}
-
-# there are html installed, remove them
-rm -rf $RPM_BUILD_ROOT%{_infodir}
-
install -d howto
( cd howto
tar xzf $RPM_SOURCE_DIR/pgsql-Database-HOWTO-html.tar.gz
%py_comp $RPM_BUILD_ROOT%{py_libdir}
%py_ocomp $RPM_BUILD_ROOT%{py_libdir}
-cd contrib/pgcrypto
-%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
+# find locales
+for f in libpq pg_controldata pg_dump pg_resetxlog pgscripts postgres psql; do
+ %find_lang $f
+done
+# merge locales
+cat pgscripts.lang pg_resetxlog.lang postgres.lang pg_controldata.lang > main.lang
+cat pg_dump.lang psql.lang > clients.lang
%clean
rm -rf $RPM_BUILD_ROOT
foundold=0
for pgdir in $PG_DB_CLUSTERS; do
if [ -f $pgdir/PG_VERSION ]; then
- if [ `cat $pgdir/PG_VERSION` != '7.3' ]; then
+ if [ `cat $pgdir/PG_VERSION` != '7.4' ]; then
echo "Found database(s) in older, incompatible format in cluster $pgdir."
foundold=1
fi
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+%post ecpg -p /sbin/ldconfig
+%postun ecpg -p /sbin/ldconfig
+
%post tcl -p /sbin/ldconfig
%postun tcl -p /sbin/ldconfig
-%files
+%files -f main.lang
%defattr(644,root,root,755)
+%doc contrib/pg_autovacuum/README*
+%doc doc/FAQ* doc/README* doc/bug.template
+%doc COPYRIGHT README HISTORY
%attr(754,root,root) /etc/rc.d/init.d/*
%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/*
%attr(755,root,root) %{_bindir}/initdb
%attr(755,root,root) %{_bindir}/initlocation
%attr(755,root,root) %{_bindir}/ipcclean
+%attr(755,root,root) %{_bindir}/pg_autovacuum
%attr(755,root,root) %{_bindir}/pg_controldata
%attr(755,root,root) %{_bindir}/pg_ctl
%attr(755,root,root) %{_bindir}/pg_encoding
%{_datadir}/postgresql/*.sample
%{_datadir}/postgresql/*.description
%{_datadir}/postgresql/*.sql
+%{_datadir}/postgresql/*.txt
%attr(700,postgres,postgres) /home/services/postgres
%attr(700,postgres,postgres) %dir /var/lib/pgsql
%{_mandir}/man1/initdb.1*
%{_mandir}/man1/initlocation.1*
%{_mandir}/man1/ipcclean.1*
-%{_mandir}/man1/pg_config.1*
%{_mandir}/man1/pg_controldata.1*
%{_mandir}/man1/pg_ctl.1*
%{_mandir}/man1/pg_resetxlog.1*
%{_mandir}/man1/postgres.1*
%{_mandir}/man1/postmaster.1*
-%{_mandir}/man7/*.7*
-
-%doc contrib
-%doc doc/FAQ* doc/README*
-%doc COPYRIGHT README HISTORY doc/bug.template
-
%files doc
%defattr(644,root,root,755)
%doc doc/unpacked/*
%doc howto
-%files libs
+%files libs -f libpq.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libpq.so.*.*
-%attr(755,root,root) %{_libdir}/libecpg.so.*.*
%attr(755,root,root) %{_bindir}/pg_id
-%files devel
+%files ecpg
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/ecpg
-%attr(755,root,root) %{_bindir}/pg_config
+%attr(755,root,root) %{_libdir}/libecpg.so.*.*
+%attr(755,root,root) %{_libdir}/libecpg_compat.so.*.*
+%attr(755,root,root) %{_libdir}/libpgtypes.so.*.*
+%{_mandir}/man1/ecpg.1*
+
+%files ecpg-devel
+%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libecpg.so
+%attr(755,root,root) %{_libdir}/libecpg_compat.so
+%attr(755,root,root) %{_libdir}/libpgtypes.so
+%{_includedir}/ecpg
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/pg_config
%attr(755,root,root) %{_libdir}/libpq.so
%dir %{_includedir}/postgresql
+%{_includedir}/libpq-fe.h
%{_includedir}/pg_config.h
%{_includedir}/pg_config_os.h
-%{_includedir}/ecpgerrno.h
-%{_includedir}/ecpglib.h
-%{_includedir}/ecpgtype.h
-%{_includedir}/libpq-fe.h
%{_includedir}/postgres_ext.h
-%{_includedir}/sql3types.h
-%{_includedir}/sqlca.h
%dir %{_includedir}/postgresql/internal
%{_includedir}/postgresql/internal/c.h
%{_includedir}/postgresql/internal/libpq-int.h
%{_includedir}/postgresql/internal/lib
%{_includedir}/postgresql/internal/libpq
%{_includedir}/libpq
-%{_mandir}/man1/ecpg.1*
+%{_mandir}/man1/pg_config.1*
%files backend-devel
%defattr(644,root,root,755)
%files static
%defattr(644,root,root,755)
%{_libdir}/libecpg.a
+%{_libdir}/libecpg_compat.a
%{_libdir}/libpq.a
+%{_libdir}/libpgtypes.a
-%files clients
+%files clients -f clients.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/pg_dump
%attr(755,root,root) %{_bindir}/pg_dumpall
%{_mandir}/man1/pg_restore.1*
%{_mandir}/man1/psql.1*
%{_mandir}/man1/vacuumdb.1*
-%{_mandir}/manl/*.l*
-
-%files -n python-postgresql
-%defattr(644,root,root,755)
-%doc src/interfaces/python/{README*,ChangeLog}
-%{py_sitedir}/*.pyc
-%{py_sitedir}/*.pyo
-%attr(755,root,root) %{py_sitedir}/*.so
+%{_mandir}/man7/*.7*
+%if %{with tcl}
%files tcl
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libpgtcl.so
%files tcl-static
%defattr(644,root,root,755)
%{_libdir}/libpgtcl.a
+%endif
%files module-plpgsql
%defattr(644,root,root,755)
%attr(755,root,root) %{_pgmoduledir}/plpgsql.so
+%if %{with perl}
%files module-plperl
%defattr(644,root,root,755)
%attr(755,root,root) %{_pgmoduledir}/plperl.so
+%endif
+%if %{with python}
%files module-plpython
%defattr(644,root,root,755)
%attr(755,root,root) %{_pgmoduledir}/plpython.so
+%endif
+%if %{with tcl}
%files module-pltcl
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/pltcl_*
%attr(755,root,root) %{_pgmoduledir}/pltcl.so
+%endif
%files module-pgcrypto
%defattr(644,root,root,755)
+%doc contrib/pgcrypto/README*
%attr(755,root,root) %{_pgmoduledir}/pgcrypto.so
-# Hmm i think two below lines shouldn't be here - but i can be wrong ;)
-#%{_datadir}/%{name}/contrib/pgcrypto.sql
-#%{_datadir}/info/%{name}/contrib/README.pgcrypto.gz
+%{_datadir}/%{name}/pgcrypto.sql
+
+%files module-tsearch2
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_pgmoduledir}/tsearch2.so
+%{_datadir}/%{name}/tsearch2.sql
+%{_datadir}/%{name}/untsearch2.sql