diff options
author | a821 | 2023-08-26 10:33:52 +0200 |
---|---|---|
committer | a821 | 2023-08-26 10:33:52 +0200 |
commit | fa86374a416d1e452680c421dd8577af9e02703b (patch) | |
tree | fe7ba913e4413f26294d7cc5e75147283012afea | |
parent | 821f82098459d92c83a9b214bb729c496cd6edfb (diff) | |
download | aur-fa86374a416d1e452680c421dd8577af9e02703b.tar.gz |
Adopt and Update
* Use https for git sources to avoid often blocked git protocol.
* Add stable package names to conflict and provides arrays.
* Fix `pkgver()`
* .gitignore
This PKGBUILD follows the official one from gitlab with minor changes
* Depend on LLVM instead of LLVM15 (this needs to be checked)
* Remove version restrictions as they should be not neeeded.
* Add dependency on `docbook` packages to build sources. They are not
in git sources but they exist in source releases, so the official
PKGBUILD does not use them.
* Use only sha512sums as the rest are overkill IMHO
* Remove reference on postgres-old-upgrade as it does not make sense
for this VCS package. I assume the user knows what he's doing.
-rw-r--r-- | .SRCINFO | 57 | ||||
-rw-r--r-- | .gitignore | 12 | ||||
-rw-r--r-- | PKGBUILD | 98 | ||||
-rwxr-xr-x | postgresql-check-db-dir | 13 | ||||
-rw-r--r-- | postgresql.install | 39 |
5 files changed, 88 insertions, 131 deletions
@@ -1,17 +1,16 @@ pkgbase = postgresql-git pkgdesc = Sophisticated object-relational DBMS (Git version) - pkgver = 49068.d9a4cce29d - pkgrel = 3 + pkgver = 16.beta2.r311.g1a4fd77db8 + pkgrel = 1 url = https://www.postgresql.org/ arch = x86_64 license = custom:PostgreSQL makedepends = krb5 makedepends = libxml2 makedepends = python - makedepends = python2 makedepends = perl - makedepends = tcl>=8.6.0 - makedepends = openssl>=1.0.0 + makedepends = tcl + makedepends = openssl makedepends = pam makedepends = zlib makedepends = icu @@ -19,7 +18,12 @@ pkgbase = postgresql-git makedepends = libldap makedepends = llvm makedepends = clang - source = git://git.postgresql.org/git/postgresql.git + makedepends = libxslt + makedepends = util-linux + makedepends = git + makedepends = docbook-xml + makedepends = docbook-xsl + source = git+https://git.postgresql.org/git/postgresql.git source = postgresql-run-socket.patch source = postgresql-perl-rpath.patch source = postgresql.pam @@ -28,57 +32,58 @@ pkgbase = postgresql-git source = postgresql-check-db-dir source = postgresql.sysusers source = postgresql.tmpfiles - sha256sums = SKIP - sha256sums = 719d24c09c5ea17701cbd49b77f40c58bde52b603c3c8b85a708d277175d27b8 - sha256sums = 5bcc0bcedfa0271afaa05c35e7f651416a2a818c28069c51c2d0de0aa7d0dfdb - sha256sums = 57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5 - sha256sums = 6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e - sha256sums = 25fb140b90345828dc01a4f286345757e700a47178bab03d217a7a5a79105b57 - sha256sums = bb24b8ce8c69935b7527ed54e10a8823068e31c8aa5b8ffea81ce6993264e8db - sha256sums = 7fa8f0ef3f9d40abd4749cc327c2f52478cb6dfb6e2405bd0279c95e9ff99f12 - sha256sums = 4a4c0bb9ceb156cc47e9446d8393d1f72b4fe9ea1d39ba17213359df9211da57 sha512sums = SKIP sha512sums = caa2f44f00dff4ca8942a742c973f2d1b0ca4c7688c140858f61394aa74785dd5645c0301a04a1956c1e8a605487b640244497c845982f76bb0fea478e3b53f6 sha512sums = b6b5407b79f414618c72a7bb2cf259f6b99abcc3a6d7f55b62bb6933662fdad6d1e6663a47108912ac99779a3f4d1e1907cc45219af7cc28850211475a7f3f3e sha512sums = 1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67 sha512sums = 9ab4da01337ffbab8faec0e220aaa2a642dbfeccf7232ef2645bdc2177a953f17ee3cc14a4d8f8ebd064e1dae8b3dba6029adbffb8afaabea383963213941ba8 sha512sums = ee0c010be07e8b5396cfd89c1d077b7c5573753d0210ea4e330e314c2759e25fbee9071e663f871855d65cc8ac75162af9e793dd10892f50f515e7a89cc8d6a0 - sha512sums = eaaccae8dabad67d2bc54f74ec8d3ddb46257369b90080a2860b65d500053db6ace608be4c1b6baaeab4a03245dcbb5215eb41e468acc2304c037f094c2e7819 + sha512sums = 07ff44ce5d64b7d1e992a1829d44b00f8e04577b31686e9a4e9f32f249facc00b5415187e19f78dd3207b751adc852dc4fa2f4ab71f6de9167c28a131be60011 sha512sums = 36f7a5d38370fdc4d4267fd5a8a8330f152a1077bf0f065b89d4a7b8112ccd42be2c46c863791b77de02013f28275a42219f4236e7cb837c3f8cfd5fcc7d3373 sha512sums = 5fe81d716d56d515ee4ae1aac56652b7bf20346ea8413482fd9fdb79f0485d8c5ed099f4d2cc460cbe37686488f1354dec433905ce005da8fec772e783addc70 pkgname = postgresql-libs-git pkgdesc = Libraries for use with PostgreSQL depends = krb5 - depends = openssl>=1.0.0 - depends = readline>=6.0 + depends = openssl + depends = readline depends = zlib depends = libldap - provides = postgresql-client - conflicts = postgresql-client + provides = postgresql-libs + provides = libpq.so + provides = libecpg.so + provides = libecpg_compat.so + provides = libpgtypes.so + conflicts = postgresql-libs pkgname = postgresql-docs-git pkgdesc = HTML documentation for PostgreSQL + provides = postgresql-docs + conflicts = postgresql-docs options = docs pkgname = postgresql-git pkgdesc = Sophisticated object-relational DBMS - depends = postgresql-libs>=49068.d9a4cce29d + install = postgresql.install + depends = postgresql-libs-git depends = krb5 depends = libxml2 - depends = readline>=6.0 - depends = openssl>=1.0.0 + depends = readline + depends = openssl depends = pam depends = icu depends = systemd-libs depends = libldap depends = llvm-libs - optdepends = python2: for PL/Python 2 support + depends = libxslt + depends = lz4 + depends = zstd 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 + optdepends = logrotate: rotates system logs automatically + provides = postgresql + conflicts = postgresql options = staticlibs backup = etc/pam.d/postgresql backup = etc/logrotate.d/postgresql - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..3499c94a999b --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +* +!*.patch +!PKGBUILD +!.SRCINFO +!postgresql-check-db-dir +!postgresql.install +!postgresql.logrotate +!postgresql.pam +!postgresql.service +!postgresql.sysusers +!postgresql.tmpfiles +!.gitignore @@ -1,22 +1,20 @@ -# Maintainer: Felix Golatofski <contact@xdfr.de> +# Maintainer: a821 <a821 mail de> +# Contributor: Felix Golatofski <contact@xdfr.de> # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org> # Contributor: Dan McGee <dan@archlinux.org> -# -# Mainly using official postgresql PKGBUILD here -# pkgbase=postgresql-git pkgname=('postgresql-libs-git' 'postgresql-docs-git' 'postgresql-git') -pkgver=49068.d9a4cce29d -_majorver=${pkgver%.*} -pkgrel=3 +pkgver=16.beta2.r311.g1a4fd77db8 +pkgrel=1 pkgdesc='Sophisticated object-relational DBMS (Git version)' url='https://www.postgresql.org/' arch=('x86_64') license=('custom:PostgreSQL') -makedepends=('krb5' 'libxml2' 'python' 'python2' 'perl' 'tcl>=8.6.0' 'openssl>=1.0.0' - 'pam' 'zlib' 'icu' 'systemd' 'libldap' 'llvm' 'clang') -source=(git://git.postgresql.org/git/postgresql.git +makedepends=('krb5' 'libxml2' 'python' 'perl' 'tcl' 'openssl' + 'pam' 'zlib' 'icu' 'systemd' 'libldap' 'llvm' 'clang' 'libxslt' + 'util-linux' 'git' 'docbook-xml' 'docbook-xsl') +source=(git+https://git.postgresql.org/git/postgresql.git postgresql-run-socket.patch postgresql-perl-rpath.patch postgresql.pam @@ -25,31 +23,21 @@ source=(git://git.postgresql.org/git/postgresql.git postgresql-check-db-dir postgresql.sysusers postgresql.tmpfiles) -sha256sums=('SKIP' - '719d24c09c5ea17701cbd49b77f40c58bde52b603c3c8b85a708d277175d27b8' - '5bcc0bcedfa0271afaa05c35e7f651416a2a818c28069c51c2d0de0aa7d0dfdb' - '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5' - '6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e' - '25fb140b90345828dc01a4f286345757e700a47178bab03d217a7a5a79105b57' - 'bb24b8ce8c69935b7527ed54e10a8823068e31c8aa5b8ffea81ce6993264e8db' - '7fa8f0ef3f9d40abd4749cc327c2f52478cb6dfb6e2405bd0279c95e9ff99f12' - '4a4c0bb9ceb156cc47e9446d8393d1f72b4fe9ea1d39ba17213359df9211da57') sha512sums=('SKIP' 'caa2f44f00dff4ca8942a742c973f2d1b0ca4c7688c140858f61394aa74785dd5645c0301a04a1956c1e8a605487b640244497c845982f76bb0fea478e3b53f6' 'b6b5407b79f414618c72a7bb2cf259f6b99abcc3a6d7f55b62bb6933662fdad6d1e6663a47108912ac99779a3f4d1e1907cc45219af7cc28850211475a7f3f3e' '1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67' '9ab4da01337ffbab8faec0e220aaa2a642dbfeccf7232ef2645bdc2177a953f17ee3cc14a4d8f8ebd064e1dae8b3dba6029adbffb8afaabea383963213941ba8' 'ee0c010be07e8b5396cfd89c1d077b7c5573753d0210ea4e330e314c2759e25fbee9071e663f871855d65cc8ac75162af9e793dd10892f50f515e7a89cc8d6a0' - 'eaaccae8dabad67d2bc54f74ec8d3ddb46257369b90080a2860b65d500053db6ace608be4c1b6baaeab4a03245dcbb5215eb41e468acc2304c037f094c2e7819' + '07ff44ce5d64b7d1e992a1829d44b00f8e04577b31686e9a4e9f32f249facc00b5415187e19f78dd3207b751adc852dc4fa2f4ab71f6de9167c28a131be60011' '36f7a5d38370fdc4d4267fd5a8a8330f152a1077bf0f065b89d4a7b8112ccd42be2c46c863791b77de02013f28275a42219f4236e7cb837c3f8cfd5fcc7d3373' '5fe81d716d56d515ee4ae1aac56652b7bf20346ea8413482fd9fdb79f0485d8c5ed099f4d2cc460cbe37686488f1354dec433905ce005da8fec772e783addc70') pkgver() { - cd postgresql - printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + cd postgresql + git describe --tags | sed 's/REL_//;s/_/./;s/-/.r/;s/-/./g' | tr A-Z a-z } - prepare() { cd postgresql patch -p1 < ../postgresql-run-socket.patch @@ -58,7 +46,7 @@ prepare() { build() { cd postgresql - local options=( + local configure_options=( --prefix=/usr --mandir=/usr/share/man --datadir=/usr/share/postgresql @@ -70,46 +58,37 @@ build() { --with-python --with-tcl --with-pam + --with-readline --with-system-tzdata=/usr/share/zoneinfo --with-uuid=e2fs --with-icu --with-systemd --with-ldap --with-llvm + --with-libxslt + --with-lz4 + --with-zstd --enable-nls - --enable-thread-safety --disable-rpath ) - # 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 + # Fix static libs + CFLAGS+=" -ffat-lto-objects" + + ./configure "${configure_options[@]}" make world } _postgres_check() { make "${1}" || (find . -name regression.diffs | \ while read -r line; do - error "make ${1} failure: ${line}" + echo "make ${1} failure: ${line}" cat "${line}" done; exit 1) } check() { + export LANG=C cd postgresql _postgres_check check _postgres_check check-world @@ -117,9 +96,9 @@ check() { package_postgresql-libs-git() { pkgdesc="Libraries for use with PostgreSQL" - depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0' 'zlib' 'libldap') - provides=('postgresql-client') - conflicts=('postgresql-client') + depends=('krb5' 'openssl' 'readline' 'zlib' 'libldap') + provides=('postgresql-libs' 'libpq.so' 'libecpg.so' 'libecpg_compat.so' 'libpgtypes.so') + conflicts=('postgresql-libs') cd postgresql @@ -157,7 +136,9 @@ package_postgresql-libs-git() { package_postgresql-docs-git() { pkgdesc="HTML documentation for PostgreSQL" - options=('docs') + provides=('postgresql-docs') + conflicts=('postgresql-docs') + options+=('docs') cd postgresql @@ -174,13 +155,18 @@ package_postgresql-docs-git() { package_postgresql-git() { 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' + depends=("postgresql-libs-git" 'krb5' 'libxml2' 'readline' + 'openssl' 'pam' 'icu' 'systemd-libs' 'libldap' 'llvm-libs' + 'libxslt' 'lz4' 'zstd') + optdepends=('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') + 'logrotate: rotates system logs automatically') + provides=('postgresql') + conflicts=('postgresql') + options+=('staticlibs') + + install=postgresql.install cd postgresql @@ -189,14 +175,6 @@ package_postgresql-git() { 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 diff --git a/postgresql-check-db-dir b/postgresql-check-db-dir index 00d20b7b9176..47074e74eef2 100755 --- a/postgresql-check-db-dir +++ b/postgresql-check-db-dir @@ -15,10 +15,8 @@ then exit 1 fi -# PGMAJORVERSION is major version -PGMAJORVERSION=12 -# PREVMAJORVERSION is the previous major version -PREVMAJORVERSION=11 +# get PostgreSQL major version automatically +PGMAJORVERSION=$(psql -V | cut -d' ' -f 3 | sed -r 's/[^0-9].*$//') # Check for the PGDATA structure if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ] @@ -26,12 +24,7 @@ then # Check version of existing PGDATA if [ x`cat "$PGDATA/PG_VERSION"` = x"$PGMAJORVERSION" ] then - : A-OK - elif [ x`cat "$PGDATA/PG_VERSION"` = x"$PREVMAJORVERSION" ] - then - echo $"An old version of the database format was found." - echo $"See https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL" - exit 1 + exit 0 else echo $"An old version of the database format was found." echo $"You need to dump and reload before using PostgreSQL $PGMAJORVERSION." diff --git a/postgresql.install b/postgresql.install index 699efe692afd..da99373c5fda 100644 --- a/postgresql.install +++ b/postgresql.install @@ -1,39 +1,8 @@ -post_install() { - if [ ! -d '/var/lib/postgres' ]; then - mkdir -p '/var/lib/postgres' - fi - if ! getent group postgres >/dev/null; then - groupadd -g 88 postgres - fi - if ! getent passwd postgres >/dev/null; then - useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres - passwd -l postgres >/dev/null - fi - systemd-tmpfiles --create postgresql.conf - if [ ! -d '/var/lib/postgres/data' ]; then - mkdir -p '/var/lib/postgres/data' - chown postgres:postgres '/var/lib/postgres/data' - fi -} - post_upgrade() { - post_install $1 - # FS#23858, fix postgres user shell issue - postgres_shell=$(getent passwd postgres | cut -d: -f7) - if [ "$postgres_shell" = "/sbin/nologin" ]; then - chsh -s /bin/bash postgres - fi - if [ $(vercmp $2 '9.2.1-2') -lt 0 ]; then - echo "Note: The Unix domain socket location has changed; be sure to" - echo " restart any local applications using libpq.so." - fi -} + # Prints the warning message if the database version on disk + # does not match the PostgreSQL major version. -post_remove() { - if getent passwd postgres >/dev/null; then - userdel postgres - fi - if getent group postgres >/dev/null; then - groupdel postgres + if [ -d /var/lib/postgres/data ]; then + /usr/bin/postgresql-check-db-dir /var/lib/postgres/data || true fi } |