summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGoliathLabs2020-05-10 12:34:47 +0200
committerGoliathLabs2020-05-10 12:34:47 +0200
commit2d1deb5a52c766b33039e1738de1622dbe92c6fc (patch)
tree4444fc60eaeb6189641475767c49eb431d389f77
parent3f728fad9e23261520b6c11d1368349f69f55076 (diff)
downloadaur-2d1deb5a52c766b33039e1738de1622dbe92c6fc.tar.gz
Updated: PKGBUILD
-rw-r--r--.SRCINFO87
-rw-r--r--PKGBUILD197
-rw-r--r--postgresql-check-db-dir2
-rw-r--r--postgresql-perl-rpath.patch13
-rw-r--r--postgresql.service17
-rw-r--r--postgresql.sysusers1
-rw-r--r--postgresql.tmpfiles2
7 files changed, 241 insertions, 78 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3f54333fe25..a39288f7617 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,46 +1,83 @@
pkgbase = postgresql-9.6
- pkgdesc = A powerful, open source object-relational database system
+ pkgdesc = Sophisticated object-relational DBMS
pkgver = 9.6.17
- pkgrel = 1
- url = http://www.postgresql.org/
- install = postgresql.install
+ pkgrel = 2
+ url = https://www.postgresql.org/
arch = i686
arch = x86_64
license = custom:PostgreSQL
+ makedepends = krb5
+ makedepends = libxml2
+ makedepends = python
makedepends = python2
makedepends = perl
makedepends = tcl>=8.6.0
- depends = libxml2
- depends = krb5
- depends = openssl>=1.0.0
- depends = readline>=6.0
- depends = pam
- depends = zlib
- optdepends = python2: for PL/Python support
- optdepends = perl: for PL/Perl support
- optdepends = tcl: for PL/Tcl support
- optdepends = postgresql-old-upgrade: upgrade from previous major version using pg_upgrade
- provides = postgresql=9.6.17
- provides = postgresql-libs=9.6.17
- provides = postgresql-client=9.6.17
- provides = postgresql-docs=9.6.17
- conflicts = postgresql
- conflicts = postgresql-libs
- conflicts = postgresql-testing
- conflicts = postgresql-client
- conflicts = postgresql-docs
+ makedepends = openssl>=1.0.0
+ makedepends = pam
+ makedepends = zlib
+ makedepends = icu
+ makedepends = systemd
+ makedepends = libldap
+ makedepends = llvm
+ makedepends = clang
source = https://ftp.postgresql.org/pub/source/v9.6.17/postgresql-9.6.17.tar.bz2
source = postgresql-run-socket.patch
+ source = postgresql-perl-rpath.patch
source = postgresql.pam
source = postgresql.logrotate
source = postgresql.service
source = postgresql-check-db-dir
+ source = postgresql.sysusers
+ source = postgresql.tmpfiles
sha256sums = f6e1e32d32545f97c066f3c19f4d58dfab1205c01252cf85c5c92294ace1a0c2
sha256sums = 8538619cb8bea51078b605ad64fe22abd6050373c7ae3ad6595178da52f6a7d9
+ sha256sums = 5f73b54ca6206bd2c469c507830261ebd167baca074698d8889d769c33f98a31
sha256sums = 57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5
sha256sums = 6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e
- sha256sums = b48fe97f8e43ed0d2041d519119a4dafb70fcae72870951bf4fb7350fe169ac8
- sha256sums = 2340da0947bcb1c5602008d0ca00588ca0bfa8aca4fa6947a8bdb2c6df800b0e
+ sha256sums = 25fb140b90345828dc01a4f286345757e700a47178bab03d217a7a5a79105b57
+ sha256sums = 40da687da4fb1f6b35f406dd0f48922065d8c905d678e2a27da05806f874b780
+ sha256sums = 7fa8f0ef3f9d40abd4749cc327c2f52478cb6dfb6e2405bd0279c95e9ff99f12
+ sha256sums = 4a4c0bb9ceb156cc47e9446d8393d1f72b4fe9ea1d39ba17213359df9211da57
+
+pkgname = postgresql-libs-9.6
+ pkgdesc = Libraries for use with PostgreSQL
+ depends = krb5
+ depends = openssl>=1.0.0
+ depends = readline>=6.0
+ depends = zlib
+ depends = libldap
+ provides = postgresql-client
+ provides = postgresql-libs=9.6.17
+ conflicts = postgresql-client
+ conflicts = postgresql-libs
+
+pkgname = postgresql-docs-9.6
+ pkgdesc = HTML documentation for PostgreSQL
+ provides = postgresql-docs=9.6.17
+ conflicts = postgresql-docs
+ options = docs
pkgname = postgresql-9.6
+ pkgdesc = Sophisticated object-relational DBMS
+ install = postgresql.install
+ depends = postgresql-libs>=9.6.17
+ depends = krb5
+ depends = libxml2
+ depends = readline>=6.0
+ depends = openssl>=1.0.0
+ depends = pam
+ depends = icu
+ depends = systemd-libs
+ depends = libldap
+ depends = llvm-libs
+ optdepends = python2: for PL/Python 2 support
+ optdepends = python: for PL/Python 3 support
+ optdepends = perl: for PL/Perl support
+ optdepends = tcl: for PL/Tcl support
+ optdepends = postgresql-old-upgrade: upgrade from previous major version using pg_upgrade
+ provides = postgresql=9.6.17
+ conflicts = postgresql
+ options = staticlibs
+ backup = etc/pam.d/postgresql
+ backup = etc/logrotate.d/postgresql
diff --git a/PKGBUILD b/PKGBUILD
index b1a4de9e3e9..44aba545523 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,80 +1,181 @@
-# Maintainer: Thomas Arnhold <thomas@arnhold.org
+# Maintainer: Felix Golatofski <contact@xdfr.de>
+# Contributor: Thomas Arnhold <thomas@arnhold.org
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Dan McGee <dan@archlinux.org>
# Contributor: Kuba Ku┼║ma <kuba@jah.pl>
# Contributor: Matthew Carter <m@ahungry.com>
# Contributor: Ariel Popper <a@arielp.com>
-pkgname=postgresql-9.6
+pkgbase=postgresql-9.6
+pkgname=('postgresql-libs-9.6' 'postgresql-docs-9.6' 'postgresql-9.6')
pkgver=9.6.17
-pkgrel=1
+pkgrel=2
+pkgdesc='Sophisticated object-relational DBMS'
+url="https://www.postgresql.org/"
arch=('i686' 'x86_64')
-url="http://www.postgresql.org/"
-pkgdesc="A powerful, open source object-relational database system"
license=('custom:PostgreSQL')
-conflicts=('postgresql' 'postgresql-libs' 'postgresql-testing' 'postgresql-client' 'postgresql-docs')
-provides=("postgresql=$pkgver" "postgresql-libs=$pkgver" "postgresql-client=$pkgver" "postgresql-docs=$pkgver")
-depends=('libxml2' 'krb5' 'openssl>=1.0.0' 'readline>=6.0' 'pam' 'zlib')
-makedepends=('python2' 'perl' 'tcl>=8.6.0')
-optdepends=('python2: for PL/Python support'
- 'perl: for PL/Perl support'
- 'tcl: for PL/Tcl support'
- 'postgresql-old-upgrade: upgrade from previous major version using pg_upgrade')
-install=postgresql.install
+makedepends=('krb5' 'libxml2' 'python' 'python2' 'perl' 'tcl>=8.6.0' 'openssl>=1.0.0'
+ 'pam' 'zlib' 'icu' 'systemd' 'libldap' 'llvm' 'clang')
source=(https://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2
postgresql-run-socket.patch
+ postgresql-perl-rpath.patch
postgresql.pam
postgresql.logrotate
postgresql.service
- postgresql-check-db-dir)
+ postgresql-check-db-dir
+ postgresql.sysusers
+ postgresql.tmpfiles)
sha256sums=('f6e1e32d32545f97c066f3c19f4d58dfab1205c01252cf85c5c92294ace1a0c2'
'8538619cb8bea51078b605ad64fe22abd6050373c7ae3ad6595178da52f6a7d9'
+ '5f73b54ca6206bd2c469c507830261ebd167baca074698d8889d769c33f98a31'
'57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
'6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e'
- 'b48fe97f8e43ed0d2041d519119a4dafb70fcae72870951bf4fb7350fe169ac8'
- '2340da0947bcb1c5602008d0ca00588ca0bfa8aca4fa6947a8bdb2c6df800b0e')
+ '25fb140b90345828dc01a4f286345757e700a47178bab03d217a7a5a79105b57'
+ '40da687da4fb1f6b35f406dd0f48922065d8c905d678e2a27da05806f874b780'
+ '7fa8f0ef3f9d40abd4749cc327c2f52478cb6dfb6e2405bd0279c95e9ff99f12'
+ '4a4c0bb9ceb156cc47e9446d8393d1f72b4fe9ea1d39ba17213359df9211da57')
+prepare() {
+ cd postgresql-${pkgver}
+ patch -p1 < ../postgresql-run-socket.patch
+ patch -p1 < ../postgresql-perl-rpath.patch
+}
build() {
cd "${srcdir}/postgresql-${pkgver}"
- patch -Np1 < ../postgresql-run-socket.patch
-
- ./configure --prefix=/usr \
- --mandir=/usr/share/man \
- --datadir=/usr/share/postgresql \
- --sysconfdir=/etc \
- --with-krb5 \
- --with-gssapi \
- --with-libxml \
- --with-openssl \
- --with-perl \
- --with-python PYTHON=/usr/bin/python2 \
- --with-tcl \
- --with-pam \
- --with-system-tzdata=/usr/share/zoneinfo \
- --with-uuid=e2fs \
- --enable-nls \
- --enable-thread-safety
-
+ local options=(
+ --prefix=/usr
+ --mandir=/usr/share/man
+ --datadir=/usr/share/postgresql
+ --sysconfdir=/etc
+ --with-gssapi
+ --with-libxml
+ --with-openssl
+ --with-perl
+ --with-python
+ --with-tcl
+ --with-pam
+ --with-system-tzdata=/usr/share/zoneinfo
+ --with-uuid=e2fs
+ --with-icu
+ --with-systemd
+ --with-ldap
+ --with-llvm
+ --enable-nls
+ --enable-thread-safety
+ --disable-rpath
+ )
+ # regular build with everything
+ ./configure ${options[@]} \
+ PYTHON=/usr/bin/python2
make world
}
-package() {
- cd "${srcdir}/postgresql-${pkgver}"
+package_postgresql-libs-9.6() {
+ pkgdesc="Libraries for use with PostgreSQL"
+ depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0' 'zlib' 'libldap')
+ provides=('postgresql-client' "postgresql-libs=$pkgver")
+ conflicts=('postgresql-client' 'postgresql-libs')
- make DESTDIR="${pkgdir}" install-world
+ cd "${srcdir}/postgresql-${pkgver}"
# install license
- install -D -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
+
+ # install libs and non-server binaries
+ for dir in src/interfaces src/bin/pg_config src/bin/pg_dump src/bin/psql src/bin/scripts; do
+ make -C ${dir} DESTDIR="${pkgdir}" install
+ done
+
+ for util in pg_config pg_dump pg_dumpall pg_restore psql \
+ clusterdb createdb createuser dropdb dropuser pg_isready reindexdb vacuumdb; do
+ install -Dm 644 doc/src/sgml/man1/${util}.1 "${pkgdir}"/usr/share/man/man1/${util}.1
+ done
+
+ cd src/include
+
+ install -d "${pkgdir}"/usr/include/{libpq,postgresql/internal/libpq}
+
+ # these headers are needed by the public headers of the interfaces
+ install -m 644 pg_config.h "${pkgdir}/usr/include"
+ install -m 644 pg_config_os.h "${pkgdir}/usr/include"
+ install -m 644 pg_config_ext.h "${pkgdir}/usr/include"
+ install -m 644 postgres_ext.h "${pkgdir}/usr/include"
+ install -m 644 libpq/libpq-fs.h "${pkgdir}/usr/include/libpq"
+ install -m 644 pg_config_manual.h "${pkgdir}/usr/include"
+
+ # these he aders are needed by the not-so-public headers of the interfaces
+ install -m 644 c.h "${pkgdir}/usr/include/postgresql/internal"
+ install -m 644 port.h "${pkgdir}/usr/include/postgresql/internal"
+ install -m 644 postgres_fe.h "${pkgdir}/usr/include/postgresql/internal"
+ install -m 644 libpq/pqcomm.h "${pkgdir}/usr/include/postgresql/internal/libpq"
+}
+
+package_postgresql-docs-9.6() {
+ pkgdesc="HTML documentation for PostgreSQL"
+ options=('docs')
+ provides=("postgresql-docs=$pkgver")
+ conflicts=('postgresql-docs')
- install -D -m644 "${srcdir}/postgresql.service" \
- "${pkgdir}/usr/lib/systemd/system/postgresql.service"
- install -D -m755 "${srcdir}/postgresql-check-db-dir" \
- "${pkgdir}/usr/bin/postgresql-check-db-dir"
+ cd postgresql-${pkgver}
- install -D -m644 "${srcdir}/postgresql.pam" \
- "${pkgdir}/etc/pam.d/postgresql"
+ install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
- install -D -m644 "${srcdir}/postgresql.logrotate" \
- "${pkgdir}/etc/logrotate.d/postgresql"
+ make -C doc/src/sgml DESTDIR="${pkgdir}" install-html
+ chown -R root:root "${pkgdir}/usr/share/doc/postgresql/html"
+
+ # clean up
+ rmdir "${pkgdir}"/usr/share/man/man{1,3,7}
+ rmdir "${pkgdir}"/usr/share/man
+}
+
+package_postgresql-9.6() {
+ pkgdesc='Sophisticated object-relational DBMS'
+ backup=('etc/pam.d/postgresql' 'etc/logrotate.d/postgresql')
+ depends=("postgresql-libs>=${pkgver}" 'krb5' 'libxml2' 'readline>=6.0' 'openssl>=1.0.0' 'pam' 'icu' 'systemd-libs' 'libldap' 'llvm-libs')
+ optdepends=('python2: for PL/Python 2 support'
+ 'python: for PL/Python 3 support'
+ 'perl: for PL/Perl support'
+ 'tcl: for PL/Tcl support'
+ 'postgresql-old-upgrade: upgrade from previous major version using pg_upgrade')
+ provides=("postgresql=$pkgver")
+ conflicts=('postgresql')
+ options=('staticlibs')
+ install=postgresql.install
+
+ cd postgresql-${pkgver}
+
+ # install
+ make DESTDIR="${pkgdir}" install
+ make -C contrib DESTDIR="${pkgdir}" install
+ make -C doc/src/sgml DESTDIR="${pkgdir}" install-man
+
+ # we don't want these, they are in the -libs package
+ for dir in src/interfaces src/bin/pg_config src/bin/pg_dump src/bin/psql src/bin/scripts; do
+ make -C ${dir} DESTDIR="${pkgdir}" uninstall
+ done
+ for util in pg_config pg_dump pg_dumpall pg_restore psql \
+ clusterdb createdb createuser dropdb dropuser pg_isready reindexdb vacuumdb; do
+ rm "${pkgdir}"/usr/share/man/man1/${util}.1
+ done
+
+ install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
+
+ cd "${srcdir}"
+ install -Dm 755 postgresql-check-db-dir -t "${pkgdir}/usr/bin"
+
+ install -Dm 644 postgresql.pam "${pkgdir}/etc/pam.d/postgresql"
+ install -Dm 644 postgresql.logrotate "${pkgdir}/etc/logrotate.d/postgresql"
+
+ install -Dm 644 postgresql.service -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm 644 postgresql.sysusers "${pkgdir}/usr/lib/sysusers.d/postgresql.conf"
+ install -Dm 644 postgresql.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/postgresql.conf"
+
+ # clean up unneeded installed items
+ rm -rf "${pkgdir}/usr/include/postgresql/internal"
+ rm -rf "${pkgdir}/usr/include/libpq"
+ find "${pkgdir}/usr/include" -maxdepth 1 -type f -execdir rm {} +
+ rmdir "${pkgdir}/usr/share/doc/postgresql/html"
}
+
+# vim: ts=2 sw=2 et:
diff --git a/postgresql-check-db-dir b/postgresql-check-db-dir
index aa51d764353..bc706db5ab5 100644
--- a/postgresql-check-db-dir
+++ b/postgresql-check-db-dir
@@ -17,7 +17,7 @@ fi
# PGMAJORVERSION is major version
PGMAJORVERSION=9.6
-# PREVMAJORVERSION is the previous major version
+# PREVMAJORVERSION is the previous major version, e.g., 8.4, for upgrades
PREVMAJORVERSION=9.5
# Check for the PGDATA structure
diff --git a/postgresql-perl-rpath.patch b/postgresql-perl-rpath.patch
new file mode 100644
index 00000000000..c4c4fdad289
--- /dev/null
+++ b/postgresql-perl-rpath.patch
@@ -0,0 +1,13 @@
+diff -Naur postgresql-9.1.5.orig/src/pl/plperl/GNUmakefile postgresql-9.1.5/src/pl/plperl/GNUmakefile
+--- postgresql-9.1.5.orig/src/pl/plperl/GNUmakefile 2012-08-14 18:41:04.000000000 -0400
++++ postgresql-9.1.5/src/pl/plperl/GNUmakefile 2012-08-17 11:15:09.457116708 -0400
+@@ -43,6 +43,9 @@
+
+ SHLIB_LINK = $(perl_embed_ldflags)
+
++# Force rpath to be used even though we disable it everywhere else
++SHLIB_LINK += $(rpath)
++
+ REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=plperl --load-extension=plperlu
+ REGRESS = plperl plperl_lc plperl_trigger plperl_shared plperl_elog plperl_util plperl_init plperlu plperl_array
+ # if Perl can support two interpreters in one backend,
diff --git a/postgresql.service b/postgresql.service
index 37fcae99635..dcef95a9c10 100644
--- a/postgresql.service
+++ b/postgresql.service
@@ -3,7 +3,7 @@ Description=PostgreSQL database server
After=network.target
[Service]
-Type=forking
+Type=notify
TimeoutSec=120
User=postgres
Group=postgres
@@ -16,9 +16,10 @@ RuntimeDirectory=postgresql
RuntimeDirectoryMode=755
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
-ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
-ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
-ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
+ExecStart=/usr/bin/postgres -D ${PGROOT}/data
+ExecReload=/bin/kill -HUP ${MAINPID}
+KillMode=mixed
+KillSignal=SIGINT
# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
# killing Postgres, so adjust it downward
@@ -29,6 +30,14 @@ PrivateTmp=true
ProtectHome=true
ProtectSystem=full
NoNewPrivileges=true
+ProtectControlGroups=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+PrivateDevices=true
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
+RestrictNamespaces=true
+RestrictRealtime=true
+SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
diff --git a/postgresql.sysusers b/postgresql.sysusers
new file mode 100644
index 00000000000..a1711b1cc3d
--- /dev/null
+++ b/postgresql.sysusers
@@ -0,0 +1 @@
+u postgres - "PostgreSQL user" /var/lib/postgres /bin/bash
diff --git a/postgresql.tmpfiles b/postgresql.tmpfiles
new file mode 100644
index 00000000000..e618918018a
--- /dev/null
+++ b/postgresql.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/postgres/data 700 postgres postgres
+h /var/lib/postgres/data - - - - +C