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