diff options
author | Wèi Cōngruì | 2018-06-27 07:31:14 +0000 |
---|---|---|
committer | Wèi Cōngruì | 2018-06-27 09:11:36 +0000 |
commit | a7271927d307d19ed80a0e468d0a6e1079f5484f (patch) | |
tree | 33b9815cc1afc221e7694a758f0a9046d2adbdd0 | |
parent | a24cb68578f608754f0ad4c771c5ad099b56c31a (diff) | |
download | aur-a7271927d307d19ed80a0e468d0a6e1079f5484f.tar.gz |
11beta1
-rw-r--r-- | PKGBUILD | 124 | ||||
-rwxr-xr-x | postgresql-check-db-dir | 4 | ||||
-rw-r--r-- | postgresql.service | 9 |
3 files changed, 79 insertions, 58 deletions
@@ -2,62 +2,84 @@ pkgbase=postgresql-beta pkgname=('postgresql-beta-libs' 'postgresql-beta-docs' 'postgresql-beta') -pkgver=10.0 -_majorver=10 +pkgver=11beta1 pkgrel=1 pkgdesc='Sophisticated object-relational DBMS' url='https://www.postgresql.org/' arch=('aarch64' 'i686' 'x86_64') license=('custom:PostgreSQL') -makedepends=('krb5' 'libxml2' 'python' 'perl' 'tcl>=8.6.0' 'openssl>=1.0.0') -source=(http://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2 +makedepends=('krb5' 'libxml2' 'python' 'python2' 'perl' 'tcl>=8.6.0' 'openssl>=1.0.0' 'pam' 'zlib' 'icu' 'systemd' 'libldap') +source=(https://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2 postgresql-run-socket.patch postgresql.pam postgresql.logrotate postgresql.service postgresql-check-db-dir) -sha256sums=('712f5592e27b81c5b454df96b258c14d94b6b03836831e015c65d6deeae57fd1' +sha256sums=('17889cbffdf4f07c193b16d76b2f9c45daa3f2ab225acd8d7f01521949cb1355' '8538619cb8bea51078b605ad64fe22abd6050373c7ae3ad6595178da52f6a7d9' '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5' '6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e' - 'b48fe97f8e43ed0d2041d519119a4dafb70fcae72870951bf4fb7350fe169ac8' - '888a1d44f03fccfa4bf344ee45824fefb846ae3c1c0c40113ad6020b4be3b0cf') + 'ad025a5fb623b1a1e9dff0cc62cc63f66244bb27d81370a6251aa29e8574be94' + '2bbd8c4e51b70223d274fef3a167af096f44af3d3c41ae505ad11c606674e7c5') -build() { +prepare() { cd postgresql-${pkgver} + patch -p1 < ../postgresql-run-socket.patch +} - patch -Np1 < ../postgresql-run-socket.patch - - ./configure \ - --prefix=/usr \ - --mandir=/usr/share/man \ - --datadir=/usr/share/postgresql \ - --sysconfdir=/etc \ - --with-gssapi \ - --with-libxml \ - --with-openssl \ - --with-perl \ - --with-python PYTHON=/usr/bin/python \ - --with-tcl \ - --with-pam \ - --with-system-tzdata=/usr/share/zoneinfo \ - --with-uuid=e2fs \ - --enable-nls \ +build() { + cd postgresql-${pkgver} + 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 + --enable-nls --enable-thread-safety - - make world -j8 + ) + + # only build plpython3 for now + ./configure ${options[@]} \ + PYTHON=/usr/bin/python + make -C src/pl/plpython all + make -C contrib/hstore_plpython all + make -C contrib/ltree_plpython all + + # save plpython3 build and Makefile.global + cp -a src/pl/plpython{,3} + cp -a contrib/hstore_plpython{,3} + cp -a contrib/ltree_plpython{,3} + cp -a src/Makefile.global{,.python3} + make distclean + + # regular build with everything + ./configure ${options[@]} \ + PYTHON=/usr/bin/python2 + make world } package_postgresql-beta-libs() { pkgdesc="Libraries for use with PostgreSQL" - depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0') - provides=('postgresql-client' 'postgresql-libs') - conflicts=('postgresql-client' 'postgresql-libs') + depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0' 'zlib' 'libldap') + provides=('postgresql-client') + conflicts=('postgresql-client') cd postgresql-${pkgver} # install license - install -Dm 644 COPYRIGHT "${pkgdir}/usr/share/licenses/postgresql-libs/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 @@ -71,7 +93,7 @@ package_postgresql-beta-libs() { cd src/include - mkdir -p "${pkgdir}"/usr/include/{libpq,postgresql/internal/libpq} + 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" @@ -91,13 +113,10 @@ package_postgresql-beta-libs() { package_postgresql-beta-docs() { pkgdesc="HTML documentation for PostgreSQL" options=('docs') - provides=('postgresql-docs') - conflicts=('postgresql-docs') - cd "${srcdir}/postgresql-${pkgver}" + cd postgresql-${pkgver} - # install license - install -Dm 644 COPYRIGHT "${pkgdir}/usr/share/licenses/postgresql-docs/LICENSE" + install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}" make -C doc/src/sgml DESTDIR="${pkgdir}" install-html chown -R root:root "${pkgdir}/usr/share/doc/postgresql/html" @@ -110,14 +129,13 @@ package_postgresql-beta-docs() { package_postgresql-beta() { pkgdesc='Sophisticated object-relational DBMS' backup=('etc/pam.d/postgresql' 'etc/logrotate.d/postgresql') - depends=("postgresql-beta-libs>=${pkgver}" 'krb5' 'libxml2' 'readline>=6.0' 'openssl>=1.0.0' 'pam') - optdepends=('python: for PL/Python support' + depends=("postgresql-beta-libs>=${pkgver}" 'krb5' 'libxml2' 'readline>=6.0' 'openssl>=1.0.0' 'pam' 'icu' 'libsystemd' 'libldap') + 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') options=('staticlibs') - provides=('postgresql') - conflicts=('postgresql') install=postgresql.install cd postgresql-${pkgver} @@ -127,6 +145,14 @@ package_postgresql-beta() { make -C contrib DESTDIR="${pkgdir}" install make -C doc/src/sgml DESTDIR="${pkgdir}" install-man + # install plpython3 + mv src/Makefile.global src/Makefile.global.save + cp src/Makefile.global.python3 src/Makefile.global + touch -r src/Makefile.global.save src/Makefile.global + make -C src/pl/plpython3 DESTDIR="${pkgdir}" install + make -C contrib/hstore_plpython3 DESTDIR="${pkgdir}" install + make -C contrib/ltree_plpython3 DESTDIR="${pkgdir}" install + # 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 @@ -136,25 +162,19 @@ package_postgresql-beta() { rm "${pkgdir}"/usr/share/man/man1/${util}.1 done - # install license - install -Dm 644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" - # 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" - install -Dm 644 "${srcdir}/postgresql.service" \ - "${pkgdir}/usr/lib/systemd/system/postgresql.service" - install -Dm 755 "${srcdir}/postgresql-check-db-dir" \ - "${pkgdir}/usr/bin/postgresql-check-db-dir" + install -Dm 644 "${srcdir}/postgresql.service" -t "${pkgdir}/usr/lib/systemd/system" + install -Dm 755 "${srcdir}/postgresql-check-db-dir" -t "${pkgdir}/usr/bin" - install -Dm 644 "${srcdir}/postgresql.pam" \ - "${pkgdir}/etc/pam.d/postgresql" + install -Dm 644 "${srcdir}/postgresql.pam" "${pkgdir}/etc/pam.d/postgresql" + install -Dm 644 "${srcdir}/postgresql.logrotate" "${pkgdir}/etc/logrotate.d/postgresql" - install -Dm 644 "${srcdir}/postgresql.logrotate" \ - "${pkgdir}/etc/logrotate.d/postgresql" + install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}" } # vim: ts=2 sw=2 et: diff --git a/postgresql-check-db-dir b/postgresql-check-db-dir index acf73eb15851..fabca97e2c49 100755 --- a/postgresql-check-db-dir +++ b/postgresql-check-db-dir @@ -16,9 +16,9 @@ then fi # PGMAJORVERSION is major version -PGMAJORVERSION=10 +PGMAJORVERSION=11 # PREVMAJORVERSION is the previous major version -PREVMAJORVERSION=9.6 +PREVMAJORVERSION=10 # Check for the PGDATA structure if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ] diff --git a/postgresql.service b/postgresql.service index 37fcae996352..3981058622dd 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 |