summaryrefslogtreecommitdiff
path: root/build_cython.sh
blob: ceb7b9265c07b0a2cd1c450c4a9166ce00f494dd (plain) (blame)
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
#!/bin/bash
set -e
set -x

name="cython"
version="0.28.5"
tarball="${version}.tar.gz"
dest="${name}-${version}" # Ugh.
url="http://github.com/cython/${name}/archive/${tarball}"
export PATH_OLD="${PATH}"

if [[ ! $1 ]]; then
    echo No argument passed. Need a version.
    exit 1
fi
export py_dest="/opt/$1/bin"

function pre()
{
    export PATH="${py_dest}:${PATH_OLD}"

    curl -LO "${url}"
    tar xf "${tarball}"
}

function build()
{
    pre
    pushd "${dest}"
        python setup.py install
    popd
    post
}

function post()
{
    rm -rf "${dest}"
    rm -rf "${tarball}"
    echo "All done."
}

# Main
build