forked from s-u/Rserve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdist
85 lines (72 loc) · 1.89 KB
/
mkdist
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
#!/bin/sh
SWD=`pwd`
echo "Removing previous dist ..."
rm -rf /tmp/Rserve.tmp
echo "Copying package base ..."
mkdir /tmp/Rserve.tmp
cp -r ../Rserve /tmp/Rserve.tmp
#touch /tmp/Rserve/src/dummy.so
rm -f /tmp/Rserve.tmp/Rserve/mkdist
cd /tmp/Rserve.tmp/Rserve
# mkdir inst
if [ -e configure ]; then
echo "Note: configure exists, no attempt to reconfigure will be made."
else
echo "Running autoconf ..."
aclocal
autoheader
autoconf
rm -rf autom4te* aclocal*
fi
echo "Removing CVS/SVN and backup stuff ..."
find . -name CVS -o -name \*~ -o -name .svn -o -name .git\*|xargs rm -rf
# copy header files so they are available to the client
cp src/Rsrv.h src/include/sisocks.h src/client/cxx/
if [ -e src/client/cxx/configure.ac ]; then
if [ ! -e src/client/cxx/configure ]; then
cd src/client/cxx
echo "Running autoconf in cxx..."
aclocal
autoheader
autoconf
rm -rf autom4te* aclocal*
cd /tmp/Rserve.tmp/Rserve
fi
fi
rm -rf clients
ln -s src/client clients
## currently remove the test directory
## since they need to be run by hand
## eventually we should have real unit tests...
rm -rf test
(cd src/client/java; make && make -C Rserve)
## install the Java client JARs
mkdir -p inst/java
mv src/client/java/*.jar inst/java/
# no INDEX since 1.8
#echo "Updating INDEX ..."
#cd ..
#R CMD Rdindex Rserve > Rserve/INDEX
#rm -f Rserve/INDEX
#cd Rserve
echo "Updating version ..."
VER=`./version`
echo "Rserve version ${VER}"
cat DESCRIPTION| sed "s/Version:.*/Version: ${VER}/" > d
mv d DESCRIPTION
echo "Creating package ..."
cd ..
# do NOT use build - it screws up symbolic links
#R CMD build --force Rserve
tar fcz Rserve_${VER}.tar.gz Rserve
cd ${SWD}
cp /tmp/Rserve.tmp/Rserve_${VER}.tar.gz ..
rm -rf /tmp/Rserve.tmp
echo "Done."
ls -l ../Rserve_${VER}.tar.gz
if [ "x$1" = x-i ]; then
R CMD INSTALL ../Rserve_${VER}.tar.gz
fi
if [ "x$1" = x-c ]; then
R CMD check $2 $3 $4 ../Rserve_${VER}.tar.gz
fi