# update postgresql-check-db-dir on major new version pkgbase=postgresql pkgname=('postgresql-libs' 'postgresql-docs' 'postgresql') pkgver=16.6 pkgrel=1 epoch=1 arch=('x86_64') url="https://www.postgresql.org/" license=('custom:PostgreSQL') makedepends=('krb5' 'libxml2' 'python3' 'perl' 'tcl' 'openssl' 'icu') source=("https://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2" 'postgresql-run-socket.patch' 'postgresql.pam' 'postgresql.logrotate' 'postgresql.service' 'postgresql.tmpfiles.conf' 'postgresql-check-db-dir') sha256sums=('23369cdaccd45270ac5dcc30fa9da205d5be33fa505e1f17a0418d2caeca477b' '32ff197098c800345c6a5dafb04ba22c8762a237e5f866ae623e9b00e76f1de9' '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5' '6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e' 'c69b614731fdd3f4e127540814f5999f423363523c5209e252e19b1d4362ad68' '7e086d70e0dcaa6ce45693b4e826ce92d770192b3aff5642319b1ef279d88dc4' 'c52232af8f439fe43beb606d1d7942eeb657a5e13e925c16cde404321772200a') build() { cd postgresql-${pkgver} patch -p1 -i ${srcdir}/postgresql-run-socket.patch ./configure --prefix=/usr \ --mandir=/usr/share/man \ --datadir=/usr/share/postgresql \ --sysconfdir=/etc \ --with-krb5 \ --with-libxml \ --with-lz4 \ --with-openssl \ --with-perl \ --with-python \ --with-tcl \ --with-pam \ --with-system-tzdata=/usr/share/zoneinfo \ --with-systemd \ --with-zstd \ --enable-nls \ --enable-thread-safety make } package_postgresql-libs() { pkgdesc="Libraries for use with PostgreSQL" depends=('krb5' 'openssl' 'readline') cd postgresql-${pkgver} install -Dm0644 COPYRIGHT ${pkgdir}/usr/share/licenses/postgresql-libs/LICENSE # install libs for dir in src/interfaces src/bin/pg_config src/bin/psql src/bin/pg_dump; do make -C ${dir} DESTDIR=${pkgdir} install done install -D -m644 doc/src/sgml/man1/pg_config.1 ${pkgdir}/usr/share/man/man1/pg_config.1 install -D -m644 doc/src/sgml/man1/pg_dump.1 ${pkgdir}/usr/share/man/man1/pg_dump.1 install -D -m644 doc/src/sgml/man1/pg_dumpall.1 ${pkgdir}/usr/share/man/man1/pg_dumpall.1 install -D -m644 doc/src/sgml/man1/pg_restore.1 ${pkgdir}/usr/share/man/man1/pg_restore.1 install -D -m644 doc/src/sgml/man1/psql.1 ${pkgdir}/usr/share/man/man1/psql.1 cd src/include mkdir -p ${pkgdir}/usr/include/{libpq,postgresql/internal/libpq} # these headers are needed by the public headers of the interfaces install -m0644 pg_config.h ${pkgdir}/usr/include/ install -m0644 pg_config_os.h ${pkgdir}/usr/include/ install -m644 pg_config_ext.h ${pkgdir}/usr/include/ install -m0644 postgres_ext.h ${pkgdir}/usr/include/ install -m0644 libpq/libpq-fs.h ${pkgdir}/usr/include/libpq/ install -m0644 pg_config_manual.h ${pkgdir}/usr/include/ # these headers are needed by the not-so-public headers of the interfaces install -m0644 c.h ${pkgdir}/usr/include/postgresql/internal/ install -m0644 port.h ${pkgdir}/usr/include/postgresql/internal/ install -m0644 postgres_fe.h ${pkgdir}/usr/include/postgresql/internal/ install -m0644 libpq/pqcomm.h ${pkgdir}/usr/include/postgresql/internal/libpq/ } package_postgresql-docs() { pkgdesc="HTML documentation for PostgreSQL" options=(docs) cd postgresql-${pkgver} install -Dm0644 COPYRIGHT ${pkgdir}/usr/share/licenses/postgresql-docs/LICENSE 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() { pkgdesc="A sophisticated object-relational DBMS" backup=('etc/pam.d/postgresql' 'etc/logrotate.d/postgresql') depends=("postgresql-libs>=${pkgver}" 'krb5' 'libxml2' 'readline' 'openssl' 'python3') optdepends=('perl: for PL/Perl support' 'tcl: for PL/Tcl support') 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 # part of the -libs package for dir in src/interfaces src/bin/pg_config src/bin/psql src/bin/pg_dump; do make -C ${dir} DESTDIR=${pkgdir} uninstall done rm ${pkgdir}/usr/share/man/man1/pg_config.1 rm ${pkgdir}/usr/share/man/man1/pg_dump.1 rm ${pkgdir}/usr/share/man/man1/pg_dumpall.1 rm ${pkgdir}/usr/share/man/man1/pg_restore.1 rm ${pkgdir}/usr/share/man/man1/psql.1 install -D -m0644 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 -D -m644 ${srcdir}/postgresql.tmpfiles.conf ${pkgdir}/usr/lib/tmpfiles.d/postgresql.conf 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 # install pam file install -Dm0644 ${srcdir}/postgresql.pam ${pkgdir}/etc/pam.d/postgresql # install logrotate file install -Dm0644 ${srcdir}/postgresql.logrotate ${pkgdir}/etc/logrotate.d/postgresql }