-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bash
More file actions
executable file
·50 lines (39 loc) · 962 Bytes
/
build.bash
File metadata and controls
executable file
·50 lines (39 loc) · 962 Bytes
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
#!/bin/bash
# Bash script to build the rtrim R package
# version 1: Mark van der Loo
# version 2: Patrick Bogaart
# - added generation of install script
R=R
CHECKARG="--as-cran"
while [ $# -gt 0 ] ; do
case "$1" in
-dev)
R=Rdev
shift 1 ;;
*)
CHECKARG="$CHECKARG $1"
shift 1 ;;
esac
done
echo "######## Removing building information..."
rm -rf output
echo "######## Generate documentation..."
$R -q -f roxygen.R
echo "######## Building package in output..."
mkdir output
cd output
$R CMD build ../pkg
echo "######## Testing package with $CHECKARG ..."
for x in *.tar.gz
do
$R CMD check $CHECKARG $x
done
echo "######## Creating installation script..."
TARGET=install.R
PRE="install.packages(\""
TGZ=$(eval ls -1 *.tar.gz | head -1)
POST="\", repos=NULL, type=\"source\")"
echo "# R script to install rtrim package from source" > $TARGET
echo $PRE$TGZ$POST >> $TARGET
echo "**BUILT USING $R"
$R --version