Skip to content

Fix all postgresql server commands in launchctl wrappers and installation notes #28575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions databases/postgresql10-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ deprecated.upstream_support no

name postgresql10-server
version 10.19
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand All @@ -16,7 +17,7 @@ license Permissive
set rname postgresql10
description run ${rname} as server
long_description {*}${description}
distfiles
distfiles

homepage https://www.postgresql.org/
master_sites postgresql
Expand All @@ -42,10 +43,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL10DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL10DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL10DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL10DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -56,6 +57,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
10 changes: 7 additions & 3 deletions databases/postgresql10/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ PortSystem 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
PortGroup deprecated 1.0
PortGroup openssl 1.0

# Final release was on 2022-11-07
deprecated.upstream_support no
known_fail yes

#remember to update the -doc and -server as well
name postgresql10
version 10.19
revision 1
revision 2

categories databases
maintainers {jwa @jyrkiwahlstedt}
Expand All @@ -38,7 +38,11 @@ use_bzip2 yes
# do not build man or html files (use postgresqlXY-doc instead)
patchfiles-append patch-no_doc.diff

depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt path:lib/libgssapi_krb5.dylib:kerberos5
# https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch
patchfiles-append patch-xml_c.diff

openssl.branch 1.1
depends_lib port:readline port:zlib port:libxml2 port:libxslt path:lib/libgssapi_krb5.dylib:kerberos5
depends_build port:bison
depends_run port:postgresql_select-10

Expand Down
31 changes: 31 additions & 0 deletions databases/postgresql10/files/patch-xml_c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff -NaurdwB ./src/backend/utils/adt/xml.c ./src/backend/utils/adt/xml.c
--- ./src/backend/utils/adt/xml.c 2024-11-23 14:50:40
+++ ./src/backend/utils/adt/xml.c 2024-11-23 14:57:53
@@ -117,7 +117,12 @@

static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
+/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */
+#if LIBXML_VERSION >= 21200
+static void xml_errorHandler(void *data, const xmlError *error);
+#else
static void xml_errorHandler(void *data, xmlErrorPtr error);
+#endif
static void xml_ereport_by_code(int level, int sqlcode,
const char *msg, int errcode);
static void chopStringInfoNewlines(StringInfo str);
@@ -1655,8 +1660,12 @@
/*
* Error handler for libxml errors and warnings
*/
-static void
-xml_errorHandler(void *data, xmlErrorPtr error)
+/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */
+#if LIBXML_VERSION >= 21200
+static void xml_errorHandler(void *data, const xmlError *error)
+#else
+static void xml_errorHandler(void *data, xmlErrorPtr error)
+#endif
{
PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt;
11 changes: 6 additions & 5 deletions databases/postgresql11-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ deprecated.upstream_support no

name postgresql11-server
version 11.14
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand All @@ -16,7 +17,7 @@ license Permissive
set rname postgresql11
description run ${rname} as server
long_description {*}${description}
distfiles
distfiles

homepage https://www.postgresql.org/
master_sites postgresql
Expand All @@ -42,10 +43,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL11DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL11DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL11DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL11DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -56,6 +57,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
10 changes: 7 additions & 3 deletions databases/postgresql11/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ PortGroup compilers 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
PortGroup deprecated 1.0
PortGroup openssl 1.0

# EOL 2023-11-09
deprecated.upstream_support no
known_fail yes

#remember to update the -doc and -server as well
name postgresql11
version 11.14
revision 6
revision 7

categories databases
maintainers {jwa @jyrkiwahlstedt}
Expand All @@ -39,7 +39,11 @@ use_bzip2 yes
# do not build man or html files (use postgresqlXY-doc instead)
patchfiles-append patch-no_doc.diff

depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
# https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch
patchfiles-append patch-xml_c.diff

openssl.branch 1.1
depends_lib port:readline port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
depends_build port:bison port:pkgconfig
depends_run port:postgresql_select-11

Expand Down
31 changes: 31 additions & 0 deletions databases/postgresql11/files/patch-xml_c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff -NaurdwB ./src/backend/utils/adt/xml.c ./src/backend/utils/adt/xml.c
--- ./src/backend/utils/adt/xml.c 2024-11-23 14:50:40
+++ ./src/backend/utils/adt/xml.c 2024-11-23 14:57:53
@@ -117,7 +117,12 @@

static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
+/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */
+#if LIBXML_VERSION >= 21200
+static void xml_errorHandler(void *data, const xmlError *error);
+#else
static void xml_errorHandler(void *data, xmlErrorPtr error);
+#endif
static void xml_ereport_by_code(int level, int sqlcode,
const char *msg, int errcode);
static void chopStringInfoNewlines(StringInfo str);
@@ -1655,8 +1660,12 @@
/*
* Error handler for libxml errors and warnings
*/
-static void
-xml_errorHandler(void *data, xmlErrorPtr error)
+/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */
+#if LIBXML_VERSION >= 21200
+static void xml_errorHandler(void *data, const xmlError *error)
+#else
+static void xml_errorHandler(void *data, xmlErrorPtr error)
+#endif
{
PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt;
9 changes: 5 additions & 4 deletions databases/postgresql12-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PortSystem 1.0

name postgresql12-server
version 12.22
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand Down Expand Up @@ -38,10 +39,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL12DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL12DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL12DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL12DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -52,6 +53,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
6 changes: 4 additions & 2 deletions databases/postgresql12/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ PortSystem 1.0
PortGroup compilers 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
PortGroup openssl 1.0

#remember to update the -doc and -server as well
name postgresql12
version 12.22
revision 1
revision 2

categories databases
maintainers nomaintainer
Expand All @@ -34,7 +35,8 @@ use_bzip2 yes
# do not build man or html files (use postgresqlXY-doc instead)
patchfiles-append patch-no_doc.diff

depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
openssl.branch 3
depends_lib port:readline port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
depends_build port:bison port:pkgconfig
depends_run port:postgresql_select-12

Expand Down
9 changes: 5 additions & 4 deletions databases/postgresql13-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PortSystem 1.0

name postgresql13-server
version 13.21
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand Down Expand Up @@ -38,10 +39,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL13DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL13DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL13DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL13DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -52,6 +53,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
6 changes: 4 additions & 2 deletions databases/postgresql13/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ PortSystem 1.0
PortGroup compilers 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
PortGroup openssl 1.0

name postgresql13
version 13.21
revision 0
revision 1

categories databases
maintainers {gmail.com:davidgilman1 @dgilman} \
Expand Down Expand Up @@ -42,7 +43,8 @@ platform darwin powerpc {
patchfiles-append patch-icu.diff
}

depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
openssl.branch 3
depends_lib port:readline port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
depends_build port:bison port:pkgconfig
depends_run port:postgresql_select-13

Expand Down
9 changes: 5 additions & 4 deletions databases/postgresql14-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PortSystem 1.0

name postgresql14-server
version 14.18
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand Down Expand Up @@ -38,10 +39,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL14DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL14DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL14DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL14DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -52,6 +53,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
6 changes: 4 additions & 2 deletions databases/postgresql14/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ PortSystem 1.0
PortGroup compilers 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup muniversal 1.0
PortGroup openssl 1.0

#remember to update the -doc and -server as well
name postgresql14
version 14.18
revision 0
revision 1

categories databases
maintainers {gmail.com:davidgilman1 @dgilman} \
Expand Down Expand Up @@ -43,7 +44,8 @@ platform darwin powerpc {
patchfiles-append patch-icu.diff
}

depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
openssl.branch 3
depends_lib port:readline port:zlib port:libxml2 port:libxslt path:lib/pkgconfig/icu-uc.pc:icu path:lib/libgssapi_krb5.dylib:kerberos5
depends_build port:bison port:pkgconfig
depends_run port:postgresql_select-14

Expand Down
9 changes: 5 additions & 4 deletions databases/postgresql15-server/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PortSystem 1.0

name postgresql15-server
version 15.13
revision 1
categories databases
platforms {darwin any}
maintainers {jwa @jyrkiwahlstedt}
Expand Down Expand Up @@ -38,10 +39,10 @@ add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL15DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.start \
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL15DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL15DATA:=${dbdir}} stop -s -m fast\""
"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL15DATA:=${dbdir}} stop -s -m fast\""

destroot {
xinstall -m 755 -d ${destroot}${logdir}
Expand All @@ -52,6 +53,6 @@ destroot {
notes "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "
sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' "

livecheck.type none
Loading