From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] [WIP] New package: postgresql12
Date: Thu, 09 Jan 2020 00:03:09 +0100 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-18121@inbox.vuxu.org> (raw)
[-- 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
next reply other threads:[~2020-01-08 23:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 23:03 voidlinux-github [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-18121@inbox.vuxu.org \
--to=voidlinux-github@inbox.vuxu.org \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).