mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-25 02:21:58 +01:00
309 lines
7.8 KiB
Plaintext
309 lines
7.8 KiB
Plaintext
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Contributor: G.J.R. Timmer <gjr.timmer@gmail.com>
|
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
pkgname=postgresql
|
|
pkgver=13.3
|
|
pkgrel=0
|
|
pkgdesc="A sophisticated object-relational DBMS"
|
|
url="https://www.postgresql.org/"
|
|
arch="all"
|
|
license="PostgreSQL"
|
|
depends="postgresql-client tzdata"
|
|
install="$pkgname.pre-install $pkgname.pre-upgrade"
|
|
pkgusers="postgres"
|
|
pkggroups="postgres"
|
|
checkdepends="diffutils"
|
|
depends_dev="clang icu-dev llvm openssl-dev"
|
|
makedepends="$depends_dev
|
|
icu-dev
|
|
libxml2-dev
|
|
linux-headers
|
|
llvm-dev
|
|
openldap-dev
|
|
perl-dev
|
|
python3-dev
|
|
readline-dev
|
|
tcl-dev
|
|
util-linux-dev
|
|
zlib-dev
|
|
"
|
|
subpackages="
|
|
libpq
|
|
$pkgname-client
|
|
$pkgname-contrib
|
|
$pkgname-dev
|
|
$pkgname-doc
|
|
$pkgname-libs
|
|
$pkgname-openrc
|
|
$pkgname-plperl
|
|
$pkgname-plperl-contrib:plperl_contrib
|
|
$pkgname-plpython3
|
|
$pkgname-plpython3-contrib:plpython3_contrib
|
|
$pkgname-pltcl
|
|
"
|
|
source="https://ftp.postgresql.org/pub/source/v$pkgver/postgresql-$pkgver.tar.bz2
|
|
initdb.patch
|
|
perl-rpath.patch
|
|
conf-unix_socket_directories.patch
|
|
disable-broken-tests.patch
|
|
disable-test-collate.icu.utf8.patch
|
|
czech-snowball-stemmer.patch
|
|
$pkgname.initd
|
|
$pkgname.confd
|
|
pg-restore.initd
|
|
pg-restore.confd
|
|
pltcl_create_tables.sql
|
|
"
|
|
|
|
# secfixes:
|
|
# 13.3-r0:
|
|
# - CVE-2021-32027
|
|
# - CVE-2021-32028
|
|
# - CVE-2021-32029
|
|
# 13.2-r0:
|
|
# - CVE-2021-3393
|
|
# - CVE-2021-20229
|
|
# 12.5-r0:
|
|
# - CVE-2020-25694
|
|
# - CVE-2020-25695
|
|
# - CVE-2020-25696
|
|
# 12.4-r0:
|
|
# - CVE-2020-14349
|
|
# - CVE-2020-14350
|
|
# 12.2-r0:
|
|
# - CVE-2020-1720
|
|
# 11.5-r0:
|
|
# - CVE-2019-10208
|
|
# - CVE-2019-10209
|
|
# 11.4-r0:
|
|
# - CVE-2019-10164
|
|
# 11.3-r0:
|
|
# - CVE-2019-10129
|
|
# - CVE-2019-10130
|
|
# 11.1-r0:
|
|
# - CVE-2018-16850
|
|
# 10.5-r0:
|
|
# - CVE-2018-10915
|
|
# - CVE-2018-10925
|
|
# 10.4-r0:
|
|
# - CVE-2018-1115
|
|
# 10.3-r0:
|
|
# - CVE-2018-1058
|
|
# 10.2-r0:
|
|
# - CVE-2018-1052
|
|
# - CVE-2018-1053
|
|
# 10.1-r0:
|
|
# - CVE-2017-15098
|
|
# - CVE-2017-15099
|
|
# 9.6.4-r0:
|
|
# - CVE-2017-7546
|
|
# - CVE-2017-7547
|
|
# - CVE-2017-7548
|
|
# 9.6.3-r0:
|
|
# - CVE-2017-7484
|
|
# - CVE-2017-7485
|
|
# - CVE-2017-7486
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
local file; for file in $pkgname.initd $pkgname.confd; do
|
|
sed "s|@VERSION@|${pkgver%.*}|" "$srcdir"/$file > $file
|
|
done
|
|
}
|
|
|
|
build() {
|
|
export PYTHON=/usr/bin/python3
|
|
export CFLAGS="${CFLAGS/-Os/-O2}"
|
|
export CPPFLAGS="${CPPFLAGS/-Os/-O2}"
|
|
|
|
# when disable-spinlocks is no longer required - check postgresql-bdr package
|
|
case $CARCH in
|
|
riscv64) local _configure=--disable-spinlocks;;
|
|
esac
|
|
|
|
./configure \
|
|
--build=$CBUILD \
|
|
--host=$CHOST \
|
|
--prefix=/usr \
|
|
--mandir=/usr/share/man \
|
|
--with-system-tzdata=/usr/share/zoneinfo \
|
|
--with-ldap \
|
|
--with-libxml \
|
|
--with-openssl \
|
|
--with-uuid=e2fs \
|
|
--disable-rpath \
|
|
--with-llvm \
|
|
--with-perl \
|
|
--with-python \
|
|
--with-icu \
|
|
--with-tcl \
|
|
$_configure
|
|
make world
|
|
}
|
|
|
|
check() {
|
|
_run_tests src/test
|
|
_run_tests src/pl
|
|
_run_tests contrib
|
|
}
|
|
|
|
package() {
|
|
make DESTDIR="$pkgdir" install install-docs
|
|
|
|
cd "$pkgdir"
|
|
|
|
install -d -m750 -o postgres -g postgres \
|
|
./var/lib/postgresql \
|
|
./var/log/$pkgname
|
|
|
|
install -D -m755 "$builddir"/postgresql.initd ./etc/init.d/postgresql
|
|
install -D -m644 "$builddir"/postgresql.confd ./etc/conf.d/postgresql
|
|
|
|
install -D -m755 "$srcdir"/pg-restore.initd ./etc/init.d/pg-restore
|
|
install -D -m644 "$srcdir"/pg-restore.confd ./etc/conf.d/pg-restore
|
|
}
|
|
|
|
dev() {
|
|
default_dev
|
|
|
|
amove usr/bin/pg_config \
|
|
usr/bin/ecpg \
|
|
usr/lib/postgresql/pgxs
|
|
}
|
|
|
|
libpq() {
|
|
pkgdesc="PostgreSQL libraries"
|
|
depends=""
|
|
|
|
amove usr/lib/libpq.so.*
|
|
}
|
|
|
|
libs() {
|
|
depends=""
|
|
default_libs
|
|
}
|
|
|
|
client() {
|
|
pkgdesc="PostgreSQL client"
|
|
depends=""
|
|
|
|
cd "$pkgdir"/usr/bin
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv clusterdb \
|
|
createdb \
|
|
createuser \
|
|
dropdb \
|
|
dropuser \
|
|
pg_basebackup \
|
|
pg_dump \
|
|
pg_dumpall \
|
|
pg_isready \
|
|
pg_receivewal \
|
|
pg_recvlogical \
|
|
pg_restore \
|
|
psql \
|
|
reindexdb \
|
|
vacuumdb \
|
|
"$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
contrib() {
|
|
pkgdesc="Extension modules distributed with PostgreSQL"
|
|
depends=""
|
|
|
|
cd "$builddir"
|
|
|
|
# Avoid installing plperl and plpython extensions, these will be
|
|
# installed into separate subpackages.
|
|
sed -Ei -e 's/(.*_plperl)/#\1/' \
|
|
-e 's/(.*_plpython)/#\1/' \
|
|
contrib/Makefile
|
|
|
|
make -C contrib DESTDIR="$subpkgdir" install
|
|
|
|
mv "$subpkgdir"/usr/share/doc/postgresql/extension \
|
|
"$pkgdir"/usr/share/doc/postgresql/
|
|
rmdir -p "$subpkgdir"/usr/share/doc/postgresql || true
|
|
}
|
|
|
|
pltcl() {
|
|
pkgdesc="PL/Tcl procedural language for PostgreSQL"
|
|
depends="pgtcl"
|
|
|
|
amove usr/lib/postgresql/pltcl.so \
|
|
usr/share/postgresql/extension/pltcl*
|
|
|
|
install -m 644 "$srcdir"/pltcl_create_tables.sql \
|
|
"$subpkgdir"/usr/share/postgresql/
|
|
}
|
|
|
|
plperl() {
|
|
pkgdesc="PL/Perl procedural language for PostgreSQL"
|
|
depends=""
|
|
|
|
amove usr/lib/postgresql/plperl.so \
|
|
usr/share/postgresql/extension/plperl*
|
|
}
|
|
|
|
plperl_contrib() {
|
|
_plcontrib plperl "PL/Perl"
|
|
|
|
cd "$builddir"
|
|
make -C contrib/hstore_plperl DESTDIR="$subpkgdir" install
|
|
}
|
|
|
|
plpython3() {
|
|
pkgdesc="PL/Python3 procedural language for PostgreSQL"
|
|
depends="python3"
|
|
|
|
amove usr/lib/postgresql/plpython3.so \
|
|
usr/share/postgresql/extension/plpython*
|
|
}
|
|
|
|
plpython3_contrib() {
|
|
_plcontrib plpython3 "PL/Python 3"
|
|
|
|
cd "$builddir"
|
|
make -C contrib/hstore_plpython DESTDIR="$subpkgdir" install
|
|
make -C contrib/ltree_plpython DESTDIR="$subpkgdir" install
|
|
|
|
cd "$subpkgdir"/usr/share/postgresql/extension/
|
|
rm ./*plpython2* ./*plpythonu*
|
|
}
|
|
|
|
_plcontrib() {
|
|
local subname="$1"
|
|
pkgdesc="$2 extension modules distributed with PostgreSQL"
|
|
depends="$pkgname-$subname"
|
|
install_if="$pkgname-$subname=$pkgver-r$pkgrel $pkgname-contrib=$pkgver-r$pkgrel"
|
|
}
|
|
|
|
_run_tests() {
|
|
local path="$1"; shift
|
|
|
|
msg "Running test suite at $path..."
|
|
# Note: some tests fail when running in parallel.
|
|
make -k -j 1 -C "$path" "$@" check MAX_CONNECTIONS=5 || {
|
|
printf "\n%s\n\n" "Trying to find all regression.diffs files in build directory..." >&2
|
|
find "$path" -name regression.diffs | while read -r file; do
|
|
echo "=== test failure: $file ===" >&2
|
|
cat "$file" >&2
|
|
done
|
|
return 1
|
|
}
|
|
}
|
|
|
|
sha512sums="1560cc766982a9ea9d33c77835b20e33e11b03acb77fc75d905c565883935a7dbcd27b9b2ab6a0ecdb815261f7c259865cb3dac85c10a3181c3fcaeb4d28bf60 postgresql-13.3.tar.bz2
|
|
1f8e7dc58f5b0a12427cf2fd904ffa898a34f23f3332c8382b94e0d991c007289e7913a69e04498f3d93fc5701855796c207b4b1cc4a0b366f586050124d7fcc initdb.patch
|
|
27e00b58fe5c3899c66fc0dde51846c14701bcfedd132b106d676783ba603e8cbdc6e620f29b52dc892bdaa9302052788cf5e575a1659f61c017a12e0d2ee4d0 perl-rpath.patch
|
|
8439a6fdfdea0a4867daeb8bc23d6c825f30c00d91d4c39f48653f5ee77341f23282ce03a77aad94b5369700f11d2cb28d5aee360e59138352a9ab331a9f9d0f conf-unix_socket_directories.patch
|
|
c4179fcd8b71791cdc41ea7b622cf82e9bd42ac1de66999234b98a83c0c508c79c492a9301274fe859c06a3f1a8b17b53ab97541ab76801a985f8f0b9b8716e7 disable-broken-tests.patch
|
|
14703da0a9441ae1bbad9fe124c4c267526975a22080c5f3e8c3a323164b743158ee10fcff31f18131a64e765c89125410652b317da46e92e962f251079f5a9a disable-test-collate.icu.utf8.patch
|
|
2bd10c4911a50432a00d47bf423c2bb120bacd01a04b41430aa427ae15eafeb3f61e386893211fd147bc7972e4e7f9075ec9e0cd18d50caac14ab0eddb707ef7 czech-snowball-stemmer.patch
|
|
2c72eab48a9f13b09a7c6859d6e5a6876e26e3d2dafb2fca4989d65efd8f34a7d20410ca9d5a653291e31e67e9bda3048312c67eb675e04ab972c26c97bca004 postgresql.initd
|
|
50034cd4ed040dfcae8b015ddfba9a9210787d170125451e75ceaadc9f8364a1c93ba6ddeb205a6deb21f96c7634066919d26686c3af514bf0693a97d6b0dbd0 postgresql.confd
|
|
f5a1cba051e7d846c2d16703514601cb25729ed96b677c9bd0c199d64552120a8b14b238af01917fdb87106681e12dee6fff7447558155ba273e4f96be5e2892 pg-restore.initd
|
|
c14a5684e914abb3b0ee71bbf15eed71a9264deacaa404a6e3af6bfc330d93e7598624d0ed11a94263106cc660f7f54c8ff57e759033cf606a795f69ff6c1c7c pg-restore.confd
|
|
5c9bfd9e295dcf678298bf0aa974347a7c311d6e7c2aa76a6920fcb751d01fd1ab77abbec11f3c672f927ad9deaa88e04e370c0b5cd1b60087554c474b748731 pltcl_create_tables.sql"
|