summaryrefslogtreecommitdiff
path: root/math/R/Makefile.extension
blob: 638946f8452b1281de88e5ad3d239837d500221f (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
# $NetBSD: Makefile.extension,v 1.4 2003/03/29 12:41:38 jmmv Exp $
#
# This Makefile fragment is included by packages for R library packages.
#
# To use this Makefile fragment, simply:
#
# (1) define R_PKGNAME and R_PKGVER to the R package name and version
#     for the package desired.
# (2) Include this Makefile fragment in the package Makefile,

DISTNAME?=		${R_PKGNAME}_${R_PKGVER}
PKGNAME?=		R-${R_PKGNAME}-${R_PKGVER:S/-/./}
WRKSRC=         	${WRKDIR}/${R_PKGNAME}
MASTER_SITES?=		${MASTER_SITE_R_CRAN:=contrib/}
DIST_SUBDIR?=		R
CATEGORIES+=		math

R_DEPENDS?=		R>=1.4.1nb2
DEPENDS+=               ${R_DEPENDS}:../../math/R

NO_BUILD=		YES

do-install:
	R_LIBS= ${LOCALBASE}/bin/R CMD INSTALL ${WRKDIR}/${R_PKGNAME}

# automatically generate the PLIST
R_LIB=			lib/R/library
R_INST_DIRS?=		${R_PKGNAME}

R_PACKLIST_FILES=	( cd ${PREFIX}; for dir in ${R_INST_DIRS}; do \
	${FIND} ${R_LIB}/$${dir} \( -type f -o -type l \) -print; done ) | ${SORT} -u
R_PACKLIST_DIRS=	( cd ${PREFIX}; for dir in ${R_INST_DIRS}; do \
	${FIND} ${R_LIB}/$${dir} -type d -print; done ) | ${SORT} -ur | ${SED} -e "s|^|@dirrm |"
R_PACKLIST_CMDS=	( ${ECHO} '@exec R CMD ${PERL5} %D/lib/R/share/perl/build-help.pl --htmllists 2>/dev/null'; \
	${ECHO} '@exec ${CAT} %D/lib/R/library/*/CONTENTS > %D/lib/R/doc/html/search/index.txt 2>/dev/null'; \
	${ECHO} '@unexec R CMD ${PERL5} %D/lib/R/share/perl/build-help.pl --htmllists 2>/dev/null'; \
	${ECHO} '@unexec ${CAT} %D/lib/R/library/*/CONTENTS > %D/lib/R/doc/html/search/index.txt 2>/dev/null' )

R_GENERATE_PLIST=	${R_PACKLIST_FILES}; \
			${R_PACKLIST_DIRS}; \
			${R_PACKLIST_CMDS}
GENERATE_PLIST+=	${R_GENERATE_PLIST};