-
Notifications
You must be signed in to change notification settings - Fork 47
/
mkdist
executable file
·48 lines (38 loc) · 1.1 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
#!/bin/sh
PNAME=RJDBC
SWD=`pwd`
echo "Removing previous dist ..."
rm -rf "/tmp/${PNAME}"
echo "Copying package base ..."
cp -r "../${PNAME}" /tmp
cd "/tmp/${PNAME}"
echo "Removing CVS and backup stuff ..."
find . -name CVS -o -name .svn | xargs rm -rf
find . -name \*~ | xargs rm -f
rm -rf "/tmp/${PNAME}"/.git*
mkdir -p inst/java
for jtarget in 1.4 1.6 1.8; do
echo " - Attempting to compile for Java $jtarget ..."
if javac -d inst/java -source $jtarget -target $jtarget java/*.java; then
(cd inst/java; jar fvc RJDBC.jar info; rm -rf info)
break
fi
done
if test ! -e inst/java/RJDBC.jar; then
echo "*** ERROR: could not compile Java sources! We need working JDK!"
exit 1
fi
echo "Updating version ..."
VER=`./version`
echo "$PNAME version ${VER}"
#cat DESCRIPTION| sed "s/Version:.*/Version: ${VER}/" > d
#mv d DESCRIPTION
rm -f "/tmp/${PNAME}/mkdist" "/tmp/${PNAME}/version" "/tmp/${PNAME}/test.sh" "/tmp/${PNAME}/README.md"
echo "Creating package ..."
cd ..
R CMD build "${PNAME}"
cd ${SWD}
cp /tmp/${PNAME}_${VER}.tar.gz ..
rm -rf /tmp/${PNAME}
echo "Done."
ls -l ../${PNAME}_${VER}.tar.gz