Установка Postgres PRO 10 из исходного кода на CentOS 7

Установка Postgres Pro 10 из исходников аналогична установке версии 9.6
 

#!/bin/bash

echo " ------------ 1 ------------";
yum update -y;
yum install screen wget gcc make bzip2 bison mc readline-devel zlib-devel flex-devel flex git -y;
yum install docbook-dtds xsltproc libxslt -y;

echo " ------------ 2 ------------";
wget http://repo.postgrespro.ru/pgpro-10/src/postgrespro-10.1.1.tar.bz2;
tar -xjvf postgrespro-10.1.1.tar.bz2;
rm postgrespro-10.1.1.tar.bz2;
cd postgrespro-10.1.1/;
./configure --enable-nls='ru';
make world;
make install-world;

echo " ------------ 3 ------------";
localectl set-locale LANG=ru_RU.UTF-8;
adduser postgres;
mkdir /usr/local/pgsql/data;
chown postgres /usr/local/pgsql/data;

echo " ------------ 4 ------------";
sudo  --user=postgres echo 'export LC_ALL="ru_RU.UTF-8"' >> /home/postgres/.bashrc;
sudo  --user=postgres echo "export PATH=/usr/local/pgsql/bin:$PATH" >> /home/postgres/.bashrc;
sudo  --user=postgres echo "export MANPATH=/usr/local/pgsql/share/man:$MANPATH" >> /home/postgres/.bashrc;
sudo  --user=postgres echo "export PGDATA=/usr/local/pgsql/data" >> /home/postgres/.bashrc;
sudo  --user=postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data;

echo " ------------ 5 ------------";
cd /root/postgrespro-10.1.1/contrib/start-scripts/;
cp linux /etc/init.d/postgresql;
chmod +x /etc/init.d/postgresql;
chkconfig postgresql on;
service postgresql start;
sleep 5;

echo " ---------- Yes! Postgres PRO 10 instaled! -----------";


Автор: Александр