]> Pileus Git - ~andy/sunrise/blob - dev-db/plr/plr-8.2.0.10.ebuild
sunrise/ app-portage/elog-list/elog-list-0.0.6.ebuild: Update headers for 2010
[~andy/sunrise] / dev-db / plr / plr-8.2.0.10.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit multilib
6
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"
10
11 LICENSE="GPL-2"
12 SLOT="8.2"
13 KEYWORDS="~amd64 ~x86"
14 IUSE=""
15
16 RDEPEND="dev-lang/R
17         =virtual/postgresql-server-${SLOT}*"
18 DEPEND="${RDEPEND}"
19
20 S="${WORKDIR}/contrib/${PN}"
21
22 src_unpack() {
23         unpack ${A}
24         # the build system wants 'contrib' to be part of the path
25         mkdir "${WORKDIR}/contrib"
26         mv "${WORKDIR}/${PN}" "${S}"
27 }
28
29 src_compile() {
30         if has_version "dev-db/postgresql-server:${SLOT}" ; then
31                 export PG_CONFIG="/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config"
32         fi
33         USE_PGXS=1 emake -j1 || die "emake failed"
34 }
35
36 src_install() {
37         USE_PGXS=1 emake -j1 DESTDIR="${D}" install || die "emake install failed"
38 }
39
40 pkg_postinst() {
41         local sharepath
42         if has_version "dev-db/postgresql-server:${SLOT}" ; then
43                 sharepath="/usr/share/postgresql-${SLOT}/contrib"
44         else
45                 sharepath="/usr/share/postgresql/contrib"
46         fi
47         einfo
48         einfo "To install PL/R to your database issue"
49         einfo
50         einfo "\t psql -d mydatabase -U pg_username < ${sharepath}/plr.sql"
51         einfo
52         einfo "You may have to login as database administrator."
53         einfo
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"
56         einfo "into"
57         einfo
58         einfo "\t CREATE TRUSTED LANGUAGE plr HANDLER plr_call_handler;"
59         einfo
60         einfo "update the database as shown above and allow a specific user to"
61         einfo "use PL/R by"
62         einfo
63         einfo "\t GRANT USAGE ON LANGUAGE plr TO pg_username;"
64         einfo
65         einfo "For further information on PL/R have a look at"
66         einfo
67         einfo "\t http://www.joeconway.com/plr/"
68         einfo
69 }