source: ThirdParty/Glpk/trunk/get.Glpk @ 2595

Last change on this file since 2595 was 2558, checked in by stefan, 8 years ago

use fetch instead of wget on FreeBSD (patch contributed by Pedro F. Giffuni)

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