#
%define beta %{nil}
-%define pgversion 9.5
-%define pgpriority 95
+%define pgsqlversion 9.5
+%define pgsqlpriority 95
Summary: PostgreSQL Data Base Management System
Summary(de.UTF-8): PostgreSQL Datenbankverwaltungssystem
Summary(tr.UTF-8): Veri Tabanı Yönetim Sistemi
Summary(uk.UTF-8): PostgreSQL - система керування базами даних
Summary(zh_CN.UTF-8): PostgreSQL 客户端程序和库文件
-Name: postgresql-%{pgversion}
-Version: %{pgversion}.14
+Name: postgresql-%{pgsqlversion}
+Version: %{pgsqlversion}.14
Release: 1
License: BSD
Group: Applications/Databases
Obsoletes: postgresql-test
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define pgsqldatadir %{_datadir}/postgresql/%{pgversion}
-%define pgsqllibdir %{_libdir}/postgresql/%{pgversion}
+%define pgsqldatadir %{_datadir}/postgresql/%{pgsqlversion}
+%define pgsqllibdir %{_libdir}/postgresql/%{pgsqlversion}
%define moduledir %{pgsqllibdir}/lib
%define extensiondir %{pgsqldatadir}/extension
SunOS, HPUX, AIX, Linux, Irix, FreeBSD i innymi systemami uniksowymi.
%package dirs
-Summary: Common directories for PostgresSQL %{pgversion}
-Summary(pl.UTF-8): Wspólne pliki i katalogi dla PostgreSQL %{pgversion}
+Summary: Common directories for PostgresSQL %{pgsqlversion}
+Summary(pl.UTF-8): Wspólne pliki i katalogi dla PostgreSQL %{pgsqlversion}
Group: Applicataion/Databases
%description dirs
-Common directories for PostgresSQL %{pgversion}
+Common directories for PostgresSQL %{pgsqlversion}
%description dirs -l pl.UTF-8
-Wspólne pliki i katalogi dla PostgreSQL %{pgversion}
+Wspólne pliki i katalogi dla PostgreSQL %{pgsqlversion}
%package backend-devel
Summary: PostgreSQL backend development header files
touch $RPM_BUILD_ROOT/var/log/pgsql
-sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g; s,@pgsqlversion@,%{pgversion},g;' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgversion}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql-%{pgversion}
+sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g; s,@pgsqlversion@,%{pgsqlversion},g;' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgsqlversion}
+sed -e 's,@pgsqlversion@,%{pgsqlversion},g;' %{SOURCE3} >$RPM_BUILD_ROOT/etc/sysconfig/postgresql-%{pgsqlversion}
install -d howto
tar zxf %{SOURCE2} -C howto
for f in libpq5 pgscripts postgres psql initdb ecpg ecpglib6 \
plpgsql %{?with_perl:plperl} %{?with_python:plpython} \
pg_basebackup pg_config pg_controldata pg_ctl pg_dump pg_resetxlog pg_rewind; do
- %find_lang $f-%{pgversion}
+ %find_lang $f-%{pgsqlversion}
done
# merge locales
merge_lang() {
- cat $(for f in $@; do echo ${f}-%{pgversion}.lang ; done)
+ cat $(for f in $@; do echo ${f}-%{pgsqlversion}.lang ; done)
}
merge_lang pgscripts postgres plpgsql \
pg_basebackup pg_controldata pg_resetxlog pg_rewind > main.lang
pg_ctl pg_dump > clients.lang
%if %{with tcl}
-%find_lang pltcl-%{pgversion}
+%find_lang pltcl-%{pgsqlversion}
%endif
%if %{with selinux}
%{__mv} $RPM_BUILD_ROOT{%{pgsqldatadir}/contrib,%{extensiondir}}/sepgsql.sql
%endif
-cp -p src/pl/plperl/ppport.h $RPM_BUILD_ROOT%{_includedir}/postgresql/%{pgversion}/server/
+cp -p src/pl/plperl/ppport.h $RPM_BUILD_ROOT%{_includedir}/postgresql/%{pgsqlversion}/server/
# package it...? nah, why bother.
%{__rm} -r $RPM_BUILD_ROOT%{pgsqldatadir}/doc/html
%pre
PG_DB_CLUSTERS=""
-if [ -f /etc/sysconfig/postgresql-%{pgversion} ]; then
- . /etc/sysconfig/postgresql-%{pgversion}
+if [ -f /etc/sysconfig/postgresql-%{pgsqlversion} ]; then
+ . /etc/sysconfig/postgresql-%{pgsqlversion}
if [ -z "$PG_DB_CLUSTERS" -a -n "$POSTGRES_DATA_DIR" ]; then
PG_DB_CLUSTERS="$POSTGRES_DATA_DIR"
fi
foundold=0
for pgdir in $PG_DB_CLUSTERS; do
if [ -f $pgdir/PG_VERSION ]; then
- if [ $(cat $pgdir/PG_VERSION) != '%{pgversion}' ]; then
+ if [ $(cat $pgdir/PG_VERSION) != '%{pgsqlversion}' ]; then
echo "Found database(s) in older, incompatible format in cluster $pgdir."
foundold=1
fi
fi
%post
-/sbin/chkconfig --add postgresql-%{pgversion}
-%service postgresql-%{pgversion} restart "postgresql-%{pgversion} server"
+/sbin/chkconfig --add postgresql-%{pgsqlversion}
+%service postgresql-%{pgsqlversion} restart "postgresql-%{pgsqlversion} server"
%preun
if [ "$1" = "0" ]; then
- %service postgresql-%{pgversion} stop
- /sbin/chkconfig --del postgresql-%{pgversion}
+ %service postgresql-%{pgsqlversion} stop
+ /sbin/chkconfig --del postgresql-%{pgsqlversion}
fi
%posttrans clients
update-alternatives \
- --install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgpriority} \
+ --install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgsqlpriority} \
--slave %{_mandir}/man1/clusterdb.1 clusterdb.1 %{pgsqldatadir}/man/man1/clusterdb.1* || :
update-alternatives \
- --install %{_bindir}/createdb createdb %{pgsqllibdir}/bin/createdb %{pgpriority} \
+ --install %{_bindir}/createdb createdb %{pgsqllibdir}/bin/createdb %{pgsqlpriority} \
--slave %{_mandir}/man1/createdb.1 createdb.1 %{pgsqldatadir}/man/man1/createdb.1* || :
update-alternatives \
- --install %{_bindir}/createuser createuser %{pgsqllibdir}/bin/createuser %{pgpriority} \
+ --install %{_bindir}/createuser createuser %{pgsqllibdir}/bin/createuser %{pgsqlpriority} \
--slave %{_mandir}/man1/createuser.1 createuser.1 %{pgsqldatadir}/man/man1/createuser.1* || :
update-alternatives \
- --install %{_bindir}/dropdb dropdb %{pgsqllibdir}/bin/dropdb %{pgpriority} \
+ --install %{_bindir}/dropdb dropdb %{pgsqllibdir}/bin/dropdb %{pgsqlpriority} \
--slave %{_mandir}/man1/dropdb.1 dropdb.1 %{pgsqldatadir}/man/man1/dropdb.1* || :
update-alternatives \
- --install %{_bindir}/dropuser dropuser %{pgsqllibdir}/bin/dropuser %{pgpriority} \
+ --install %{_bindir}/dropuser dropuser %{pgsqllibdir}/bin/dropuser %{pgsqlpriority} \
--slave %{_mandir}/man1/dropuser.1 dropuser.1 %{pgsqldatadir}/man/man1/dropuser.1* || :
update-alternatives \
- --install %{_bindir}/pg_archivecleanup pg_archivecleanup %{pgsqllibdir}/bin/pg_archivecleanup %{pgpriority} \
+ --install %{_bindir}/pg_archivecleanup pg_archivecleanup %{pgsqllibdir}/bin/pg_archivecleanup %{pgsqlpriority} \
--slave %{_mandir}/man1/pg_archivecleanup.1 pg_archivecleanup.1 %{pgsqldatadir}/man/man1/pg_archivecleanup.1* || :
update-alternatives \
- --install %{_bindir}/pg_dump pg_dump %{pgsqllibdir}/bin/pg_dump %{pgpriority} \
+ --install %{_bindir}/pg_dump pg_dump %{pgsqllibdir}/bin/pg_dump %{pgsqlpriority} \
--slave %{_mandir}/man1/pg_dump.1 pg_dump.1 %{pgsqldatadir}/man/man1/pg_dump.1* || :
update-alternatives \
- --install %{_bindir}/pg_dumpall pg_dumpall %{pgsqllibdir}/bin/pg_dumpall %{pgpriority} \
+ --install %{_bindir}/pg_dumpall pg_dumpall %{pgsqllibdir}/bin/pg_dumpall %{pgsqlpriority} \
--slave %{_mandir}/man1/pg_dumpall.1 pg_dumpall.1 %{pgsqldatadir}/man/man1/pg_dumpall.1* || :
update-alternatives \
- --install %{_bindir}/pg_isready pg_isready %{pgsqllibdir}/bin/pg_isready %{pgpriority} \
+ --install %{_bindir}/pg_isready pg_isready %{pgsqllibdir}/bin/pg_isready %{pgsqlpriority} \
--slave %{_mandir}/man1/pg_isready.1 pg_isready.1 %{pgsqldatadir}/man/man1/pg_isready.1* || :
update-alternatives \
- --install %{_bindir}/pg_restore pg_restore %{pgsqllibdir}/bin/pg_restore %{pgpriority} \
+ --install %{_bindir}/pg_restore pg_restore %{pgsqllibdir}/bin/pg_restore %{pgsqlpriority} \
--slave %{_mandir}/man1/pg_restore.1 pg_restore.1 %{pgsqldatadir}/man/man1/pg_restore.1* || :
update-alternatives \
- --install %{_bindir}/psql psql %{pgsqllibdir}/bin/psql %{pgpriority} \
+ --install %{_bindir}/psql psql %{pgsqllibdir}/bin/psql %{pgsqlpriority} \
--slave %{_mandir}/man1/psql.1 pgsql.1 %{pgsqldatadir}/man/man1/psql.1* || :
update-alternatives \
- --install %{_bindir}/reindexdb reindexdb %{pgsqllibdir}/bin/reindexdb %{pgpriority} \
+ --install %{_bindir}/reindexdb reindexdb %{pgsqllibdir}/bin/reindexdb %{pgsqlpriority} \
--slave %{_mandir}/man1/reindexdb.1 reindexdb.1 %{pgsqldatadir}/man/man1/reindexdb.1* || :
update-alternatives \
- --install %{_bindir}/vacuumdb vacuumdb %{pgsqllibdir}/bin/vacuumdb %{pgpriority} \
+ --install %{_bindir}/vacuumdb vacuumdb %{pgsqllibdir}/bin/vacuumdb %{pgsqlpriority} \
--slave %{_mandir}/man1/vacuumdb.1 vacuumdb.1 %{pgsqldatadir}/man/man1/vacuumdb.1* || :
%postun clients
%files -f main.lang
%defattr(644,root,root,755)
%doc COPYRIGHT README HISTORY doc/{bug.template,KNOWN_BUGS,MISSING_FEATURES,TODO}
-%attr(754,root,root) /etc/rc.d/init.d/postgresql-%{pgversion}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql-%{pgversion}
+%attr(754,root,root) /etc/rc.d/init.d/postgresql-%{pgsqlversion}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql-%{pgsqlversion}
%attr(755,root,root) %{pgsqllibdir}/bin/initdb
%attr(755,root,root) %{pgsqllibdir}/bin/pg_basebackup
%doc doc/src/sgml/html howto
%{_examplesdir}/%{name}-%{version}
-%files ecpg -f ecpg-%{pgversion}.lang
+%files ecpg -f ecpg-%{pgsqlversion}.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{pgsqllibdir}/bin/ecpg
%{pgsqldatadir}/man/man1/ecpg.1*
%files backend-devel
%defattr(644,root,root,755)
-%dir %{_includedir}/postgresql/%{pgversion}
-%{_includedir}/postgresql/%{pgversion}/server
+%dir %{_includedir}/postgresql/%{pgsqlversion}
+%{_includedir}/postgresql/%{pgsqlversion}/server
%dir %{moduledir}/pgxs
%attr(755,root,root) %{moduledir}/pgxs/config
%{moduledir}/pgxs/src
%{pgsqldatadir}/man/man7/*.7*
%if %{with perl}
-%files module-plperl -f plperl-%{pgversion}.lang
+%files module-plperl -f plperl-%{pgsqlversion}.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{moduledir}/plperl.so
%{extensiondir}/plperl--*.sql
%endif
%if %{with python}
-%files module-plpython -f plpython-%{pgversion}.lang
+%files module-plpython -f plpython-%{pgsqlversion}.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{moduledir}/plpython2.so
%{extensiondir}/plpython*--*.sql
%endif
%if %{with tcl}
-%files module-pltcl -f pltcl-%{pgversion}.lang
+%files module-pltcl -f pltcl-%{pgsqlversion}.lang
%defattr(644,root,root,755)
%attr(755,root,root) %{pgsqllibdir}/bin/pltcl_*
%attr(755,root,root) %{moduledir}/pltcl.so