aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-01-28 15:13:45 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-02-07 11:53:35 +0100
commit4eb83dfe4f56464fd9fa63089773bb0cd5ce350a (patch)
treece16542ff79d4779eff7a9299b676f0fe873cd1f /main/postgresql/APKBUILD
parente8cea42c3f1e997adb08b468acd54d2f76d84d01 (diff)
downloadaports-4eb83dfe4f56464fd9fa63089773bb0cd5ce350a.tar.bz2
aports-4eb83dfe4f56464fd9fa63089773bb0cd5ce350a.tar.xz
main/postgresql: move PL contrib extensions to subpackages
Diffstat (limited to 'main/postgresql/APKBUILD')
-rw-r--r--main/postgresql/APKBUILD68
1 files changed, 56 insertions, 12 deletions
diff --git a/main/postgresql/APKBUILD b/main/postgresql/APKBUILD
index c21fd54ef5..6a53518840 100644
--- a/main/postgresql/APKBUILD
+++ b/main/postgresql/APKBUILD
@@ -16,8 +16,10 @@ depends_dev="libressl-dev"
makedepends="$depends_dev libedit-dev zlib-dev libxml2-dev util-linux-dev
openldap-dev tcl-dev perl-dev python2-dev python3-dev"
subpackages="$pkgname-contrib $pkgname-dev $pkgname-doc libpq $pkgname-libs
- $pkgname-client $pkgname-plperl $pkgname-plpython2 $pkgname-plpython3
- $pkgname-pltcl"
+ $pkgname-client $pkgname-pltcl
+ $pkgname-plperl $pkgname-plperl-contrib:plperl_contrib
+ $pkgname-plpython2 $pkgname-plpython2-contrib:plpython2_contrib
+ $pkgname-plpython3 $pkgname-plpython3-contrib:plpython3_contrib"
source="ftp://ftp.$pkgname.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2
initdb.patch
perl-rpath.patch
@@ -140,22 +142,47 @@ contrib() {
depends=""
cd "$builddir"
- make DESTDIR="$subpkgdir" -C contrib install || return 1
+
+ # 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 || return 1
+
+ make -C contrib DESTDIR="$subpkgdir" install || return 1
mv "$subpkgdir"/usr/share/doc/postgresql/extension \
"$pkgdir"/usr/share/doc/postgresql/ || return 1
rmdir -p "$subpkgdir"/usr/share/doc/postgresql || true
}
+pltcl() {
+ pkgdesc="PL/Tcl procedural language for PostgreSQL"
+ depends="pgtcl"
+
+ cd "$pkgdir"
+ _submv usr/bin/pltcl* \
+ usr/lib/postgresql/pltcl.so \
+ usr/share/postgresql/unknown.pltcl \
+ usr/share/postgresql/extension/pltcl*
+}
+
plperl() {
- depends=""
pkgdesc="PL/Perl procedural language for PostgreSQL"
+ depends=""
cd "$pkgdir"
_submv 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
+}
+
plpython2() {
pkgdesc="PL/Python2 procedural language for PostgreSQL"
depends=""
@@ -165,6 +192,16 @@ plpython2() {
usr/share/postgresql/extension/plpython*
}
+plpython2_contrib() {
+ _plcontrib plpython2 "PL/Python 2"
+
+ cd "$builddir"
+ make -C contrib/hstore_plpython DESTDIR="$subpkgdir" install || return 1
+ make -C contrib/ltree_plpython DESTDIR="$subpkgdir" install || return 1
+
+ rm "$subpkgdir"/usr/share/postgresql/extension/*plpython3*
+}
+
plpython3() {
pkgdesc="PL/Python3 procedural language for PostgreSQL"
depends=""
@@ -174,15 +211,22 @@ plpython3() {
rm -R "$subpkgdir"/usr/include
}
-pltcl() {
- pkgdesc="PL/Tcl procedural language for PostgreSQL"
- depends="pgtcl"
+plpython3_contrib() {
+ _plcontrib plpython3 "PL/Python 3"
- cd "$pkgdir"
- _submv usr/bin/pltcl* \
- usr/lib/postgresql/pltcl.so \
- usr/share/postgresql/unknown.pltcl \
- usr/share/postgresql/extension/pltcl*
+ cd "$builddir"~py3
+ make -C contrib/hstore_plpython DESTDIR="$subpkgdir" install || return 1
+ make -C contrib/ltree_plpython DESTDIR="$subpkgdir" install || return 1
+
+ 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"
}
_submv() {