File: get_waf.sh

package info (click to toggle)
aubio 0.4.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,720 kB
  • sloc: python: 20,447; ansic: 20,127; makefile: 348; sh: 232
file content (54 lines) | stat: -rwxr-xr-x 996 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash

set -e
#set -x

WAFVERSION=2.0.14
WAFTARBALL=waf-$WAFVERSION.tar.bz2
WAFURL=https://waf.io/$WAFTARBALL
WAFUPSTREAMKEY=https://gitlab.com/ita1024/waf/raw/master/utils/pubkey.asc

WAFBUILDDIR=`mktemp -d`

function cleanup () {
  rm -rf $WAFBUILDDIR
}

trap cleanup SIGINT SIGTERM

function download () {
  ( [[ -n `which wget` ]] && wget -qO $1 $2 ) || ( [[ -n `which curl` ]] && curl -so $1 $2 )
}

function checkwaf () {
  download $WAFTARBALL.asc $WAFURL.asc
  if [[ -z `which gpg` ]]
  then
    echo "Warning: gpg not found, not verifying signature for $WAFTARBALL"
  else
    download - $WAFUPSTREAMKEY | gpg --import
    gpg --verify $WAFTARBALL.asc || exit 1
  fi
}

function fetchwaf () {
  download $WAFTARBALL $WAFURL
  checkwaf
}

function buildwaf () {
  tar xf $WAFTARBALL
  pushd waf-$WAFVERSION
  NOCLIMB=1 python waf-light --tools=c_emscripten $*
  popd
}

pushd $WAFBUILDDIR
fetchwaf
buildwaf
popd

cp -prv $WAFBUILDDIR/waf-$WAFVERSION/waf $PWD
chmod +x waf

cleanup