The R Project SVN R-packages

Rev

Rev 3418 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3418 Rev 4421
Line 2... Line 2...
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
# ----------------- a "full path" for the current directory:
8
# ----------------- a "full path" for the current directory:
8
MatrixDir=`dirname $0`; cd $MatrixDir; MatrixDir=`pwd`
9
MatrixDir=`dirname $0`; cd $MatrixDir; MatrixDir=`pwd`
9
if [ -d $MatrixDir ]
10
if [ -d $MatrixDir ]
10
then echo "Downloading into directory '$MatrixDir' .."
11
then echo "Downloading into directory '$MatrixDir' .."
11
else echo "no directory '$MatrixDir' .. exiting"; exit 3
12
else echo "no directory '$MatrixDir' .. exiting"; exit 3
Line 14... Line 15...
14
#
15
#
15
wget $URL/$tarFile
16
wget $URL/$tarFile
16
#
17
#
17
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
18
## extract only the part we want
19
## extract only the part we want
-
 
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)
19
tar zxf $tarFile $sDir
24
tar zxf $tarFile $sDir
20
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
21
echo -n "Moving and cat'ing files from $sDir ..	 "
26
echo -n "cat'ing files from $sDir ..	 "
22
cd $sDir
27
cd $sDir
23
chmod a+r cs.h
-
 
24
mv  cs.h   $MatrixDir
-
 
25
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
26
echo '[Ok]'
29
echo '[Ok]'
27
echo -n "cleaning up $sDir ..			 "
30
echo -n "cleaning up $iDir $sDir ..			 "
28
## keep the [TAB]s here               ^^
31
## keep the [TAB]s here               ^^
29
cd $MatrixDir
32
cd $MatrixDir
30
rm -rf $tarFile $sDir
33
rm -rf $tarFile $sDir $iDir
31
rmdir `dirname $sDir`
34
rmdir `dirname $sDir`
32
echo '[Ok]'
35
echo '[Ok]'