Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] New package: postgresql12
@ 2020-01-08 23:03 voidlinux-github
  2020-01-28 21:54 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: voidlinux-github @ 2020-01-08 23:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

There is a new pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org postgresql12
https://github.com/void-linux/void-packages/pull/18121

[WIP] New package: postgresql12
Still some things to do, like fixing pg_config so postgis can be build for 12, adding postgresql-libs9.6 for rebuilding postgis, maybe behind option.

A patch file from https://github.com/void-linux/void-packages/pull/18121.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql12-18121.patch --]
[-- Type: text/x-diff, Size: 15606 bytes --]

From 7f666adf129c222cac198e0d56376861c3c8189a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 14 Oct 2019 07:07:52 +0200
Subject: [PATCH 1/2] New package: postgresql12

---
 srcpkgs/postgresql-libs                       |   2 +-
 srcpkgs/postgresql-libs-devel                 |   2 +-
 srcpkgs/postgresql12-client                   |   1 +
 srcpkgs/postgresql12-contrib                  |   1 +
 srcpkgs/postgresql12-doc                      |   1 +
 srcpkgs/postgresql12-plperl                   |   1 +
 srcpkgs/postgresql12-plpython                 |   1 +
 srcpkgs/postgresql12-pltcl                    |   1 +
 srcpkgs/postgresql12/files/postgresql.confd   |  17 ++
 srcpkgs/postgresql12/files/postgresql.pam     |   3 +
 .../postgresql12/files/postgresql12/log/run   |   2 +
 srcpkgs/postgresql12/files/postgresql12/run   |  24 +++
 srcpkgs/postgresql12/postgresql12-client      |   1 +
 srcpkgs/postgresql12/template                 | 176 ++++++++++++++++++
 srcpkgs/postgresql12/update                   |   2 +
 15 files changed, 233 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/postgresql12-client
 create mode 120000 srcpkgs/postgresql12-contrib
 create mode 120000 srcpkgs/postgresql12-doc
 create mode 120000 srcpkgs/postgresql12-plperl
 create mode 120000 srcpkgs/postgresql12-plpython
 create mode 120000 srcpkgs/postgresql12-pltcl
 create mode 100644 srcpkgs/postgresql12/files/postgresql.confd
 create mode 100644 srcpkgs/postgresql12/files/postgresql.pam
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/log/run
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/run
 create mode 120000 srcpkgs/postgresql12/postgresql12-client
 create mode 100644 srcpkgs/postgresql12/template
 create mode 100644 srcpkgs/postgresql12/update

diff --git a/srcpkgs/postgresql-libs b/srcpkgs/postgresql-libs
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs
+++ b/srcpkgs/postgresql-libs
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql-libs-devel b/srcpkgs/postgresql-libs-devel
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs-devel
+++ b/srcpkgs/postgresql-libs-devel
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-client b/srcpkgs/postgresql12-client
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-client
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-contrib b/srcpkgs/postgresql12-contrib
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-contrib
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-doc b/srcpkgs/postgresql12-doc
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-doc
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plperl b/srcpkgs/postgresql12-plperl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plperl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plpython b/srcpkgs/postgresql12-plpython
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plpython
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-pltcl b/srcpkgs/postgresql12-pltcl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-pltcl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12/files/postgresql.confd b/srcpkgs/postgresql12/files/postgresql.confd
new file mode 100644
index 00000000000..28f523db4f3
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.confd
@@ -0,0 +1,17 @@
+# Configuration file for the PostgreSQL server.
+
+# PostgreSQL's database directory
+PGROOT="/var/lib/postgresql12"
+
+# PostgreSQL's log file.
+PGLOG="/var/log/postgresql12.log"
+
+# Passed to initdb if necessary
+INITOPTS="-A peer --auth-host=md5 --auth-local=peer --locale en_US.UTF-8"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
diff --git a/srcpkgs/postgresql12/files/postgresql.pam b/srcpkgs/postgresql12/files/postgresql.pam
new file mode 100644
index 00000000000..53724d1f86a
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.pam
@@ -0,0 +1,3 @@
+auth		required	pam_unix.so
+account		required	pam_unix.so
+session		required	pam_unix.so
diff --git a/srcpkgs/postgresql12/files/postgresql12/log/run b/srcpkgs/postgresql12/files/postgresql12/log/run
new file mode 100755
index 00000000000..b306587efab
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t postgres12
diff --git a/srcpkgs/postgresql12/files/postgresql12/run b/srcpkgs/postgresql12/files/postgresql12/run
new file mode 100755
index 00000000000..f57d57ee155
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/run
@@ -0,0 +1,24 @@
+#!/bin/sh
+. /opt/psql12/etc/default/postgresql
+: ${PGDATA:="$PGROOT/data"}
+
+if [ "$PGROOT" != "/var/lib/postgresql12" ]; then
+	echo "Creating symlink /var/lib/postgresql12 -> $PGROOT"
+	ln -sf "$PGROOT" /var/lib/postgresql12
+fi
+
+
+if [ ! -d "$PGDATA" ]; then
+	echo "Initializing database in $PGDATA"
+
+	mkdir -p "$PGDATA"
+	chown -R postgres:postgres "$PGDATA"
+	chmod 0700 "$PGDATA"
+	su - postgres -m -c "/opt/psql12/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null
+
+	if [ -f /opt/psql12/etc/postgresql/postgresql.conf ]; then
+		ln -sf /opt/psql12/etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf"
+	fi
+fi
+
+exec chpst -u postgres:postgres postgres -D "$PGDATA" $PGOPTS 2>&1
diff --git a/srcpkgs/postgresql12/postgresql12-client b/srcpkgs/postgresql12/postgresql12-client
new file mode 120000
index 00000000000..bc3a387f0d2
--- /dev/null
+++ b/srcpkgs/postgresql12/postgresql12-client
@@ -0,0 +1 @@
+postgresql12-client
\ No newline at end of file
diff --git a/srcpkgs/postgresql12/template b/srcpkgs/postgresql12/template
new file mode 100644
index 00000000000..8bf0ef5d816
--- /dev/null
+++ b/srcpkgs/postgresql12/template
@@ -0,0 +1,176 @@
+# Template file for 'postgresql12'
+pkgname=postgresql12
+version=12.1
+revision=3
+wrksrc="postgresql-${version}"
+build_style=gnu-configure
+make_build_target=world
+_prefix="opt/psql12"
+configure_args="--with-openssl --with-python
+ --with-pam --prefix=/${_prefix} --bindir=/${_prefix}/bin --enable-thread-safety
+ --with-perl --with-tcl --without-ldap --without-gssapi
+ --without-bonjour --with-libxml --with-libxslt
+ --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
+hostmakedepends="docbook2x gettext flex openjade"
+makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
+ python3-devel readline-devel tcl-devel"
+short_desc="Sophisticated open-source Object-Relational DBMS"
+maintainer="Piotr Wójcik <chocimier@tlen.pl>"
+license="PostgreSQL"
+homepage="https://www.postgresql.org"
+distfiles="https://ftp.postgresql.org/pub/source/v${version}/postgresql-${version}.tar.bz2"
+checksum=a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed
+
+conf_files="
+ /${_prefix}/etc/default/postgresql
+ /${_prefix}/etc/pam.d/postgresql
+ /${_prefix}/etc/postgresql/postgresql.conf
+"
+
+# Create 'postgres' user for the server.
+system_accounts="postgres"
+postgres_homedir="/var/lib/postgresql"
+postgres_shell="/bin/sh"
+postgres_descr="PostgreSQL database server user"
+make_dirs="/var/lib/postgresql 0750 postgres postgres"
+
+if [ "$CROSS_BUILD" ]; then
+	configure_args+=" --without-perl --without-python --without-tcl"
+fi
+
+post_build() {
+	make -C contrib ${makejobs}
+}
+
+post_install() {
+	vmkdir ${_prefix}/share/man
+	cp -r doc/src/sgml/man? ${DESTDIR}/${_prefix}/share/man
+	vmkdir ${_prefix}/share/doc
+	cp -r doc/src/sgml/html ${DESTDIR}/${_prefix}/share/doc
+	vsv "${pkgname}"
+	vlicense COPYRIGHT
+
+	vinstall ${FILESDIR}/postgresql.confd 644 ${_prefix}/etc/default postgresql
+	vinstall ${FILESDIR}/postgresql.pam 644 ${_prefix}/etc/pam.d postgresql
+	vinstall ${DESTDIR}/${_prefix}/share/postgresql/postgresql.conf.sample \
+		644 ${_prefix}/etc/postgresql postgresql.conf
+
+	sed -i 's/install_bin = .*/install_bin = install/g' \
+		${DESTDIR}/${_prefix}/lib/postgresql/pgxs/src/Makefile.global
+}
+
+postgresql12-doc_package() {
+	short_desc="PostgreSQL documentation"
+	archs=noarch
+	pkg_install() {
+		vmove ${_prefix}/share/doc
+	}
+}
+
+postgresql-libs_package() {
+	short_desc="PostgreSQL shared libraries"
+	pkg_install() {
+		vmove "${_prefix}/lib/*.so*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		    -type f -name libpq5\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
+	}
+}
+
+postgresql-libs-devel_package() {
+	depends="postgresql-libs>=${version}_${revision}"
+	short_desc="PostgreSQL shared libraries (development files)"
+	pkg_install() {
+		for f in pg_config ecpg; do
+			vmove ${_prefix}/bin/${f}
+			vmove "${_prefix}/share/man/man1/$(basename ${f})*"
+		done
+		vmove ${_prefix}/include
+		vmove "${_prefix}/lib/*.a"
+		vmove "${_prefix}/lib/pkgconfig/*"
+		vmove ${_prefix}/share/man/man3
+		vmove ${_prefix}/lib/postgresql/pgxs
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pg_config\* -o -name ecpg\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
+	}
+}
+
+# XXX disabled for now in cross builds.
+if [ -z "$CROSS_BUILD" ]; then
+
+postgresql12-plperl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Perl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plperl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plperl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-plpython_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Python procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plpython*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plpython\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-pltcl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Tcl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/pltcl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pltcl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+fi # !CROSS_BUILD
+
+postgresql12-client_package() {
+	short_desc="Client frontends programs for PostgreSQL"
+	pkg_install() {
+		for f in clusterdb createdb createuser dropdb \
+			dropuser pg_dump pg_dumpall pg_isready pg_restore psql reindexdb \
+			vacuumdb; do
+			vmove ${_prefix}/bin/${f}
+			vmove ${_prefix}/share/man/man1/$(basename ${f}).1
+		done
+		vmove ${_prefix}/share/man/man7
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pgscripts\* -o \
+			   -name psql\* -o \
+			   -name pg_dump\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv ${DESTDIR}/${_prefix}/share/postgresql/psqlrc.* \
+			${PKGDESTDIR}/${_prefix}/share
+	}
+}
+
+postgresql12-contrib_package() {
+	short_desc="PostgreSQL contributed programs and extensions"
+	pkg_install() {
+		make -C contrib install DESTDIR=${PKGDESTDIR}
+	}
+}
diff --git a/srcpkgs/postgresql12/update b/srcpkgs/postgresql12/update
new file mode 100644
index 00000000000..01921d02619
--- /dev/null
+++ b/srcpkgs/postgresql12/update
@@ -0,0 +1,2 @@
+site="https://ftp.postgresql.org/pub/source/"
+pattern="v\K[\d.]+(?!\w)"

From db7dba9c28a2297fc3e80f59097f44cd4d9b49b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Sat, 4 Jan 2020 11:53:13 +0100
Subject: [PATCH 2/2] postgresql: exclude postgresql-libs

---
 srcpkgs/postgresql/template | 52 ++++++++++++-------------------------
 1 file changed, 17 insertions(+), 35 deletions(-)

diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 8cee6c69549..aff0c8d95ff 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,7 +1,7 @@
 # Template file for 'postgresql'
 pkgname=postgresql
 version=9.6.16
-revision=1
+revision=2
 build_style=gnu-configure
 make_build_target=world
 configure_args="--with-openssl --with-python
@@ -11,7 +11,7 @@ configure_args="--with-openssl --with-python
  --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
 hostmakedepends="docbook2x flex openjade"
 makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
- python-devel readline-devel tcl-devel"
+ python-devel readline-devel tcl-devel postgresql-libs-devel"
 short_desc="Sophisticated open-source Object-Relational DBMS"
 maintainer="Johannes <johannes.brechtmann@gmail.com>"
 license="PostgreSQL"
@@ -61,6 +61,21 @@ post_install() {
 
 	sed -i 's/install_bin = .*/install_bin = install/g' \
 		${DESTDIR}/usr/lib/postgresql/pgxs/src/Makefile.global
+
+	# postgresql-libs
+	rm ${DESTDIR}/usr/lib/*.so*
+	find ${DESTDIR}/usr/share/locale -type f -name libpq5\* -delete
+	rm -r ${DESTDIR}/usr/include
+	rm ${DESTDIR}/usr/lib/*.a
+	rm -r ${DESTDIR}/usr/lib/pkgconfig
+	rm -r ${DESTDIR}/usr/share/man/man3
+	rm -r ${DESTDIR}/usr/lib/postgresql/pgxs
+	find ${DESTDIR}/usr/share/locale -type f \
+	 -name pg_config\* -o -name ecpg\* -delete
+	for f in pg_config ecpg; do
+		rm ${DESTDIR}/usr/bin/${f}
+		rm ${DESTDIR}/usr/share/man/man1/$(basename ${f})*
+	done
 }
 
 postgresql-doc_package() {
@@ -71,39 +86,6 @@ postgresql-doc_package() {
 	}
 }
 
-postgresql-libs_package() {
-	short_desc="PostgreSQL shared libraries"
-	pkg_install() {
-		vmove "usr/lib/*.so*"
-		for d in $(find ${DESTDIR}/usr/share/locale \
-		    -type f -name libpq5\*); do
-			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-		done
-	}
-}
-
-postgresql-libs-devel_package() {
-	depends="postgresql-libs>=$version"
-	short_desc="PostgreSQL shared libraries (development files)"
-	pkg_install() {
-		for f in pg_config ecpg; do
-			vmove usr/bin/${f}
-			vmove "usr/share/man/man1/$(basename ${f})*"
-		done
-		vmove usr/include
-		vmove "usr/lib/*.a"
-		vmove "usr/lib/pkgconfig/*"
-		vmove usr/share/man/man3
-		vmove usr/lib/postgresql/pgxs
-		for d in $(find ${DESTDIR}/usr/share/locale \
-		   -type f -name pg_config\* -o -name ecpg\*); do
-			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-		done
-	}
-}
-
 # XXX disabled for now in cross builds.
 if [ -z "$CROSS_BUILD" ]; then
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
@ 2020-01-28 21:54 ` voidlinux-github
  2020-03-17 21:27 ` Chocimier
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: voidlinux-github @ 2020-01-28 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

There is an updated pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org postgresql12
https://github.com/void-linux/void-packages/pull/18121

[WIP] New package: postgresql12
Still some things to do, like fixing pg_config so postgis can be build for 12, adding postgresql-libs9.6 for rebuilding postgis, maybe behind option.

A patch file from https://github.com/void-linux/void-packages/pull/18121.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql12-18121.patch --]
[-- Type: text/x-diff, Size: 22063 bytes --]

From be230752be6df230ba37a52338c3a4216b749d1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 28 Jan 2020 22:52:54 +0100
Subject: [PATCH 1/5] New package: postgresql12

---
 srcpkgs/postgresql-libs                       |   2 +-
 srcpkgs/postgresql-libs-devel                 |   2 +-
 srcpkgs/postgresql12-client                   |   1 +
 srcpkgs/postgresql12-contrib                  |   1 +
 srcpkgs/postgresql12-doc                      |   1 +
 srcpkgs/postgresql12-plperl                   |   1 +
 srcpkgs/postgresql12-plpython                 |   1 +
 srcpkgs/postgresql12-pltcl                    |   1 +
 srcpkgs/postgresql12/files/postgresql.confd   |  17 ++
 srcpkgs/postgresql12/files/postgresql.pam     |   3 +
 .../postgresql12/files/postgresql12/log/run   |   2 +
 srcpkgs/postgresql12/files/postgresql12/run   |  24 +++
 srcpkgs/postgresql12/template                 | 176 ++++++++++++++++++
 srcpkgs/postgresql12/update                   |   2 +
 14 files changed, 232 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/postgresql12-client
 create mode 120000 srcpkgs/postgresql12-contrib
 create mode 120000 srcpkgs/postgresql12-doc
 create mode 120000 srcpkgs/postgresql12-plperl
 create mode 120000 srcpkgs/postgresql12-plpython
 create mode 120000 srcpkgs/postgresql12-pltcl
 create mode 100644 srcpkgs/postgresql12/files/postgresql.confd
 create mode 100644 srcpkgs/postgresql12/files/postgresql.pam
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/log/run
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/run
 create mode 100644 srcpkgs/postgresql12/template
 create mode 100644 srcpkgs/postgresql12/update

diff --git a/srcpkgs/postgresql-libs b/srcpkgs/postgresql-libs
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs
+++ b/srcpkgs/postgresql-libs
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql-libs-devel b/srcpkgs/postgresql-libs-devel
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs-devel
+++ b/srcpkgs/postgresql-libs-devel
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-client b/srcpkgs/postgresql12-client
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-client
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-contrib b/srcpkgs/postgresql12-contrib
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-contrib
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-doc b/srcpkgs/postgresql12-doc
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-doc
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plperl b/srcpkgs/postgresql12-plperl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plperl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plpython b/srcpkgs/postgresql12-plpython
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plpython
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-pltcl b/srcpkgs/postgresql12-pltcl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-pltcl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12/files/postgresql.confd b/srcpkgs/postgresql12/files/postgresql.confd
new file mode 100644
index 00000000000..28f523db4f3
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.confd
@@ -0,0 +1,17 @@
+# Configuration file for the PostgreSQL server.
+
+# PostgreSQL's database directory
+PGROOT="/var/lib/postgresql12"
+
+# PostgreSQL's log file.
+PGLOG="/var/log/postgresql12.log"
+
+# Passed to initdb if necessary
+INITOPTS="-A peer --auth-host=md5 --auth-local=peer --locale en_US.UTF-8"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
diff --git a/srcpkgs/postgresql12/files/postgresql.pam b/srcpkgs/postgresql12/files/postgresql.pam
new file mode 100644
index 00000000000..53724d1f86a
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.pam
@@ -0,0 +1,3 @@
+auth		required	pam_unix.so
+account		required	pam_unix.so
+session		required	pam_unix.so
diff --git a/srcpkgs/postgresql12/files/postgresql12/log/run b/srcpkgs/postgresql12/files/postgresql12/log/run
new file mode 100755
index 00000000000..b306587efab
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t postgres12
diff --git a/srcpkgs/postgresql12/files/postgresql12/run b/srcpkgs/postgresql12/files/postgresql12/run
new file mode 100755
index 00000000000..f57d57ee155
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/run
@@ -0,0 +1,24 @@
+#!/bin/sh
+. /opt/psql12/etc/default/postgresql
+: ${PGDATA:="$PGROOT/data"}
+
+if [ "$PGROOT" != "/var/lib/postgresql12" ]; then
+	echo "Creating symlink /var/lib/postgresql12 -> $PGROOT"
+	ln -sf "$PGROOT" /var/lib/postgresql12
+fi
+
+
+if [ ! -d "$PGDATA" ]; then
+	echo "Initializing database in $PGDATA"
+
+	mkdir -p "$PGDATA"
+	chown -R postgres:postgres "$PGDATA"
+	chmod 0700 "$PGDATA"
+	su - postgres -m -c "/opt/psql12/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null
+
+	if [ -f /opt/psql12/etc/postgresql/postgresql.conf ]; then
+		ln -sf /opt/psql12/etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf"
+	fi
+fi
+
+exec chpst -u postgres:postgres postgres -D "$PGDATA" $PGOPTS 2>&1
diff --git a/srcpkgs/postgresql12/template b/srcpkgs/postgresql12/template
new file mode 100644
index 00000000000..8bf0ef5d816
--- /dev/null
+++ b/srcpkgs/postgresql12/template
@@ -0,0 +1,176 @@
+# Template file for 'postgresql12'
+pkgname=postgresql12
+version=12.1
+revision=3
+wrksrc="postgresql-${version}"
+build_style=gnu-configure
+make_build_target=world
+_prefix="opt/psql12"
+configure_args="--with-openssl --with-python
+ --with-pam --prefix=/${_prefix} --bindir=/${_prefix}/bin --enable-thread-safety
+ --with-perl --with-tcl --without-ldap --without-gssapi
+ --without-bonjour --with-libxml --with-libxslt
+ --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
+hostmakedepends="docbook2x gettext flex openjade"
+makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
+ python3-devel readline-devel tcl-devel"
+short_desc="Sophisticated open-source Object-Relational DBMS"
+maintainer="Piotr Wójcik <chocimier@tlen.pl>"
+license="PostgreSQL"
+homepage="https://www.postgresql.org"
+distfiles="https://ftp.postgresql.org/pub/source/v${version}/postgresql-${version}.tar.bz2"
+checksum=a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed
+
+conf_files="
+ /${_prefix}/etc/default/postgresql
+ /${_prefix}/etc/pam.d/postgresql
+ /${_prefix}/etc/postgresql/postgresql.conf
+"
+
+# Create 'postgres' user for the server.
+system_accounts="postgres"
+postgres_homedir="/var/lib/postgresql"
+postgres_shell="/bin/sh"
+postgres_descr="PostgreSQL database server user"
+make_dirs="/var/lib/postgresql 0750 postgres postgres"
+
+if [ "$CROSS_BUILD" ]; then
+	configure_args+=" --without-perl --without-python --without-tcl"
+fi
+
+post_build() {
+	make -C contrib ${makejobs}
+}
+
+post_install() {
+	vmkdir ${_prefix}/share/man
+	cp -r doc/src/sgml/man? ${DESTDIR}/${_prefix}/share/man
+	vmkdir ${_prefix}/share/doc
+	cp -r doc/src/sgml/html ${DESTDIR}/${_prefix}/share/doc
+	vsv "${pkgname}"
+	vlicense COPYRIGHT
+
+	vinstall ${FILESDIR}/postgresql.confd 644 ${_prefix}/etc/default postgresql
+	vinstall ${FILESDIR}/postgresql.pam 644 ${_prefix}/etc/pam.d postgresql
+	vinstall ${DESTDIR}/${_prefix}/share/postgresql/postgresql.conf.sample \
+		644 ${_prefix}/etc/postgresql postgresql.conf
+
+	sed -i 's/install_bin = .*/install_bin = install/g' \
+		${DESTDIR}/${_prefix}/lib/postgresql/pgxs/src/Makefile.global
+}
+
+postgresql12-doc_package() {
+	short_desc="PostgreSQL documentation"
+	archs=noarch
+	pkg_install() {
+		vmove ${_prefix}/share/doc
+	}
+}
+
+postgresql-libs_package() {
+	short_desc="PostgreSQL shared libraries"
+	pkg_install() {
+		vmove "${_prefix}/lib/*.so*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		    -type f -name libpq5\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
+	}
+}
+
+postgresql-libs-devel_package() {
+	depends="postgresql-libs>=${version}_${revision}"
+	short_desc="PostgreSQL shared libraries (development files)"
+	pkg_install() {
+		for f in pg_config ecpg; do
+			vmove ${_prefix}/bin/${f}
+			vmove "${_prefix}/share/man/man1/$(basename ${f})*"
+		done
+		vmove ${_prefix}/include
+		vmove "${_prefix}/lib/*.a"
+		vmove "${_prefix}/lib/pkgconfig/*"
+		vmove ${_prefix}/share/man/man3
+		vmove ${_prefix}/lib/postgresql/pgxs
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pg_config\* -o -name ecpg\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
+	}
+}
+
+# XXX disabled for now in cross builds.
+if [ -z "$CROSS_BUILD" ]; then
+
+postgresql12-plperl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Perl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plperl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plperl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-plpython_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Python procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plpython*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plpython\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-pltcl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Tcl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/pltcl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pltcl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+fi # !CROSS_BUILD
+
+postgresql12-client_package() {
+	short_desc="Client frontends programs for PostgreSQL"
+	pkg_install() {
+		for f in clusterdb createdb createuser dropdb \
+			dropuser pg_dump pg_dumpall pg_isready pg_restore psql reindexdb \
+			vacuumdb; do
+			vmove ${_prefix}/bin/${f}
+			vmove ${_prefix}/share/man/man1/$(basename ${f}).1
+		done
+		vmove ${_prefix}/share/man/man7
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pgscripts\* -o \
+			   -name psql\* -o \
+			   -name pg_dump\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv ${DESTDIR}/${_prefix}/share/postgresql/psqlrc.* \
+			${PKGDESTDIR}/${_prefix}/share
+	}
+}
+
+postgresql12-contrib_package() {
+	short_desc="PostgreSQL contributed programs and extensions"
+	pkg_install() {
+		make -C contrib install DESTDIR=${PKGDESTDIR}
+	}
+}
diff --git a/srcpkgs/postgresql12/update b/srcpkgs/postgresql12/update
new file mode 100644
index 00000000000..01921d02619
--- /dev/null
+++ b/srcpkgs/postgresql12/update
@@ -0,0 +1,2 @@
+site="https://ftp.postgresql.org/pub/source/"
+pattern="v\K[\d.]+(?!\w)"

From 78ae3f405cd328270ee1c43315430107845203eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 28 Jan 2020 22:52:54 +0100
Subject: [PATCH 2/5] postgresql: exclude postgresql-libs

---
 srcpkgs/postgresql/template | 52 ++++++++++++-------------------------
 1 file changed, 17 insertions(+), 35 deletions(-)

diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 58dbbe1bd9a..bc661c1ccf6 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,7 +1,7 @@
 # Template file for 'postgresql'
 pkgname=postgresql
 version=9.6.16
-revision=1
+revision=2
 build_style=gnu-configure
 make_build_target=world
 configure_args="--with-openssl --with-python
@@ -11,7 +11,7 @@ configure_args="--with-openssl --with-python
  --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
 hostmakedepends="docbook2x flex gettext openjade"
 makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
- python-devel readline-devel tcl-devel"
+ python-devel readline-devel tcl-devel postgresql-libs-devel"
 short_desc="Sophisticated open-source Object-Relational DBMS"
 maintainer="Johannes <johannes.brechtmann@gmail.com>"
 license="PostgreSQL"
@@ -61,6 +61,21 @@ post_install() {
 
 	sed -i 's/install_bin = .*/install_bin = install/g' \
 		${DESTDIR}/usr/lib/postgresql/pgxs/src/Makefile.global
+
+	# postgresql-libs
+	rm ${DESTDIR}/usr/lib/*.so*
+	find ${DESTDIR}/usr/share/locale -type f -name libpq5\* -delete
+	rm -r ${DESTDIR}/usr/include
+	rm ${DESTDIR}/usr/lib/*.a
+	rm -r ${DESTDIR}/usr/lib/pkgconfig
+	rm -r ${DESTDIR}/usr/share/man/man3
+	rm -r ${DESTDIR}/usr/lib/postgresql/pgxs
+	find ${DESTDIR}/usr/share/locale -type f \
+	 -name pg_config\* -o -name ecpg\* -delete
+	for f in pg_config ecpg; do
+		rm ${DESTDIR}/usr/bin/${f}
+		rm ${DESTDIR}/usr/share/man/man1/$(basename ${f})*
+	done
 }
 
 postgresql-doc_package() {
@@ -71,39 +86,6 @@ postgresql-doc_package() {
 	}
 }
 
-postgresql-libs_package() {
-	short_desc="PostgreSQL shared libraries"
-	pkg_install() {
-		vmove "usr/lib/*.so*"
-		for d in $(find ${DESTDIR}/usr/share/locale \
-		    -type f -name libpq5\*); do
-			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-		done
-	}
-}
-
-postgresql-libs-devel_package() {
-	depends="postgresql-libs>=$version"
-	short_desc="PostgreSQL shared libraries (development files)"
-	pkg_install() {
-		for f in pg_config ecpg; do
-			vmove usr/bin/${f}
-			vmove "usr/share/man/man1/$(basename ${f})*"
-		done
-		vmove usr/include
-		vmove "usr/lib/*.a"
-		vmove "usr/lib/pkgconfig/*"
-		vmove usr/share/man/man3
-		vmove usr/lib/postgresql/pgxs
-		for d in $(find ${DESTDIR}/usr/share/locale \
-		   -type f -name pg_config\* -o -name ecpg\*); do
-			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
-		done
-	}
-}
-
 # XXX disabled for now in cross builds.
 if [ -z "$CROSS_BUILD" ]; then
 

From 6bbb948043b29bd50f709c2814e0f6531e1abb83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 28 Jan 2020 22:52:54 +0100
Subject: [PATCH 3/5] unset bindir

---
 .../patches/postgresql12-12.1.patch           | 22 +++++++++++++++
 srcpkgs/postgresql12/template                 | 28 ++++++++++++++++---
 2 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/postgresql12/patches/postgresql12-12.1.patch

diff --git a/srcpkgs/postgresql12/patches/postgresql12-12.1.patch b/srcpkgs/postgresql12/patches/postgresql12-12.1.patch
new file mode 100644
index 00000000000..65bab8ad4c6
--- /dev/null
+++ b/srcpkgs/postgresql12/patches/postgresql12-12.1.patch
@@ -0,0 +1,22 @@
+From bf0601df89f611b33d8dbc27722351bf99e2cc18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
+Date: Sat, 18 Jan 2020 12:19:45 +0100
+Subject: [PATCH] relocate
+
+
+diff --git src/port/path.c src/port/path.c
+index 710988b..20dc57d 100644
+--- src/port/path.c
++++ src/port/path.c
+@@ -544,6 +544,8 @@ make_relative_path(char *ret_path, const char *target_path,
+ 	int			tail_len;
+ 	int			i;
+ 
++	goto no_match; // we relocate only binaries
++
+ 	/*
+ 	 * Determine the common prefix --- note we require it to end on a
+ 	 * directory separator, consider eg '/usr/lib' and '/usr/libexec'.
+-- 
+2.23.0
+
diff --git a/srcpkgs/postgresql12/template b/srcpkgs/postgresql12/template
index 8bf0ef5d816..020494f2f54 100644
--- a/srcpkgs/postgresql12/template
+++ b/srcpkgs/postgresql12/template
@@ -7,10 +7,10 @@ build_style=gnu-configure
 make_build_target=world
 _prefix="opt/psql12"
 configure_args="--with-openssl --with-python
- --with-pam --prefix=/${_prefix} --bindir=/${_prefix}/bin --enable-thread-safety
+ --with-pam --enable-thread-safety
  --with-perl --with-tcl --without-ldap --without-gssapi
  --without-bonjour --with-libxml --with-libxslt
- --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
+ --enable-nls --with-uuid=e2fs"
 hostmakedepends="docbook2x gettext flex openjade"
 makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
  python3-devel readline-devel tcl-devel"
@@ -38,6 +38,24 @@ if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --without-perl --without-python --without-tcl"
 fi
 
+pre_configure() {
+	_style_configure_args="${configure_args}"
+	configure_args=" "
+	for arg in ${_style_configure_args}
+	do
+		case $arg in
+			--prefix=*|*dir=*) echo "dropping $arg";;
+			*) configure_args+=" $arg"; echo "taking $arg"
+		esac
+	done
+	configure_args="--prefix=/${_prefix}
+	 --sysconfdir=/${_prefix}/etc
+	 --with-system-tzdata=/usr/share/zoneinfo
+	 ${configure_args}"
+	echo "$configure_args"
+}
+
+
 post_build() {
 	make -C contrib ${makejobs}
 }
@@ -76,7 +94,8 @@ postgresql-libs_package() {
 			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
 			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
 		done
-		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
+		mkdir -p "${PKGDESTDIR}/usr"
+		mv -T ${PKGDESTDIR}/${_prefix}/lib ${PKGDESTDIR}/usr/lib
 	}
 }
 
@@ -84,9 +103,11 @@ postgresql-libs-devel_package() {
 	depends="postgresql-libs>=${version}_${revision}"
 	short_desc="PostgreSQL shared libraries (development files)"
 	pkg_install() {
+		mkdir -p "${PKGDESTDIR}/usr/bin"
 		for f in pg_config ecpg; do
 			vmove ${_prefix}/bin/${f}
 			vmove "${_prefix}/share/man/man1/$(basename ${f})*"
+			ln -sr "${PKGDESTDIR}/${_prefix}/bin/${f}" "${PKGDESTDIR}/usr/bin"
 		done
 		vmove ${_prefix}/include
 		vmove "${_prefix}/lib/*.a"
@@ -98,7 +119,6 @@ postgresql-libs-devel_package() {
 			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
 			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
 		done
-		mv -T ${PKGDESTDIR}/${_prefix} ${PKGDESTDIR}/usr
 	}
 }
 

From 204caaf3012239e240422b576cfaaca86e19f204 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 28 Jan 2020 22:52:54 +0100
Subject: [PATCH 4/5] link libs

---
 srcpkgs/postgresql12/template | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/srcpkgs/postgresql12/template b/srcpkgs/postgresql12/template
index 020494f2f54..5e2b544d706 100644
--- a/srcpkgs/postgresql12/template
+++ b/srcpkgs/postgresql12/template
@@ -114,6 +114,9 @@ postgresql-libs-devel_package() {
 		vmove "${_prefix}/lib/pkgconfig/*"
 		vmove ${_prefix}/share/man/man3
 		vmove ${_prefix}/lib/postgresql/pgxs
+		for f in libpq.so libpgtypes.so libecpg_compat.so libecpg.so; do
+			ln -sr "${PKGDESTDIR}/usr/lib/${f}" "${PKGDESTDIR}/${_prefix}/lib"
+		done
 		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
 		   -type f -name pg_config\* -o -name ecpg\*); do
 			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})

From 9b32a775be6e3a2f18c70d73052eef92204982ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 28 Jan 2020 22:52:55 +0100
Subject: [PATCH 5/5] New package: postgis-postgresql12-3.0.0

---
 srcpkgs/postgis-postgresql12/template | 27 +++++++++++++++++++++++++++
 srcpkgs/postgis-postgresql12/update   |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/postgis-postgresql12/template
 create mode 100644 srcpkgs/postgis-postgresql12/update

diff --git a/srcpkgs/postgis-postgresql12/template b/srcpkgs/postgis-postgresql12/template
new file mode 100644
index 00000000000..dd20fb1782d
--- /dev/null
+++ b/srcpkgs/postgis-postgresql12/template
@@ -0,0 +1,27 @@
+# Template file for 'postgis-postgresql12'
+pkgname=postgis-postgresql12
+version=3.0.0
+revision=1
+wrksrc="postgis-${version}"
+build_style=gnu-configure
+configure_args="--prefix=/opt/psql12
+ --with-projdir=${XBPS_CROSS_BASE}/usr
+ --with-jsondir=${XBPS_CROSS_BASE}/usr
+ --with-protobufdir=${XBPS_CROSS_BASE}/usr
+ --with-geosconfig=${XBPS_CROSS_BASE}/usr/bin/geos-config"
+hostmakedepends="automake libtool perl pkg-config geos
+ libgdal-tools postgresql-libs-devel which"
+makedepends="geos-devel libgdal-devel libpqxx-devel libxml2-devel postgresql-libs-devel
+ proj-devel protobuf-c-devel pcre-devel json-c-devel"
+short_desc="Spatial database extender for PostgreSQL"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-2.0-or-later"
+homepage="https://postgis.net/"
+changelog="https://git.osgeo.org/gitea/postgis/postgis/raw/tag/${version}/NEWS"
+distfiles="https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz"
+checksum=c06fd2cd5cea0119106ffe17a7235d893c2bbe6f4b63c8617c767630973ba594
+nocross="FIXME: Cannot run test program to determine PROJ version"
+
+pre_configure() {
+	./autogen.sh
+}
diff --git a/srcpkgs/postgis-postgresql12/update b/srcpkgs/postgis-postgresql12/update
new file mode 100644
index 00000000000..70f8b7290d7
--- /dev/null
+++ b/srcpkgs/postgis-postgresql12/update
@@ -0,0 +1 @@
+ignore="*alpha*"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [WIP] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
  2020-01-28 21:54 ` [PR PATCH] [Updated] " voidlinux-github
@ 2020-03-17 21:27 ` Chocimier
  2020-03-17 21:54 ` [to test] " Anachron
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Chocimier @ 2020-03-17 21:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/18121#issuecomment-600309942

Comment:
The goal is to allow upgrade database from 9.6 to 12 with pg_upgrade. This requires to simultanoulsy install both versions. Shared library seems to be reusable.

Package is installed into /opt because pg_upgrade needs separate bindir for old and new version.
Modifying configure_args from build-style allows to consistenly set all installation paths.
System account and its parameters are same as in postgresql[9.6].
Manpages are suffixed with -12 and moved do default mandir.

Tested upgrading databases: one with tcl stored procedure and trivial postgis table and repology db using out-of-tree compiled extension.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [to test] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
  2020-01-28 21:54 ` [PR PATCH] [Updated] " voidlinux-github
  2020-03-17 21:27 ` Chocimier
@ 2020-03-17 21:54 ` Anachron
  2020-03-17 22:45 ` Chocimier
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Anachron @ 2020-03-17 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

New comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/pull/18121#issuecomment-600319328

Comment:
I'm using postgresql. Will it be moved again from opt after the migration? I'll try this PR on my VPS soon(ish).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [to test] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
                   ` (2 preceding siblings ...)
  2020-03-17 21:54 ` [to test] " Anachron
@ 2020-03-17 22:45 ` Chocimier
  2020-05-23 10:40 ` oranenj
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Chocimier @ 2020-03-17 22:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/18121#issuecomment-600336915

Comment:
I do not think juggling with paths is convenient. But maybe some net of /usr/libexec, /usr/share/psql/12, and so on can be used instead of /opt (since 13?).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [to test] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
                   ` (3 preceding siblings ...)
  2020-03-17 22:45 ` Chocimier
@ 2020-05-23 10:40 ` oranenj
  2020-07-06 19:29 ` [PR PATCH] [Updated] " Chocimier
  2020-07-06 20:03 ` [PR PATCH] [Merged]: " Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: oranenj @ 2020-05-23 10:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

New comment by oranenj on void-packages repository

https://github.com/void-linux/void-packages/pull/18121#issuecomment-633024309

Comment:
Just drive-by commenting here but FWIW, the upstream "PGDG" packages for eg. CentOS do separate packages for each major version and install files under /usr/pgsql-$MAJOR/ along with providing alternatives configuration that set up symlinks to the various binaries and manual pages under standard paths.

The alternatives probably can't be set up on a machine where postgresql 9.6 is also installed unless you provide an update that moves the files, but it might make sense to keep things in line with upstream for future versions.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] [to test] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
                   ` (4 preceding siblings ...)
  2020-05-23 10:40 ` oranenj
@ 2020-07-06 19:29 ` Chocimier
  2020-07-06 20:03 ` [PR PATCH] [Merged]: " Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: Chocimier @ 2020-07-06 19:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

There is an updated pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org postgresql12
https://github.com/void-linux/void-packages/pull/18121

[to test] New package: postgresql12
Still some things to do, like fixing pg_config so postgis can be build for 12, adding postgresql-libs9.6 for rebuilding postgis, maybe behind option.

Edit: done.

A patch file from https://github.com/void-linux/void-packages/pull/18121.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql12-18121.patch --]
[-- Type: text/x-diff, Size: 30491 bytes --]

From b2902acce80de2b5ed248dfc961b9ad8e221cdc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 6 Jul 2020 21:25:01 +0200
Subject: [PATCH 1/5] postgresql: fix tests

---
 srcpkgs/postgresql/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 51fdb0b0114..fa1e0bc2e68 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -12,6 +12,7 @@ configure_args="--with-openssl --with-python
 hostmakedepends="docbook2x flex gettext openjade"
 makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
  python-devel readline-devel tcl-devel"
+checkdepends="tzdata"
 short_desc="Sophisticated open-source Object-Relational DBMS"
 maintainer="Johannes <johannes.brechtmann@gmail.com>"
 license="PostgreSQL"

From 646db9aaf4a9426e279080314c42f893281337b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 6 Jul 2020 21:25:01 +0200
Subject: [PATCH 2/5] New package: postgresql12

---
 srcpkgs/postgresql-libs                       |   2 +-
 srcpkgs/postgresql-libs-devel                 |   2 +-
 srcpkgs/postgresql12-client                   |   1 +
 srcpkgs/postgresql12-contrib                  |   1 +
 srcpkgs/postgresql12-doc                      |   1 +
 srcpkgs/postgresql12-plperl                   |   1 +
 srcpkgs/postgresql12-plpython                 |   1 +
 srcpkgs/postgresql12-pltcl                    |   1 +
 srcpkgs/postgresql12/files/pg_config.sh.in    | 143 +++++++++++
 srcpkgs/postgresql12/files/postgresql.confd   |  17 ++
 srcpkgs/postgresql12/files/postgresql.pam     |   3 +
 .../postgresql12/files/postgresql12/control/t |   2 +
 .../postgresql12/files/postgresql12/log/run   |   2 +
 srcpkgs/postgresql12/files/postgresql12/run   |  24 ++
 srcpkgs/postgresql12/files/profile.sh         |  14 ++
 .../patches/pg_config-cross-value.patch       |  46 ++++
 srcpkgs/postgresql12/patches/relocate.patch   |  22 ++
 srcpkgs/postgresql12/template                 | 228 ++++++++++++++++++
 srcpkgs/postgresql12/update                   |   2 +
 19 files changed, 511 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/postgresql12-client
 create mode 120000 srcpkgs/postgresql12-contrib
 create mode 120000 srcpkgs/postgresql12-doc
 create mode 120000 srcpkgs/postgresql12-plperl
 create mode 120000 srcpkgs/postgresql12-plpython
 create mode 120000 srcpkgs/postgresql12-pltcl
 create mode 100644 srcpkgs/postgresql12/files/pg_config.sh.in
 create mode 100644 srcpkgs/postgresql12/files/postgresql.confd
 create mode 100644 srcpkgs/postgresql12/files/postgresql.pam
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/control/t
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/log/run
 create mode 100755 srcpkgs/postgresql12/files/postgresql12/run
 create mode 100644 srcpkgs/postgresql12/files/profile.sh
 create mode 100644 srcpkgs/postgresql12/patches/pg_config-cross-value.patch
 create mode 100644 srcpkgs/postgresql12/patches/relocate.patch
 create mode 100644 srcpkgs/postgresql12/template
 create mode 100644 srcpkgs/postgresql12/update

diff --git a/srcpkgs/postgresql-libs b/srcpkgs/postgresql-libs
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs
+++ b/srcpkgs/postgresql-libs
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql-libs-devel b/srcpkgs/postgresql-libs-devel
index 360e6d1a1f4..52711bfce65 120000
--- a/srcpkgs/postgresql-libs-devel
+++ b/srcpkgs/postgresql-libs-devel
@@ -1 +1 @@
-postgresql
\ No newline at end of file
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-client b/srcpkgs/postgresql12-client
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-client
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-contrib b/srcpkgs/postgresql12-contrib
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-contrib
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-doc b/srcpkgs/postgresql12-doc
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-doc
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plperl b/srcpkgs/postgresql12-plperl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plperl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-plpython b/srcpkgs/postgresql12-plpython
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-plpython
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12-pltcl b/srcpkgs/postgresql12-pltcl
new file mode 120000
index 00000000000..52711bfce65
--- /dev/null
+++ b/srcpkgs/postgresql12-pltcl
@@ -0,0 +1 @@
+postgresql12
\ No newline at end of file
diff --git a/srcpkgs/postgresql12/files/pg_config.sh.in b/srcpkgs/postgresql12/files/pg_config.sh.in
new file mode 100644
index 00000000000..bb650910a90
--- /dev/null
+++ b/srcpkgs/postgresql12/files/pg_config.sh.in
@@ -0,0 +1,143 @@
+#!/bin/sh
+# Released to Public Domain by Doan Tran Cong Danh
+
+print() {
+	printf '%s\n' "$@"
+}
+
+sysroot="$(cd "${0%@PREFIX@/*}" && pwd)"
+
+BINDIR="$sysroot/@PREFIX@/bin"
+DOCDIR="$sysroot/@PREFIX@/share/doc/postgresql"
+HTMLDIR="$sysroot/@PREFIX@/share/doc/postgresql"
+INCLUDEDIR="$sysroot/@PREFIX@/include"
+PKGINCLUDEDIR="$sysroot/@PREFIX@/include/postgresql"
+INCLUDEDIR_SERVER="$sysroot/@PREFIX@/include/postgresql/server"
+LIBDIR="$sysroot/@PREFIX@/lib"
+PKGLIBDIR="$sysroot/@PREFIX@/lib/postgresql"
+LOCALEDIR="$sysroot/@PREFIX@/share/locale"
+MANDIR="$sysroot/@PREFIX@/share/man"
+SHAREDIR="$sysroot/@PREFIX@/share/postgresql"
+SYSCONFDIR="$sysroot/@PREFIX@/etc/postgresql"
+PGXS="$sysroot/@PREFIX@/lib/postgresql/pgxs/src/makefiles/pgxs.mk"
+
+CONFIGURE="@configure_args@"
+CC="@CC@"
+CPPFLAGS="@CPPFLAGS@"
+CFLAGS="@CFLAGS@"
+CFLAGS_SL="@CFLAGS_SL@"
+LDFLAGS="@LDFLAGS@"
+LDFLAGS_EX="@LDFLAGS_EX@"
+LDFLAGS_SL="@LDFLAGS_SL@"
+LIBS="@LIBS@"
+VERSION="PostgreSQL @FULL_VERSION@"
+
+if [ "$sysroot" != "/" ]; then
+	CPPFLAGS="$(print "$CPPFLAGS" | sed "s,-I *\\(/@PREFIX@/include\\),-I$sysroot\\1,g")"
+	CFLAGS="$(print "$CFLAGS" | sed "s,-I *\\(/@PREFIX@/include\\),-I$sysroot\\1,g")"
+	LDFLAGS="$(print "$LDFLAGS" | sed "s,-L *\\(/@PREFIX@/lib\\),-L$sysroot\\1,g")"
+fi
+
+usage() {
+	cat <<-EOF
+	$0 provides information about the installed version of PostgreSQL.
+
+	Usage:
+	  $0 [OPTION]...
+
+	Options:
+	  --bindir              show location of user executables
+	  --docdir              show location of documentation files
+	  --htmldir             show location of HTML documentation files
+	  --includedir          show location of C header files of the client interfaces
+	  --pkgincludedir       show location of other C header files
+	  --includedir-server   show location of C header files for the server
+	  --libdir              show location of object code libraries
+	  --pkglibdir           show location of dynamically loadable modules
+	  --localedir           show location of locale support files
+	  --mandir              show location of manual pages
+	  --sharedir            show location of architecture-independent support files
+	  --sysconfdir          show location of system-wide configuration files
+	  --pgxs                show location of extension makefile
+	  --configure           show options given to PostgreSQL was built
+	  --cc                  show CC value used when PostgreSQL was built
+	  --cppflags            show CPPFLAGS value used when PostgreSQL was built
+	  --cflags              show CFLAGS value used when PostgreSQL was built
+	  --cflags_sl           show CFLAGS_SL value used when PostgreSQL was built
+	  --ldflags             show LDFLAGS value used when PostgreSQL was built
+	  --ldflags_ex          show LDFLAGS_EX value used when PostgreSQL was built
+	  --ldflags_sl          show LDFLAGS_SL value used when PostgreSQL was built
+	  --libs                show LIBS value used when PostgreSQL was built
+	  --version             show the PostgreSQL version
+	  -?, --help            show this help, then exit
+
+	With no arguments, all known items are shown.
+
+	Report bugs to <pgsql-bugs@postgresql.org>.
+	EOF
+}
+
+if test $# -eq 0; then
+	cat <<-EOF
+	BINDIR = $BINDIR
+	DOCDIR = $DOCDIR
+	HTMLDIR = $HTMLDIR
+	INCLUDEDIR = $INCLUDEDIR
+	PKGINCLUDEDIR = $PKGINCLUDEDIR
+	INCLUDEDIR-SERVER = $INCLUDEDIR_SERVER
+	LIBDIR = $LIBDIR
+	PKGLIBDIR = $PKGLIBDIR
+	LOCALEDIR = $LOCALEDIR
+	MANDIR = $MANDIR
+	SHAREDIR = $SHAREDIR
+	SYSCONFDIR = $SYSCONFDIR
+	PGXS = $PGXS
+	CONFIGURE = $CONFIGURE
+	CC = $CC
+	CPPFLAGS = $CPPFLAGS
+	CFLAGS = $CFLAGS
+	CFLAGS_SL = $CFLAGS_SL
+	LDFLAGS = $LDFLAGS
+	LDFLAGS_EX = $LDFLAGS_EX
+	LDFLAGS_SL = $LDFLAGS_SL
+	LIBS = $LIBS
+	VERSION = $VERSION
+	EOF
+fi
+
+for arg
+do
+	if test "x$arg" = "x--help" || test "x$arg" = "x-?"; then
+		usage
+		exit 0
+	fi
+done
+
+for arg
+do
+	case "$arg" in
+	--bindir) print "$BINDIR" ;;
+	--docdir) print "$DOCDIR" ;;
+	--htmldir) print "$HTMLDIR" ;;
+	--includedir) print "$INCLUDEDIR" ;;
+	--pkgincludedir) print "$PKGINCLUDEDIR" ;;
+	--includedir-server) print "$INCLUDEDIR_SERVER" ;;
+	--libdir) print "$LIBDIR" ;;
+	--pkglibdir) print "$PKGLIBDIR" ;;
+	--localedir) print "$LOCALEDIR" ;;
+	--mandir) print "$MANDIR" ;;
+	--sharedir) print "$SHAREDIR" ;;
+	--sysconfdir) print "$SYSCONFDIR" ;;
+	--pgxs) print "$PGXS" ;;
+	--configure) print "$CONFIGURE" ;;
+	--cc) print "$CC" ;;
+	--cppflags) print "$CPPFLAGS" ;;
+	--cflags) print "$CFLAGS" ;;
+	--cflags_sl) print "$CFLAGS_SL" ;;
+	--ldflags) print "$LDFLAGS" ;;
+	--ldflags_ex) print "$LDFLAGS_EX" ;;
+	--ldflags_sl) print "$LDFLAGS_SL" ;;
+	--libs) print "$LIBS" ;;
+	--version) print "$VERSION" ;;
+	esac
+done
diff --git a/srcpkgs/postgresql12/files/postgresql.confd b/srcpkgs/postgresql12/files/postgresql.confd
new file mode 100644
index 00000000000..fe7106626fa
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.confd
@@ -0,0 +1,17 @@
+# Configuration file for the PostgreSQL server.
+
+# PostgreSQL's database directory
+PGROOT="/var/lib/postgresql@VERSION@"
+
+# PostgreSQL's log file.
+PGLOG="/var/log/postgresql@VERSION@.log"
+
+# Passed to initdb if necessary
+INITOPTS="-A peer --auth-host=md5 --auth-local=peer --locale en_US.UTF-8"
+
+# Extra options to run postmaster with, e.g.:
+# -N is the maximal number of client connections
+# -B is the number of shared buffers and has to be at least 2x the value for -N
+# Please read the man-page to postmaster for more options. Many of these options
+# can be set directly in the configuration-file.
+#PGOPTS="-N 512 -B 1024"
diff --git a/srcpkgs/postgresql12/files/postgresql.pam b/srcpkgs/postgresql12/files/postgresql.pam
new file mode 100644
index 00000000000..53724d1f86a
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql.pam
@@ -0,0 +1,3 @@
+auth		required	pam_unix.so
+account		required	pam_unix.so
+session		required	pam_unix.so
diff --git a/srcpkgs/postgresql12/files/postgresql12/control/t b/srcpkgs/postgresql12/files/postgresql12/control/t
new file mode 100755
index 00000000000..dcedfaa2018
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/control/t
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/kill -INT `/usr/bin/head -1 /run/runit/supervise.postgresql@VERSION@/pid`
diff --git a/srcpkgs/postgresql12/files/postgresql12/log/run b/srcpkgs/postgresql12/files/postgresql12/log/run
new file mode 100755
index 00000000000..815d9c97407
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.info -t postgres@VERSION@
diff --git a/srcpkgs/postgresql12/files/postgresql12/run b/srcpkgs/postgresql12/files/postgresql12/run
new file mode 100755
index 00000000000..b45c1b4ca8f
--- /dev/null
+++ b/srcpkgs/postgresql12/files/postgresql12/run
@@ -0,0 +1,24 @@
+#!/bin/sh
+. /@PREFIX@/etc/default/postgresql
+: ${PGDATA:="$PGROOT/data"}
+
+if [ "$PGROOT" != "/var/lib/postgresql@VERSION@" ]; then
+	echo "Creating symlink /var/lib/postgresql@VERSION@ -> $PGROOT"
+	ln -sf "$PGROOT" /var/lib/postgresql@VERSION@
+fi
+
+
+if [ ! -d "$PGDATA" ]; then
+	echo "Initializing database in $PGDATA"
+
+	mkdir -p "$PGDATA"
+	chown -R postgres:postgres "$PGDATA"
+	chmod 0700 "$PGDATA"
+	su - postgres -m -c "/@PREFIX@/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null
+
+	if [ -f /@PREFIX@/etc/postgresql/postgresql.conf ]; then
+		ln -sf /@PREFIX@/etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf"
+	fi
+fi
+
+exec chpst -u postgres:postgres /@PREFIX@/bin/postgres -D "$PGDATA" $PGOPTS 2>&1
diff --git a/srcpkgs/postgresql12/files/profile.sh b/srcpkgs/postgresql12/files/profile.sh
new file mode 100644
index 00000000000..54be2ca50a4
--- /dev/null
+++ b/srcpkgs/postgresql12/files/profile.sh
@@ -0,0 +1,14 @@
+appendpath () {
+    case ":$PATH:" in
+        *:"$1":*)
+            ;;
+        *)
+            PATH="${PATH:+$PATH:}$1"
+    esac
+}
+
+appendpath '/@PREFIX@/bin'
+
+unset appendpath
+
+export PATH
diff --git a/srcpkgs/postgresql12/patches/pg_config-cross-value.patch b/srcpkgs/postgresql12/patches/pg_config-cross-value.patch
new file mode 100644
index 00000000000..65877ee1fef
--- /dev/null
+++ b/srcpkgs/postgresql12/patches/pg_config-cross-value.patch
@@ -0,0 +1,46 @@
+Sources: Doan Tran Cong Danh
+Upstream: No
+	- First part needs to be rework in configure script to be usable
+	  upstream
+	- Second part would un-usable for Windows
+diff --git src/common/Makefile src/common/Makefile
+index ec04710..2af845f 100644
+--- src/common/Makefile
++++ src/common/Makefile
+@@ -30,11 +30,14 @@ include $(top_builddir)/src/Makefile.global
+ 
+ # don't include subdirectory-path-dependent -I and -L switches
+ STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
++STD_CPPFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_CPPFLAGS))
++STD_CFLAGS   := $(subst @XBPS_SYSROOT@,,$(CFLAGS))
+ STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
++STD_LDFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_LDFLAGS))
+ override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
+ override CPPFLAGS += -DVAL_CC="\"$(CC)\""
+ override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
+-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
++override CPPFLAGS += -DVAL_CFLAGS="\"$(STD_CFLAGS)\""
+ override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
+ override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
+ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
+@@ -72,7 +75,19 @@ OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o restricted_token.o
+ GEN_KEYWORDLIST = $(PERL) -I $(TOOLSDIR) $(TOOLSDIR)/gen_keywordlist.pl
+ GEN_KEYWORDLIST_DEPS = $(TOOLSDIR)/gen_keywordlist.pl $(TOOLSDIR)/PerfectHash.pm
+ 
+-all: libpgcommon.a libpgcommon_shlib.a libpgcommon_srv.a
++all: libpgcommon.a libpgcommon_shlib.a libpgcommon_srv.a pg_config.sh
++
++pg_config.sh: pg_config.sh.in
++	sed -e "s/@configure_args@/$(subst /,\\/,$(configure_args))/" \
++		-e "s/@CC@/$(subst /,\\/,$(CC))/" \
++		-e "s/@CPPFLAGS@/$(subst /,\\/,$(STD_CPPFLAGS))/" \
++		-e "s/@CFLAGS@/$(subst /,\\/,$(STD_CFLAGS))/" \
++		-e "s/@CFLAGS_SL@/$(subst /,\\/,$(CFLAGS_SL))/" \
++		-e "s/@LDFLAGS@/$(subst /,\\/,$(STD_LDFLAGS))/" \
++		-e "s/@LDFLAGS_EX@/$(subst /,\\/,$(LDFLAGS_EX))/" \
++		-e "s/@LDFLAGS_SL@/$(subst /,\\/,$(LDFLAGS_SL))/" \
++		-e "s/@LIBS@/$(subst /,\\/,$(LIBS))/" \
++		$< >$@
+ 
+ distprep: kwlist_d.h
+ 
diff --git a/srcpkgs/postgresql12/patches/relocate.patch b/srcpkgs/postgresql12/patches/relocate.patch
new file mode 100644
index 00000000000..65bab8ad4c6
--- /dev/null
+++ b/srcpkgs/postgresql12/patches/relocate.patch
@@ -0,0 +1,22 @@
+From bf0601df89f611b33d8dbc27722351bf99e2cc18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
+Date: Sat, 18 Jan 2020 12:19:45 +0100
+Subject: [PATCH] relocate
+
+
+diff --git src/port/path.c src/port/path.c
+index 710988b..20dc57d 100644
+--- src/port/path.c
++++ src/port/path.c
+@@ -544,6 +544,8 @@ make_relative_path(char *ret_path, const char *target_path,
+ 	int			tail_len;
+ 	int			i;
+ 
++	goto no_match; // we relocate only binaries
++
+ 	/*
+ 	 * Determine the common prefix --- note we require it to end on a
+ 	 * directory separator, consider eg '/usr/lib' and '/usr/libexec'.
+-- 
+2.23.0
+
diff --git a/srcpkgs/postgresql12/template b/srcpkgs/postgresql12/template
new file mode 100644
index 00000000000..2739ba1e7b6
--- /dev/null
+++ b/srcpkgs/postgresql12/template
@@ -0,0 +1,228 @@
+# Template file for 'postgresql12'
+pkgname=postgresql12
+version=12.3
+revision=1
+wrksrc="postgresql-${version}"
+build_style=gnu-configure
+make_build_target=world
+_major="${version%%.*}"
+_prefix="usr/lib/psql${_major}"
+configure_args="--with-openssl --with-python
+ --with-pam --enable-thread-safety
+ --with-perl --with-tcl --without-ldap --without-gssapi
+ --without-bonjour --with-libxml --with-libxslt
+ --with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
+hostmakedepends="docbook2x gettext flex openjade"
+makedepends="libfl-devel libressl-devel libuuid-devel libxslt-devel pam-devel perl
+ python3-devel readline-devel tcl-devel"
+checkdepends="tzdata"
+short_desc="Sophisticated open-source Object-Relational DBMS"
+maintainer="Piotr Wójcik <chocimier@tlen.pl>"
+license="PostgreSQL"
+homepage="https://www.postgresql.org"
+changelog="https://www.postgresql.org/docs/current/release-${version//./-}.html"
+distfiles="https://ftp.postgresql.org/pub/source/v${version}/postgresql-${version}.tar.bz2"
+checksum=94ed64a6179048190695c86ec707cc25d016056ce10fc9d229267d9a8f1dcf41
+
+conf_files="
+ /${_prefix}/etc/default/postgresql
+ /${_prefix}/etc/pam.d/postgresql
+ /${_prefix}/etc/postgresql/postgresql.conf
+"
+
+# Create 'postgres' user for the server.
+system_accounts="postgres"
+postgres_homedir="/var/lib/postgresql"
+postgres_shell="/bin/sh"
+postgres_descr="PostgreSQL database server user"
+make_dirs="
+ /var/lib/postgresql   0750 postgres postgres
+ /var/lib/postgresql${_major} 0750 postgres postgres"
+
+if [ "$CROSS_BUILD" ]; then
+	configure_args+=" --without-perl --without-python --without-tcl"
+fi
+
+post_patch() {
+	cp "$FILESDIR"/pg_config.sh.in src/common/pg_config.sh.in
+	_substitute src/common/pg_config.sh.in
+	vsed -i -e "s,@XBPS_SYSROOT@,${XBPS_CROSS_BASE%/}," src/common/Makefile
+}
+
+pre_configure() {
+	_style_configure_args="${configure_args}"
+	configure_args=" "
+	for arg in ${_style_configure_args}; do
+		case $arg in
+			--prefix=*|*dir=*) : ;; # skip
+			*) configure_args+=" $arg"
+		esac
+	done
+	configure_args="--prefix=/${_prefix}
+	 --sysconfdir=/${_prefix}/etc
+	 ${configure_args}"
+}
+
+post_build() {
+	make -C contrib ${makejobs}
+}
+
+pre_check() {
+	echo ln -sr tmp_install/${_prefix} /${_prefix%/*}
+	ln -sr tmp_install/${_prefix} /${_prefix%/*}
+}
+
+post_install() {
+	vmkdir usr/share/man
+	cp -r doc/src/sgml/man? ${DESTDIR}/usr/share/man
+	for i in ${DESTDIR}/usr/share/man/*[^3]/*; do
+		mv $i ${i%.*}-${_major}.${i##*.}
+	done
+	vmkdir ${_prefix}/share/doc
+	cp -r doc/src/sgml/html ${DESTDIR}/${_prefix}/share/doc
+	vsv ${pkgname}
+	find "${DESTDIR}/etc/sv" -type f -exec sed -i -e s:@VERSION@:${_major}: -e s:@PREFIX@:${_prefix}: '{}' ';'
+	vlicense COPYRIGHT
+
+	vinstall ${FILESDIR}/profile.sh 644 etc/profile.d ${pkgname}.sh
+	_substitute ${DESTDIR}/etc/profile.d/${pkgname}.sh
+	vinstall ${FILESDIR}/postgresql.confd 644 ${_prefix}/etc/default postgresql
+	_substitute ${DESTDIR}/${_prefix}/etc/default/postgresql
+	vinstall ${FILESDIR}/postgresql.pam 644 ${_prefix}/etc/pam.d postgresql
+	_substitute ${DESTDIR}/${_prefix}/etc/pam.d/postgresql
+	vinstall ${DESTDIR}/${_prefix}/share/postgresql/postgresql.conf.sample \
+		644 ${_prefix}/etc/postgresql postgresql.conf
+	vbin src/common/pg_config.sh
+
+	vsed -i 's/install_bin = .*/install_bin = install/g' \
+		${DESTDIR}/${_prefix}/lib/postgresql/pgxs/src/Makefile.global
+}
+
+_substitute() {
+	sed -i "$1" -e s:@PREFIX@:${_prefix}: -e s:@VERSION@:${_major}: -e s:@FULL_VERSION@:${version}:
+}
+
+postgresql12-doc_package() {
+	short_desc="PostgreSQL documentation"
+	archs=noarch
+	pkg_install() {
+		vmove ${_prefix}/share/doc
+	}
+}
+
+postgresql-libs_package() {
+	short_desc="PostgreSQL shared libraries"
+	conflicts="postgresql9.6-libs>=0"
+	pkg_install() {
+		vmove "${_prefix}/lib/*.so*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		    -type f -name libpq5\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv ${PKGDESTDIR}/${_prefix}/lib/* ${PKGDESTDIR}/usr/lib
+	}
+}
+
+postgresql-libs-devel_package() {
+	depends="postgresql-libs>=${version}_${revision}"
+	short_desc="PostgreSQL shared libraries (development files)"
+	conflicts="postgresql9.6-libs-devel>=0"
+	pkg_install() {
+		mkdir -p "${PKGDESTDIR}/usr/bin"
+		for f in pg_config ecpg; do
+			vmove ${_prefix}/bin/${f}
+			vmove "usr/share/man/man1/$(basename ${f})*"
+			ln -sr "${PKGDESTDIR}/${_prefix}/bin/${f}" "${PKGDESTDIR}/usr/bin"
+		done
+		vmove usr/bin/pg_config.sh
+		vmove ${_prefix}/include
+		vmove "${_prefix}/lib/*.a"
+		vmove "${_prefix}/lib/pkgconfig/*"
+		vmove usr/share/man/man3
+		vmove ${_prefix}/lib/postgresql/pgxs
+		for f in libpq.so libpgtypes.so libecpg_compat.so libecpg.so; do
+			ln -sr "${PKGDESTDIR}/usr/lib/${f}" "${PKGDESTDIR}/${_prefix}/lib"
+		done
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pg_config\* -o -name ecpg\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+# XXX disabled for now in cross builds.
+if [ -z "$CROSS_BUILD" ]; then
+
+postgresql12-plperl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Perl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plperl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plperl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-plpython_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Python procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/plpython*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name plpython\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+postgresql12-pltcl_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc="PL/Tcl procedural language for PostgreSQL"
+	pkg_install() {
+		vmove "${_prefix}/lib/postgresql/pltcl*"
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pltcl\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+	}
+}
+
+fi # !CROSS_BUILD
+
+postgresql12-client_package() {
+	short_desc="Client frontends programs for PostgreSQL"
+	pkg_install() {
+		for f in clusterdb createdb createuser dropdb \
+			dropuser pg_dump pg_dumpall pg_isready pg_restore psql reindexdb \
+			vacuumdb; do
+			vmove ${_prefix}/bin/${f}
+			vmove usr/share/man/man1/$(basename ${f})-${_major}.1
+		done
+		vmove usr/share/man/man7
+		for d in $(find ${DESTDIR}/${_prefix}/share/locale \
+		   -type f -name pgscripts\* -o \
+			   -name psql\* -o \
+			   -name pg_dump\*); do
+			mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+			mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
+		done
+		mv ${DESTDIR}/${_prefix}/share/postgresql/psqlrc.* \
+			${PKGDESTDIR}/${_prefix}/share
+		vinstall ${FILESDIR}/profile.sh 644 etc/profile.d ${pkgname}.sh
+		_substitute ${PKGDESTDIR}/etc/profile.d/${pkgname}.sh
+	}
+}
+
+postgresql12-contrib_package() {
+	short_desc="PostgreSQL contributed programs and extensions"
+	pkg_install() {
+		make -C contrib install DESTDIR=${PKGDESTDIR}
+	}
+}
diff --git a/srcpkgs/postgresql12/update b/srcpkgs/postgresql12/update
new file mode 100644
index 00000000000..3f99ada53be
--- /dev/null
+++ b/srcpkgs/postgresql12/update
@@ -0,0 +1,2 @@
+site="https://ftp.postgresql.org/pub/source/"
+pattern="v\K12[\d.]+(?!\w)"

From ebed3189b4b666fa3307d1b4b00d5f5c58719692 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 6 Jul 2020 21:25:01 +0200
Subject: [PATCH 3/5] New package: postgresql9.6-libs

Intended to build extensions of postgresql [9.6].
---
 srcpkgs/postgresql/template      | 7 ++++---
 srcpkgs/postgresql9.6-libs       | 1 +
 srcpkgs/postgresql9.6-libs-devel | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/postgresql9.6-libs
 create mode 120000 srcpkgs/postgresql9.6-libs-devel

diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index fa1e0bc2e68..e620672a306 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,7 +1,7 @@
 # Template file for 'postgresql'
 pkgname=postgresql
 version=9.6.18
-revision=3
+revision=4
 build_style=gnu-configure
 make_build_target=world
 configure_args="--with-openssl --with-python
@@ -17,6 +17,7 @@ short_desc="Sophisticated open-source Object-Relational DBMS"
 maintainer="Johannes <johannes.brechtmann@gmail.com>"
 license="PostgreSQL"
 homepage="https://www.postgresql.org"
+changelog="https://www.postgresql.org/docs/current/release-${version//./-}.html"
 distfiles="https://ftp.postgresql.org/pub/source/v${version}/${pkgname}-${version}.tar.bz2"
 checksum=517ec282b785e6d22f360c30ba0c5e2a506fca5ca07dcc545427511d94c89999
 
@@ -79,7 +80,7 @@ postgresql-doc_package() {
 	}
 }
 
-postgresql-libs_package() {
+postgresql9.6-libs_package() {
 	short_desc="PostgreSQL shared libraries"
 	pkg_install() {
 		vmove "usr/lib/*.so*"
@@ -91,7 +92,7 @@ postgresql-libs_package() {
 	}
 }
 
-postgresql-libs-devel_package() {
+postgresql9.6-libs-devel_package() {
 	depends="postgresql-libs>=$version"
 	short_desc="PostgreSQL shared libraries (development files)"
 	pkg_install() {
diff --git a/srcpkgs/postgresql9.6-libs b/srcpkgs/postgresql9.6-libs
new file mode 120000
index 00000000000..360e6d1a1f4
--- /dev/null
+++ b/srcpkgs/postgresql9.6-libs
@@ -0,0 +1 @@
+postgresql
\ No newline at end of file
diff --git a/srcpkgs/postgresql9.6-libs-devel b/srcpkgs/postgresql9.6-libs-devel
new file mode 120000
index 00000000000..360e6d1a1f4
--- /dev/null
+++ b/srcpkgs/postgresql9.6-libs-devel
@@ -0,0 +1 @@
+postgresql
\ No newline at end of file

From bb81b2464d5ae218bafa1043353af866bb0f3f59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 6 Jul 2020 21:25:01 +0200
Subject: [PATCH 4/5] postgis: build with postgresql9.6-libs, adopt

---
 srcpkgs/postgis/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/postgis/template b/srcpkgs/postgis/template
index 4221b20c415..4b2feb8b02f 100644
--- a/srcpkgs/postgis/template
+++ b/srcpkgs/postgis/template
@@ -1,7 +1,7 @@
 # Template file for 'postgis'
 pkgname=postgis
 version=3.0.0
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--with-projdir=${XBPS_CROSS_BASE}/usr
  --with-projdir=${XBPS_CROSS_BASE}/usr
@@ -9,11 +9,11 @@ configure_args="--with-projdir=${XBPS_CROSS_BASE}/usr
  --with-protobufdir=${XBPS_CROSS_BASE}/usr
  --with-geosconfig=${XBPS_CROSS_BASE}/usr/bin/geos-config"
 hostmakedepends="automake libtool perl which pkg-config geos libgdal-tools
- postgresql-libs-devel"
-makedepends="geos-devel libgdal-devel libpqxx-devel libxml2-devel postgresql-libs-devel
+ postgresql9.6-libs-devel"
+makedepends="geos-devel libgdal-devel libpqxx-devel libxml2-devel postgresql9.6-libs-devel
  proj-devel protobuf-c-devel pcre-devel json-c-devel"
 short_desc="Spatial database extender for PostgreSQL"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Piotr Wójcik <chocimier@tlen.pl>"
 license="GPL-2.0-or-later"
 homepage="https://postgis.net/"
 changelog="https://git.osgeo.org/gitea/postgis/postgis/raw/tag/${version}/NEWS"

From e38a9703bf449aaa4de11e4f704cc344f22dd073 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 6 Jul 2020 21:25:01 +0200
Subject: [PATCH 5/5] New package: postgis-postgresql12-3.0.0

---
 srcpkgs/postgis-postgresql12/template | 27 +++++++++++++++++++++++++++
 srcpkgs/postgis-postgresql12/update   |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/postgis-postgresql12/template
 create mode 100644 srcpkgs/postgis-postgresql12/update

diff --git a/srcpkgs/postgis-postgresql12/template b/srcpkgs/postgis-postgresql12/template
new file mode 100644
index 00000000000..1a0ffb9dc0c
--- /dev/null
+++ b/srcpkgs/postgis-postgresql12/template
@@ -0,0 +1,27 @@
+# Template file for 'postgis-postgresql12'
+pkgname=postgis-postgresql12
+version=3.0.0
+revision=1
+wrksrc="postgis-${version}"
+build_style=gnu-configure
+configure_args="
+ --with-projdir=${XBPS_CROSS_BASE}/usr
+ --with-jsondir=${XBPS_CROSS_BASE}/usr
+ --with-protobufdir=${XBPS_CROSS_BASE}/usr
+ --with-geosconfig=${XBPS_CROSS_BASE}/usr/bin/geos-config"
+hostmakedepends="automake libtool perl pkg-config geos
+ libgdal-tools postgresql-libs-devel which"
+makedepends="geos-devel libgdal-devel libpqxx-devel libxml2-devel postgresql-libs-devel
+ proj-devel protobuf-c-devel pcre-devel json-c-devel"
+short_desc="Spatial database extender for PostgreSQL"
+maintainer="Piotr Wójcik <chocimier@tlen.pl>"
+license="GPL-2.0-or-later"
+homepage="https://postgis.net/"
+changelog="https://git.osgeo.org/gitea/postgis/postgis/raw/tag/${version}/NEWS"
+distfiles="https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz"
+checksum=c06fd2cd5cea0119106ffe17a7235d893c2bbe6f4b63c8617c767630973ba594
+nocross="FIXME: Cannot run test program to determine PROJ version"
+
+pre_configure() {
+	./autogen.sh
+}
diff --git a/srcpkgs/postgis-postgresql12/update b/srcpkgs/postgis-postgresql12/update
new file mode 100644
index 00000000000..70f8b7290d7
--- /dev/null
+++ b/srcpkgs/postgis-postgresql12/update
@@ -0,0 +1 @@
+ignore="*alpha*"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Merged]: [to test] New package: postgresql12
  2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
                   ` (5 preceding siblings ...)
  2020-07-06 19:29 ` [PR PATCH] [Updated] " Chocimier
@ 2020-07-06 20:03 ` Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: Chocimier @ 2020-07-06 20:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

There's a merged pull request on the void-packages repository

[to test] New package: postgresql12
https://github.com/void-linux/void-packages/pull/18121

Description:
Still some things to do, like fixing pg_config so postgis can be build for 12, adding postgresql-libs9.6 for rebuilding postgis, maybe behind option.

Edit: done.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-06 20:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 23:03 [PR PATCH] [WIP] New package: postgresql12 voidlinux-github
2020-01-28 21:54 ` [PR PATCH] [Updated] " voidlinux-github
2020-03-17 21:27 ` Chocimier
2020-03-17 21:54 ` [to test] " Anachron
2020-03-17 22:45 ` Chocimier
2020-05-23 10:40 ` oranenj
2020-07-06 19:29 ` [PR PATCH] [Updated] " Chocimier
2020-07-06 20:03 ` [PR PATCH] [Merged]: " Chocimier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).