# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 name postgresql17-server version 17.1 revision 0 categories databases platforms {darwin any} maintainers {gmail.com:davidgilman1 @dgilman} \ {@barracuda156 gmail.com:vital.had} \ openmaintainer license Permissive set rname postgresql17 description run ${rname} as server long_description {*}${description} distfiles homepage https://www.postgresql.org/ master_sites postgresql depends_run port:${rname} supported_archs noarch use_configure no build {} set libdir ${prefix}/lib/${rname} set dbdir ${prefix}/var/db/${rname}/defaultdb set logdir ${prefix}/var/log/${rname} set dbuser postgres set dbgrp postgres set dbhome ${prefix}/var/db/${rname} add_users ${dbuser} shell=/usr/bin/false group=${dbgrp} \ home=${prefix}/var/db \ realname=PostgreSQL-17\ Server startupitem.create yes startupitem.init \ "PGCTL=${libdir}/bin/pg_ctl" startupitem.start \ "sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL17DATA:=${dbdir}} start -l ${logdir}/postgres.log\"" startupitem.stop \ "sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL17DATA:=${dbdir}} stop -s -m fast\"" destroot { xinstall -m 755 -d ${destroot}${logdir} touch ${destroot}${logdir}/postgres.log system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log" } notes "\nTo create a database instance, after install do\n\ sudo port select postgresql ${rname}\n\ sudo mkdir -p ${dbdir}\n\ sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\ sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' " livecheck.type none