Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | set -e |
---|
4 | glpk_ver=4.22 |
---|
5 | |
---|
6 | wgetcmd=wget |
---|
7 | wgetcount=`which wget 2>/dev/null | wc -w` |
---|
8 | if test ! $wgetcount = 1; then |
---|
9 | echo "Utility wget not found in your PATH." |
---|
10 | if test `uname` = Darwin; then |
---|
11 | wgetcmd=ftp |
---|
12 | echo "Using ftp command instead." |
---|
13 | else |
---|
14 | exit -1 |
---|
15 | fi |
---|
16 | fi |
---|
17 | |
---|
18 | echo " " |
---|
19 | echo "Running script to download the source code for GLPK $glpk_ver." |
---|
20 | echo " " |
---|
21 | |
---|
22 | rm -f glpk*.tgz |
---|
23 | |
---|
24 | echo "Downloading the source code from ftp.gnu.org..." |
---|
25 | $wgetcmd ftp://ftp.gnu.org/gnu/glpk/glpk-${glpk_ver}.tar.gz |
---|
26 | |
---|
27 | echo "Uncompressing the tarball..." |
---|
28 | gunzip -f glpk-${glpk_ver}.tar.gz |
---|
29 | |
---|
30 | |
---|
31 | if test -d glpk ; then |
---|
32 | echo "Moving current glpk to glpk.OLD." |
---|
33 | if test -d glpk.OLD ; then |
---|
34 | rm -rf glpk.OLD |
---|
35 | fi |
---|
36 | mv glpk glpk.OLD |
---|
37 | fi |
---|
38 | |
---|
39 | echo "Unpacking the source code..." |
---|
40 | tar xf glpk-${glpk_ver}.tar |
---|
41 | |
---|
42 | echo "Deleting the tar file..." |
---|
43 | rm glpk-${glpk_ver}.tar |
---|
44 | |
---|
45 | mv glpk-${glpk_ver} glpk |
---|
46 | |
---|
47 | echo " " |
---|
48 | echo "Done downloading the source code for GLPK." |
---|
49 | echo " " |
---|
50 | |
---|
51 | echo " " |
---|
52 | echo "Verify that there are no error message in the output above." |
---|
Note: See
TracBrowser
for help on using the repository browser.