t2sde/package/database/postgresql/postgresql.conf
2025-04-14 11:54:47 +00:00

46 lines
1.2 KiB
Plaintext

# --- T2-COPYRIGHT-BEGIN ---
# t2/package/*/postgresql/postgresql.conf
# Copyright (C) 2004 - 2025 The T2 SDE Project
# Copyright (C) 1998 - 2003 ROCK Linux Project
# SPDX-License-Identifier: GPL-2.0
# --- T2-COPYRIGHT-END ---
if [ $prefix_auto = 1 ]; then
if [ "$SDECFG_PKG_POSTGRESQL_CORE_PREFIX" ]; then
prefix="$SDECFG_PKG_POSTGRESQL_CORE_PREFIX"
else
prefix="opt/postgresql"
fi
set_confopt
fi
var_append confopt ' ' "--with-CXX"
var_append confopt ' ' "--with-gnu-ld"
var_append confopt ' ' "--with-perl"
var_append confopt ' ' "--with-openssl"
# --with-tcl build Tcl modules (PL/Tcl)
if pkginstalled perl; then
var_append confopt ' ' "--with-perl"
fi
if pkginstalled python; then
var_append confopt ' ' "--with-python"
fi
postgresql_pm() {
# Create the data directory
mkdir -p $root$localstatedir/lib/postgres/
chown -R postgres:postgres $root$localstatedir/lib/postgres
# Create the Profile
echo "Creating /etc/profile.d/$pkg ..."
cat <<- EOT > $root/etc/profile.d/$pkg
export PGDATA=$localstatedir/lib/postgres
EOT
}
hook_add postmake 5 "postgresql_pm"
hook_add postmake 4 "make -C contrib/"
hook_add postdoc 3 "cp -dR contrib/ $root$docdir/"