1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 DESCRIPTION="R language addon for postgresql database"
8 HOMEPAGE="http://www.joeconway.com/plr/"
9 SRC_URI="http://www.joeconway.com/plr/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
17 =virtual/postgresql-server-${SLOT}*"
20 S="${WORKDIR}/contrib/${PN}"
24 # the build system wants 'contrib' to be part of the path
25 mkdir "${WORKDIR}/contrib"
26 mv "${WORKDIR}/${PN}" "${S}"
30 if has_version "dev-db/postgresql-server:${SLOT}" ; then
31 export PG_CONFIG="/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config"
33 USE_PGXS=1 emake -j1 || die "emake failed"
37 USE_PGXS=1 emake -j1 DESTDIR="${D}" install || die "emake install failed"
42 if has_version "dev-db/postgresql-server:${SLOT}" ; then
43 sharepath="/usr/share/postgresql-${SLOT}/contrib"
45 sharepath="/usr/share/postgresql/contrib"
48 einfo "To install PL/R to your database issue"
50 einfo "\t psql -d mydatabase -U pg_username < ${sharepath}/plr.sql"
52 einfo "You may have to login as database administrator."
54 einfo "You have to define PL/R as TRUSTED language to allow non-administrators"
55 einfo "to use it. Change the CREATE LANGUAGE statement in the plr.sql file"
58 einfo "\t CREATE TRUSTED LANGUAGE plr HANDLER plr_call_handler;"
60 einfo "update the database as shown above and allow a specific user to"
63 einfo "\t GRANT USAGE ON LANGUAGE plr TO pg_username;"
65 einfo "For further information on PL/R have a look at"
67 einfo "\t http://www.joeconway.com/plr/"