Files
aevolution/tools/prepare-postgres.sh
T

21 lines
752 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Explicit preparation only; never downloaded by CMake configure.
root="$(cd "$(dirname "$0")/.." && pwd)"
cache="$root/.cache/postgres"
mkdir -p "$cache"
cd "$cache"
archive=postgresql-18.6.tar.bz2
if [ ! -f "$archive" ]; then
curl --fail --location --proto '=https' --tlsv1.2 \
"https://ftp.postgresql.org/pub/source/v18.6/$archive" -o "$archive"
fi
echo "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f $archive" | sha256sum --check -
if [ ! -d postgresql-18.6 ]; then tar -xjf "$archive"; fi
mkdir -p build
cd build
../postgresql-18.6/configure --prefix="$cache/install" --without-readline --without-icu --with-ssl=openssl
make -j2
make install
"$cache/install/bin/pg_config" --version