Summary(zh_CN.UTF-8): PostgreSQL 客户端程序和库文件
Name: postgresql%{pgver}
Version: %{pgver}.%{pgminver}
-Release: 1.1
+Release: 2
License: BSD
Group: Applications/Databases
Source0: http://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
exit 1
fi
-%triggerpostun -- %{name} < 7.2-2
-if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then
- /usr/sbin/usermod -d /home/services/postgres postgres
-fi
-
-%triggerpostun -- %{name} < 10.2-2
+%triggerpostun -- postgresql < 10.5-2
if [ -n "`/bin/id -u postgres 2>/dev/null`" ]; then
/usr/sbin/usermod -d /var/lib/pgsql postgres
fi
+echo
+echo "This version of PostgreSQL uses new default location for database clusters."
+echo "Please move your existing clusters before starting PostgreSQL so they follow"
+echo "below scheme:"
+echo
+echo "/var/lib/pgsql/<version>/<name>"
+echo
+echo "where <version> means PostgreSQL version like 9.6 or 10 and name is cluster"
+echo "name of your choice. When done, be sure to update /etc/sysconfig/postgresql*"
+echo "files so they reflect your changes."
+echo
%post
/sbin/chkconfig --add postgresql10
%groupadd -g 88 -r postgres
%useradd -M -o -r -u 88 -d /var/lib/pgsql -s /bin/sh -g postgres -c "PostgreSQL Server" postgres
-%post clients
+%posttrans clients
update-alternatives \
--install %{_bindir}/clusterdb clusterdb %{pgsqllibdir}/bin/clusterdb %{pgver}%{pgminver} \
--slave %{_mandir}/man1/clusterdb.1 clusterdb.1 %{pgsqldatadir}/man/man1/clusterdb.1* || :
update-alternatives --remove vacuumdb %{pgsqllibdir}/bin/vacuumdb || :
fi
-%post -n postgresql-devel
+%posttrans -n postgresql-devel
update-alternatives \
--install %{_bindir}/pg_config pg_config %{pgsqllibdir}/bin/pg_config %{pgver}%{pgminver} \
--slave %{_mandir}/man1/pg_config.1 pg_config.1 %{pgsqldatadir}/man/man1/pg_config.1* || :