/
INSTALL.in
91 lines (76 loc) · 1.8 KB
/
INSTALL.in
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#! /bin/sh
# ${RHOME}/etc/INSTALL for installing add-on packages
# Usage:
# R INSTALL [-help/+help] [-html/+html] pkg [lib]
IHELP=y
IHTML=
if [ "$1" = "+help" ]; then shift; IHELP=y; fi
if [ "$1" = "-help" ]; then shift; IHELP=; fi
if [ "$1" = "+html" ]; then shift; IHTML=y; fi
if [ "$1" = "-html" ]; then shift; IHTML=; fi
# And obviously, we could play the same game with objs, libs and data
if [ "$1" ]
then
pkg=$1
test -d ${pkg} || ( echo "Package \`${pkg}' does not exist"; exit 1 )
else
echo "usage: R INSTALL <options> pkg [lib]" && exit 1
fi
lib=${2:-${RHOME}/library}
mkdir -p ${lib} || ( echo "Cannot write to \`${lib}'"; exit 1 )
lib=`cd ${lib}; pwd`
src=@LIBSRC@
cd ${pkg}
pkg=`basename ${pkg}`
echo "Installing package \`${pkg}' ..."
if test -d ${src}
then
echo "objs"
(cd ${src}; make CC="@CC@" CFLAGS="@CFLAGS@ @PICFLAGS@ -I${RHOME}/include" SHLIBLDFLAGS="@SHLIBLDFLAGS@" FC="@FC@" FFLAGS="@FFLAGS@ @FPICFLAGS@")
mkdir -p ${lib}/${pkg}/libs
cp ${src}/*.so ${lib}/${pkg}/libs
fi
if test -d R
then
echo "R"
mkdir -p ${lib}/${pkg}/R
cat R/[a-z]* > ${lib}/${pkg}/R/${pkg}
elif test -d funs
then
echo "funs"
mkdir -p ${lib}/${pkg}/R
cat funs/[a-z]* > ${lib}/${pkg}/R/${pkg}
fi
if test -d data
then
echo "data"
mkdir -p ${lib}/${pkg}/data
cp data/* ${lib}/${pkg}/data
fi
if test -d exec
then
echo "exec"
mkdir -p ${lib}/${pkg}/exec
cp exec/* ${lib}/${pkg}/exec
chmod 755 ${lib}/${pkg}/exec/*
fi
if [ "$IHELP" ]
then
echo "help"
${RHOME}/etc/build-help ../${pkg} ${lib}
fi
if [ "$IHTML" ]
then
echo "html"
${RHOME}/etc/build-html ../${pkg} ${lib}
fi
if [ -f INDEX ]
then
cp INDEX ${lib}/${pkg}
fi
if [ -f TITLE ]
then
cp TITLE ${lib}/${pkg}
fi
(cd ${lib}; cat */TITLE > LibIndex 2> /dev/null)
echo "DONE"