archrelease: copy trunk to extra-x86_64
[arch-packages.git] / postgresql / repos / extra-x86_64 / PKGBUILD
blob7d9a989a066ad4ef41351cb480b14581291afd0e
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Dan McGee <dan@archlinux.org>
4 pkgbase=postgresql
5 pkgname=('postgresql-libs' 'postgresql-docs' 'postgresql')
6 pkgver=14.3
7 _majorver=${pkgver%.*}
8 pkgrel=3
9 pkgdesc='Sophisticated object-relational DBMS'
10 url='https://www.postgresql.org/'
11 arch=('x86_64')
12 license=('custom:PostgreSQL')
13 makedepends=('krb5' 'libxml2' 'python' 'perl' 'tcl>=8.6.0' 'openssl>=1.0.0'
14              'pam' 'zlib' 'icu' 'systemd' 'libldap' 'llvm' 'clang' 'libxslt'
15              'util-linux')
16 options=('debug')
17 source=(https://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2
18         postgresql-run-socket.patch
19         postgresql-perl-rpath.patch
20         postgresql-perl-5.36.patch
21         postgresql.pam
22         postgresql.logrotate
23         postgresql.service
24         postgresql-check-db-dir
25         postgresql.sysusers
26         postgresql.tmpfiles)
27 md5sums=('c83c28c774dd55b078f7dae0e30163be'
28          'bdafe5b6cd3ac2675cda972f322b6188'
29          '4572e8317064bd47429938c4c5681470'
30          '558a287c0a3ba9fbddb40d29941e3a10'
31          '96f82c38f3f540b53f3e5144900acf17'
32          'd28e443f9f65a5712c52018b84e27137'
33          '0418d1b78f15b969c1575657d47ab130'
34          '984ab302670537938627688bdcd5c296'
35          '2050d34e4dfa05f3c6fe4cd7615eaa4b'
36          '02d017978f0bba21f455feceb3f0a45a')
37 sha256sums=('279057368bf59a919c05ada8f95c5e04abb43e74b9a2a69c3d46a20e07a9af38'
38             '55d4c36b41b3925e2d74d4695c261aa267f06d70b9d768864f54262ec332eda4'
39             'dc17da62ce200ea2dacd5eb27adc33b0e296eb5bb10fada54fe4539d214c81c8'
40             'dab4ebcd55738b2ea7c87b123f7f52d7ac834c21984715a162a32df8d8957af8'
41             '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
42             '6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e'
43             '25fb140b90345828dc01a4f286345757e700a47178bab03d217a7a5a79105b57'
44             '0ad19ab58ee90c6cd97fe4ccb3287b3a2982768d937b4742d9e5572311349e6d'
45             '7fa8f0ef3f9d40abd4749cc327c2f52478cb6dfb6e2405bd0279c95e9ff99f12'
46             '4a4c0bb9ceb156cc47e9446d8393d1f72b4fe9ea1d39ba17213359df9211da57')
47 b2sums=('8c9124cb758618d770a1084553f9e8f9a3fcb4e17e1aa4a1649e04f4c057f33ce1e5890bba3288bed2257236a4569735a77b3e5ddf989c2a2a4ef60ed494b3cc'
48         'f91b7bbd23569af7c24189f01d93cf71752c5559fd0dc93027b0944e3986dfddee929027884a77393d104b8ebf848650ed907e327828346e67a16f0aa0629fc1'
49         'cb10afa597fd7e99f3f69322657c2137ffcc311f11acc97782d48f928361c5b7063cec4ceb08a63c6d97d6a96793f209bbc5026369999fbe0097c0db137c25e1'
50         '6608a207e0378065eb09e2f3515d4934dda3b75d8d15a52994f06c5688da1ed90a75b3c974c13ef18a5ee847e35fa7e7c5b39c9ba43430ca918d5cf25b4dfc43'
51         '3eab84d332d96678fe6e435ee243c8f1a82b838f601d61d3604d11e918aed7a62202edca5e476c4b9031ed284570e6fcd6c659cfdbd9624aa0019d3233755f81'
52         '2209b7550acad7955102ec6922754b4046b2a2ad2a7e1cfb2cc4053c0705abac7aa7d7968eab617f50894797d06345f51c9a669926bd2a77dcf688206a2027e0'
53         'a4255df47b7ac1418d20aa73aa0f6e70c7952a10d706e5523043c48b2c3b6d8e39838049dfcc826913cd0f2c06502561d1abe8b19cce7071db66139ae93a37bf'
54         '9151b25750675fa93480378022679f2af5c4fb26c219012b668f5e4d16f3f9424982a6bd42941a20b4052d11d3b087ede74026cc199e61e59328c094d28bfe70'
55         '5e9cba2f45604db83eb77c7bbb54bc499a38274be6cd97abb056c9bdf18e637a8ac354e18f41f614f7e1a2d6f13c2a0b562ab0aaebf9447cf5eb2d60e6501e12'
56         '8a8e5ec24ea338b2b51b8d2be5a336ac8d4cc6b25200ed0f0d564df9942997478df0c54da2fac7b27d677774a34398f69047eecd0f97bdc0df8fe50a1b5ed74d')
58 # Upstream provides md5 and sha256
60 prepare() {
61   cd postgresql-${pkgver}
62   patch -p1 < ../postgresql-run-socket.patch
63   patch -p1 < ../postgresql-perl-rpath.patch
64   patch -p1 < ../postgresql-perl-5.36.patch
67 build() {
68   cd postgresql-${pkgver}
69   local configure_options=(
70     --prefix=/usr
71     --mandir=/usr/share/man
72     --datadir=/usr/share/postgresql
73     --sysconfdir=/etc
74     --with-gssapi
75     --with-libxml
76     --with-openssl
77     --with-perl
78     --with-python
79     --with-tcl
80     --with-pam
81     --with-readline
82     --with-system-tzdata=/usr/share/zoneinfo
83     --with-uuid=e2fs
84     --with-icu
85     --with-systemd
86     --with-ldap
87     --with-llvm
88     --with-libxslt
89     --enable-nls
90     --enable-thread-safety
91     --disable-rpath
92   )
94   # Fix static libs
95   CFLAGS+=" -ffat-lto-objects"
97   ./configure "${configure_options[@]}"
98   make world
101 _postgres_check() {
102   make "${1}" || (find . -name regression.diffs | \
103     while read -r line; do
104       echo "make ${1} failure: ${line}"
105       cat "${line}"
106     done; exit 1)
109 check() {
110   cd postgresql-${pkgver}
111   _postgres_check check
112   _postgres_check check-world
115 package_postgresql-libs() {
116   pkgdesc="Libraries for use with PostgreSQL"
117   depends=('krb5' 'openssl>=1.0.0' 'readline>=6.0' 'zlib' 'libldap')
118   provides=('postgresql-client' 'libpq.so' 'libecpg.so' 'libecpg_compat.so' 'libpgtypes.so')
119   conflicts=('postgresql-client')
121   cd postgresql-${pkgver}
123   # install license
124   install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
126   # install libs and non-server binaries
127   for dir in src/interfaces src/bin/pg_config src/bin/pg_dump src/bin/psql src/bin/scripts; do
128     make -C ${dir} DESTDIR="${pkgdir}" install
129   done
131   for util in pg_config pg_dump pg_dumpall pg_restore psql \
132       clusterdb createdb createuser dropdb dropuser pg_isready reindexdb vacuumdb; do
133     install -Dm 644 doc/src/sgml/man1/${util}.1 "${pkgdir}"/usr/share/man/man1/${util}.1
134   done
136   cd src/include
138   install -d "${pkgdir}"/usr/include/{libpq,postgresql/internal/libpq}
140   # these headers are needed by the public headers of the interfaces
141   install -m 644 pg_config.h "${pkgdir}/usr/include"
142   install -m 644 pg_config_os.h "${pkgdir}/usr/include"
143   install -m 644 pg_config_ext.h "${pkgdir}/usr/include"
144   install -m 644 postgres_ext.h "${pkgdir}/usr/include"
145   install -m 644 libpq/libpq-fs.h "${pkgdir}/usr/include/libpq"
146   install -m 644 pg_config_manual.h "${pkgdir}/usr/include"
148   # these he aders are needed by the not-so-public headers of the interfaces
149   install -m 644 c.h "${pkgdir}/usr/include/postgresql/internal"
150   install -m 644 port.h "${pkgdir}/usr/include/postgresql/internal"
151   install -m 644 postgres_fe.h "${pkgdir}/usr/include/postgresql/internal"
152   install -m 644 libpq/pqcomm.h "${pkgdir}/usr/include/postgresql/internal/libpq"
155 package_postgresql-docs() {
156   pkgdesc="HTML documentation for PostgreSQL"
157   options+=('docs')
159   cd postgresql-${pkgver}
161   install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
163   make -C doc/src/sgml DESTDIR="${pkgdir}" install-html
164   chown -R root:root "${pkgdir}/usr/share/doc/postgresql/html"
166   # clean up
167   rmdir "${pkgdir}"/usr/share/man/man{1,3,7}
168   rmdir "${pkgdir}"/usr/share/man
171 package_postgresql() {
172   pkgdesc='Sophisticated object-relational DBMS'
173   backup=('etc/pam.d/postgresql' 'etc/logrotate.d/postgresql')
174   depends=("postgresql-libs>=${pkgver}" 'krb5' 'libxml2' 'readline>=6.0'
175            'openssl>=1.0.0' 'pam' 'icu' 'systemd-libs' 'libldap' 'llvm-libs' 'libxslt')
176   optdepends=('python: for PL/Python 3 support'
177               'perl: for PL/Perl support'
178               'tcl: for PL/Tcl support'
179               'postgresql-old-upgrade: upgrade from previous major version using pg_upgrade'
180               'logrotate: rotates system logs automatically')
181   options+=('staticlibs')
182   install=postgresql.install
184   cd postgresql-${pkgver}
186   # install
187   make DESTDIR="${pkgdir}" install
188   make -C contrib DESTDIR="${pkgdir}" install
189   make -C doc/src/sgml DESTDIR="${pkgdir}" install-man
191   # we don't want these, they are in the -libs package
192   for dir in src/interfaces src/bin/pg_config src/bin/pg_dump src/bin/psql src/bin/scripts; do
193     make -C ${dir} DESTDIR="${pkgdir}" uninstall
194   done
195   for util in pg_config pg_dump pg_dumpall pg_restore psql \
196       clusterdb createdb createuser dropdb dropuser pg_isready reindexdb vacuumdb; do
197     rm "${pkgdir}"/usr/share/man/man1/${util}.1
198   done
200   install -Dm 644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
202   cd "${srcdir}"
203   install -Dm 755 postgresql-check-db-dir -t "${pkgdir}/usr/bin"
205   install -Dm 644 ${pkgname}.pam "${pkgdir}/etc/pam.d/${pkgname}"
206   install -Dm 644 ${pkgname}.logrotate "${pkgdir}/etc/logrotate.d/${pkgname}"
208   install -Dm 644 ${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system"
209   install -Dm 644 ${pkgname}.sysusers "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
210   install -Dm 644 ${pkgname}.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
212   # clean up unneeded installed items
213   rm -rf "${pkgdir}/usr/include/postgresql/internal"
214   rm -rf "${pkgdir}/usr/include/libpq"
215   find "${pkgdir}/usr/include" -maxdepth 1 -type f -execdir rm {} +
216   rmdir "${pkgdir}/usr/share/doc/postgresql/html"
219 # vim: ts=2 sw=2 et: