From: Marcin Krol Date: Wed, 22 Aug 2018 19:24:52 +0000 (+0000) Subject: - we must do update-alternatives in poststrans or they'll fail on X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=1078061d1da850813a2ff449a01c4cce558fbbad;p=packages%2Fpostgresql.git - we must do update-alternatives in poststrans or they'll fail on upgrade from non-versioned packages - fixed trigger, added cluster location change info --- diff --git a/postgresql.spec b/postgresql.spec index c0f9241..cd61240 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -29,7 +29,7 @@ Summary(uk.UTF-8): PostgreSQL - система керування базами 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 @@ -751,15 +751,21 @@ if [ "$foundold" = "1" ]; then 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//" +echo +echo "where 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 @@ -775,7 +781,7 @@ fi %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* || : @@ -833,7 +839,7 @@ if [ $1 -eq 0 ]; then 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* || :