#
-# - put pgcrypto docs into docdir
-# - put pgcrypto sql files in %{_datadir}/postgresql
+# - pg_autovacuum init support? look at its readme file, please
+# - pg_ctl uses psql again, current patch2 doesn't eliminate this
# - 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...
-# - look at libpq locales
-# - move ecpg headers to includedir subdir? (conflict with unixODBC-devel)
#
# Conditional build:
-%bcond_without tcl # disables Tcl support
+%bcond_without tests # disable testing
+%bcond_without tcl # disables Tcl support
%bcond_without kerberos5 # disable kerberos5 support
-%bcond_with jdbc # enable JDBC driver
+%bcond_without perl # disable perl support
+%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)
+ # (disabled by default because it is a security risk)
%include /usr/lib/rpm/macros.python
-%define _rc RC2
-
Summary: PostgreSQL Data Base Management System
Summary(de): PostgreSQL Datenbankverwaltungssystem
Summary(es): Gestor de Banco de Datos PostgreSQL
Summary(zh_CN): PostgreSQL ¿Í»§¶Ë³ÌÐòºÍ¿âÎļþ
Name: postgresql
Version: 7.4
-Release: 0.5.%{_rc}
+Release: 0.9
License: BSD
Group: Applications/Databases
-##Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}%{_rc}.tar.bz2
-Source0: ftp://ftp2.pl.postgresql.org/mirrors/ftp.postgresql.org/source/v%{version}/%{name}-%{version}%{_rc}.tar.bz2
-# Source0-md5: a1ea58e97dd7849a4fb4721752d3ed41
+##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
Patch6: %{name}-com_err.patch
Patch7: %{name}-ecpg_link.patch
Patch8: %{name}-ecpg-includedir.patch
+Patch9: %{name}-contrib_install.patch
Icon: postgresql.xpm
URL: http://www.postgresql.org/
BuildRequires: autoconf
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
%{?with_tcl:BuildRequires: tcl-devel >= 8.4.3}
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.
Funkcje kryptograficzne dla PostgreSQL.
%prep
-%setup -q -n %{name}-%{version}%{_rc}
+%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p0
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
tar xzf doc/man*.tar.gz
rm -f config/libtool.m4
%{__aclocal} -I config
%{__autoconf}
-%configure \
+%configure CFLAGS="%{rpmcflags} -DNEED_REENTRANT_FUNCS"\
%{!?_without_pgsql_locale:--enable-locale} \
%{!?_without_pgsql_multibyte:--enable-multibyte} \
--disable-rpath \
+ --enable-nls \
--enable-thread-safety \
--enable-integer-datetimes \
--enable-depend \
--with-CXX \
%{?with_tcl:--with-tcl} \
%{?with_tcl:--with-tk} \
- --with-perl \
- --with-python \
+ %{?with_perl:--with-perl} \
+ %{?with_python:--with-python} \
%{?with_kerberos5:--with-krb5=%{_prefix}} \
--with-openssl \
--with-x \
%{?_with_jdbc: --with-java}
%{__make}
+%{__make} -C contrib/pg_autovacuum
+%{__make} -C contrib/pgcrypto
%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}} \
%{__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
touch $RPM_BUILD_ROOT/var/log/pgsql
%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
%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*
%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
%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) %{_bindir}/pg_id
%{_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
%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
%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