File: make_env.sh

package info (click to toggle)
pgxnclient 1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 672 kB
  • sloc: python: 3,545; sh: 71; makefile: 53
file content (29 lines) | stat: -rwxr-xr-x 629 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -euo pipefail
# set -x

dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$dir"

source env.sh

wget https://ftp.postgresql.org/pub/source/v${PG_VERSION}/postgresql-${PG_VERSION}.tar.bz2
tar xjvf postgresql-${PG_VERSION}.tar.bz2
rm postgresql-${PG_VERSION}.tar.bz2
cd postgresql-${PG_VERSION}
./configure --prefix=`pwd`/root
make
make install
`pwd`/root/bin/initdb -D data

set_param () {
    # Set a parameter in a postgresql.conf file
    param=$1
    value=$2

    sed -i "s/^\s*#\?\s*$param.*/$param = $value/" "data/postgresql.conf"
}

set_param port "${PG_PORT}"
set_param listen_addresses "'*'"