Added
Link Here
|
1 |
# $FreeBSD: head/Mk/bsd.cran.mk 335044 2013-11-27 18:56:43Z dbn $ |
2 |
# |
3 |
# Use the Comprehensive R Archive Network |
4 |
# |
5 |
# MAINTAINER= wen@FreeBSD.org |
6 |
# |
7 |
# Feature: cran |
8 |
# Usage: USES=cran or USES=cran:ARGS |
9 |
# Valid ARGS: auto-plist |
10 |
# |
11 |
# auto-plist The pkg-plist can be automatically compiled |
12 |
|
13 |
.if !defined(_INCLUDE_USES_CRAN_MK) |
14 |
_INCLUDE_USES_CRAN_MK= yes |
15 |
|
16 |
VALID_ARGS= auto-plist |
17 |
|
18 |
MASTER_SITE_CRAN+= http://ftp.ctex.org/mirrors/CRAN/src/contrib/ \ |
19 |
http://cran.rakanu.com/src/contrib/ \ |
20 |
http://cran.ms.unimelb.edu.au/src/contrib/ \ |
21 |
http://mirror.its.dal.ca/cran/src/contrib/ \ |
22 |
http://mirrors.dotsrc.org/cran/src/contrib/ \ |
23 |
http://cran.univ-lyon1.fr/src/contrib/ \ |
24 |
http://ftp5.gwdg.de/pub/misc/cran/src/contrib/ \ |
25 |
http://cran.stat.unipd.it/src/contrib/ \ |
26 |
http://cran.md.tsukuba.ac.jp/src/contrib/ \ |
27 |
http://mirrors.ibiblio.org/pub/mirrors/CRAN/src/contrib/ \ |
28 |
http://cran.cnr.berkeley.edu/src/contrib/ |
29 |
MASTER_SITE_CRAN_ARCHIVE+= ${MASTER_SITE_CRAN:S,$,Archive/${PORTNAME}/,} |
30 |
|
31 |
MASTER_SITES?= ${MASTER_SITE_CRAN} ${MASTER_SITE_CRAN_ARCHIVE} |
32 |
|
33 |
USE_FORTRAN= yes |
34 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/R:${PORTSDIR}/math/R |
35 |
RUN_DEPENDS+= ${LOCALBASE}/bin/R:${PORTSDIR}/math/R |
36 |
|
37 |
PKGNAMEPREFIX?= R-cran- |
38 |
|
39 |
R_LIB_DIR= lib/R/library |
40 |
R_MOD_DIR?= ${R_LIB_DIR}/${PORTNAME} |
41 |
PLIST_SUB+= R_MOD_DIR=${R_MOD_DIR} |
42 |
WRKSRC?= ${WRKDIR}/${PORTNAME} |
43 |
|
44 |
NO_BUILD= yes |
45 |
R_COMMAND= ${LOCALBASE}/bin/R |
46 |
|
47 |
.if !target(regression-test) |
48 |
R_POSTCMD_CHECK_OPTIONS?= --timings |
49 |
|
50 |
.if !exists(${LOCALBASE}/bin/pdflatex) |
51 |
R_POSTCMD_CHECK_OPTIONS+= --no-manual --no-rebuild-vignettes |
52 |
.endif |
53 |
|
54 |
.if defined(NO_STAGE) |
55 |
check-makevars:: |
56 |
@${ECHO_MSG} "Makefile error: USE_R_MOD cannot be used with NO_STAGE" |
57 |
@${FALSE} |
58 |
.endif |
59 |
|
60 |
regression-test: build |
61 |
@cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} _R_CHECK_FORCE_SUGGESTS_=FALSE \ |
62 |
${R_COMMAND} ${R_PRECMD_CHECK_OPTIONS} CMD check \ |
63 |
${R_POSTCMD_CHECK_OPTIONS} ${PORTNAME} |
64 |
.endif |
65 |
|
66 |
.if !target(do-install) |
67 |
R_POSTCMD_INSTALL_OPTIONS+= -l ${STAGEDIR}${PREFIX}/${R_LIB_DIR} |
68 |
.if defined(NOPORTDATA) |
69 |
R_POSTCMD_INSTALL_OPTIONS+= --no-data --no-demo |
70 |
.else |
71 |
R_POSTCMD_INSTALL_OPTIONS+= --install-tests |
72 |
.endif |
73 |
|
74 |
.if defined(NOPORTDOCS) |
75 |
R_POSTCMD_INSTALL_OPTIONS+= --no-docs --no-html |
76 |
.endif |
77 |
|
78 |
do-install: |
79 |
@${MKDIR} ${STAGEDIR}${PREFIX}/${R_LIB_DIR} |
80 |
@cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} ${R_COMMAND} \ |
81 |
${R_PRECMD_INSTALL_OPTIONS} CMD INSTALL \ |
82 |
${R_POSTCMD_INSTALL_OPTIONS} ${PORTNAME} |
83 |
.endif |
84 |
|
85 |
.if ${cran_ARGS:Mauto-plist} |
86 |
.if !target(post-install-script) |
87 |
post-install-script: |
88 |
@${FIND} -ds ${STAGEDIR}${PREFIX}/${R_MOD_DIR} \( -type f -or -type l \) -print | \ |
89 |
${SED} -E -e 's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} |
90 |
@${FIND} -ds ${STAGEDIR}${PREFIX}/${R_MOD_DIR} -type d -print | ${SED} -E -e \ |
91 |
's,^${STAGEDIR}${PREFIX}/?,@dirrm ,' >> ${TMPPLIST} |
92 |
.endif |
93 |
.endif |
94 |
|
95 |
.endif #_INCLUDE_USES_CRAN_MK |