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