The R Project SVN R-packages

Rev

Rev 4421 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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