summaryrefslogtreecommitdiff
blob: de258b47ae724e47bfc4bc91ff2f4f6a4ebdb8b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

#
# Original Author: root
# Purpose: Installing postgresql extension for all available slots
#

ECLASS="postgresql-ext"
INHERITED="$INHERITED $ECLASS"
inherit postgresql multislot
EXPORT_FUNCTIONS src_unpack src_compile src_test src_install

MULTISLOT_ECLASSES="postgresql-ext ${MULTISLOT_ECLASSES}"

postgresql-ext_slots_enumerate() {
	postgresql_get_versions_range ${WANT_POSTGRES_SLOTS}
}

postgresql-ext_src_unpack() {
	multislot_src_unpack "$@"
}
postgresql-ext_src_compile() {
	multislot_src_compile "$@"
}
postgresql-ext_src_install() {
	multislot_src_install "$@"
}
postgresql-ext_src_test() {
	multislot_src_test "$@"
}

postgresql-ext_slot_src_unpack() {
	PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_unpack "$@"
}
postgresql-ext_slot_src_compile() {
	PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_compile "$@"
}
postgresql-ext_slot_src_test() {
	PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_test "$@"
}
postgresql-ext_slot_src_install() {
	PATH="$(postgresql_get_bindir_for_slot $SLOTSLOT):${PATH}" multislot_run_fun pgslot_src_install "$@"
}

postgresql-ext_pgslot_src_unpack() {
	multislot_slot_src_unpack
}
postgresql-ext_pgslot_src_compile() {
	multislot_slot_src_compile
}
postgresql-ext_pgslot_src_test() {
	multislot_slot_src_test
}
postgresql-ext_pgslot_src_install() {
	multislot_slot_src_install
}

postgresql-ext_pg_slots_depend() {
	local vers=( ${WANT_POSTGRES_SLOTS} )
	if [[ -z "${vers[0]}" ]] ; then
		echo 'virtual/postgresql-server'
	else
		echo ">=virtual/postgresql-server-${vers[0]}"
		if [[ ! -z "${vers[1]}" ]] ; then
			echo "<=virtual/postgresql-server-${vers[1]}"
		fi
	fi
}

DEPEND="$(postgresql-ext_pg_slots_depend)"
RDEPEND="$(postgresql-ext_pg_slots_depend)"