~jan.greis/maus/1811

« back to all changes in this revision

Viewing changes to third_party/bash/12setuptools.bash

Try validictory for json schema validation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
directory=setuptools-0.6c11
 
4
filename=${directory}-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
 
5
url=http://pypi.python.org/packages/2.7/s/setuptools/${filename}
 
6
 
 
7
my_prefix=/install
 
8
my_destdir=${MAUS_ROOT_DIR}/third_party
 
9
 
 
10
if [ -n "${MAUS_ROOT_DIR+x}" ]; then
 
11
 
 
12
    if [ -e "${MAUS_ROOT_DIR}/third_party/source/${filename}" ]
 
13
    then
 
14
        echo "INFO: Found source archive in 'source' directory"
 
15
    else
 
16
        echo "INFO: Source archive doesn't exist.  Downloading..."
 
17
 
 
18
        wget --directory-prefix="${MAUS_ROOT_DIR}/third_party/source" ${url}
 
19
    fi
 
20
 
 
21
    if [ -e "${MAUS_ROOT_DIR}/third_party/source/${filename}" ]
 
22
    then
 
23
        echo "INFO: Source archive exists."
 
24
        echo
 
25
        echo "INFO: Checking MD5 checksum (otherwise the file didn't"
 
26
        echo "INFO: download properly):"
 
27
        echo
 
28
        cd "${MAUS_ROOT_DIR}/third_party/source"
 
29
        md5sum -c ${filename}.md5 || { echo "FATAL: Failed to download:" >&2; echo "FATAL: ${filename}." >&2; echo "FATAL: MD5 checksum failed.">&2; echo "FATAL: Try rerunning this command to redownload, or check" >&2; echo "FATAL: internet connection"  >&2; rm -f ${filename}; exit 1; }
 
30
        sleep 1
 
31
        echo
 
32
        echo "INFO: Building:"
 
33
        echo
 
34
        sh setuptools_0.6c11-py2.7.egg
 
35
    fi
 
36
 
 
37
else
 
38
    echo
 
39
    echo "FATAL: MAUS_ROOT_DIR is not set, which is required to" >&2
 
40
    echo "FATAL: know where to install this package.  You have two" >&2
 
41
    echo "FATAL: options:" >&2
 
42
    echo "FATAL:" >&2
 
43
    echo "FATAL: 1. Set the MAUS_ROOT_DIR from the command line by" >&2
 
44
    echo "FATAL: (if XXX is the directory where MAUS is installed):" >&2
 
45
    echo "FATAL:" >&2
 
46
    echo "FATAL:        MAUS_ROOT_DIR=XXX ${0}" >&2
 
47
    echo "FATAL:" >&2
 
48
    echo "FATAL: 2. Run the './configure' script in the MAUS ROOT" >&2
 
49
    echo "FATAL: directory, run 'source env.sh' then rerun this" >&2
 
50
    echo "FATAL: command ">&2
 
51
    exit 1
 
52
fi