The R Project SVN R-packages

Rev

Rev 4421 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3418 maechler 1
#!/bin/sh
2
#
3
URL=http://www.cise.ufl.edu/research/sparse/CSparse
4
tarFile=CSparse.tar.gz
5
## subdirectory *inside* tar file:
6
sDir=CSparse/Source
4421 bates 7
iDir=CSparse/Include
3418 maechler 8
# ----------------- a "full path" for the current directory:
9
MatrixDir=`dirname $0`; cd $MatrixDir; MatrixDir=`pwd`
10
if [ -d $MatrixDir ]
11
then echo "Downloading into directory '$MatrixDir' .."
12
else echo "no directory '$MatrixDir' .. exiting"; exit 3
13
fi
14
cd $MatrixDir
15
#
16
wget $URL/$tarFile
17
#
18
if [ ! -r $tarFile ]; then echo "no file $tarFile .. exiting"; exit 1 ; fi
19
## extract only the part we want
4421 bates 20
tar zxf $tarFile $iDir
21
if [ ! -d $iDir ]; then echo "no directory $iDir .. exiting"; exit 2 ; fi
22
echo -n "Moving file from $iDir .. "
23
(cd $iDir && chmod a+r cs.h && mv  cs.h   $MatrixDir)
3418 maechler 24
tar zxf $tarFile $sDir
25
if [ ! -d $sDir ]; then echo "no directory $sDir .. exiting"; exit 2 ; fi
4421 bates 26
echo -n "cat'ing files from $sDir ..	 "
3418 maechler 27
cd $sDir
28
cat cs_*.c | sed -e '1 p' -e '/^#include/d' > $MatrixDir/cs.c
29
echo '[Ok]'
4421 bates 30
echo -n "cleaning up $iDir $sDir ..			 "
3418 maechler 31
## keep the [TAB]s here               ^^
32
cd $MatrixDir
4421 bates 33
rm -rf $tarFile $sDir $iDir
3418 maechler 34
rmdir `dirname $sDir`
35
echo '[Ok]'