source: core/c/jbigi/download_gmp.sh @ e47c628

Last change on this file since e47c628 was e47c628, checked in by zzz <zzz@…>, 4 years ago

jbigi: Update GMP version (ticket #1840)

  • Property mode set to 100644
File size: 719 bytes
Line 
1#!/bin/sh
2
3export GMP_VER=6.1.2
4export GMP_TARVER=${GMP_VER}
5export GMP_DIR="gmp-$GMP_VER"
6export GMP_TAR="gmp-$GMP_TARVER.tar.bz2"
7
8
9download_tar()
10{
11  GMP_TAR_URL="https://gmplib.org/download/gmp/${GMP_TAR}"
12  if [ $(which wget) ]; then
13    echo "Downloading $GMP_TAR_URL"
14    wget -N --progress=dot $GMP_TAR_URL
15  else
16    echo "ERROR: Cannot find wget." >&2
17    echo >&2
18    echo "Please download $GMP_TAR_URL" >&2
19    echo "manually and rerun this script." >&2
20    exit 1
21  fi
22}
23
24extract_tar()
25{
26  tar -xjf ${GMP_TAR} > /dev/null 2>&1 || (rm -f ${GMP_TAR} && download_tar && extract_tar || exit 1)
27}
28
29if [ ! -d "$GMP_DIR" -a ! -e "$GMP_TAR" ]; then
30  download_tar
31fi
32
33if [ ! -d "$GMP_DIR" ]; then
34  extract_tar
35fi
Note: See TracBrowser for help on using the repository browser.