-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-linux.sh
executable file
·43 lines (37 loc) · 1.14 KB
/
install-linux.sh
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
#!/bin/bash -ex
BIN_DIR=/usr/bin
SHARE_DIR=/usr/share
USER=root
GROUP=root
# install program files:
for BIN in alex alex-init alex-manual; do
install -o ${USER} -g ${GROUP} -m 0755 ${BIN} ${BIN_DIR}
done
if [ ! -d ${SHARE_DIR}/alex ]; then
mkdir -p ${SHARE_DIR}/alex
fi
# copy files to SHARE_DIR and set their permissions:
for FILE in README.md Examples Library; do
cp -r ${FILE} ${SHARE_DIR}/alex
chmod 0644 ${SHARE_DIR}/alex/${FILE}
chown ${USER}.${GROUP} ${SHARE_DIR}/alex/${FILE}
done
cd Docs
for FILE in AlexManual.pdf AlexManual.html Roadmap.md; do
cp -r ${FILE} ${SHARE_DIR}/alex
chmod 0644 ${SHARE_DIR}/alex/${FILE}
chown ${USER}.${GROUP} ${SHARE_DIR}/alex/${FILE}
done
cd -
# set ownership and permissions on all directories in SHARE_DIR:
for DIR in $(find ${SHARE_DIR}/alex -type d); do
chown ${USER}.${GROUP} ${DIR}
chmod 0755 ${DIR}
done
# create R package and install it
cd R
R -e 'if("devtools" %in% rownames(installed.packages()) == FALSE) { install.packages("devtools", repos="http://cran.rstudio.com") }'
R -e 'setwd("alex"); library(devtools); document()'
R CMD build alex
R CMD INSTALL alex_*.tar.gz
cd -