File: install_all.sh

package info (click to toggle)
mdanalysis 2.9.0-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 115,708 kB
  • sloc: python: 86,757; ansic: 8,156; makefile: 215; sh: 138
file content (48 lines) | stat: -rwxr-xr-x 1,112 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
#!/bin/bash
# Oliver Beckstein 2014, Placed into the Public Domain
# run setup.py develop for package and tests
usage="$(basename $0) [options]

Run 'python setup.py' in the package and testsuite directory to install
the library and the unit tests.

By default does a standard 'install'. Use -d for a 'develop' installation
that uses the sources.

Options

-h       help
-d       develop install (MODE = develop)
-u       user install (setup.py MODE --user)
"

die () {
    local msg="$1" err="${2:-1}"
    echo 1>&2 "EE ERROR ($err): $msg"
    exit $err
}

setup_py () {
    local command="${1}" dir="$2" options="$3"
    pushd "$dir" || die "failed to cd to '$dir'" $?
    echo ">>     cd $dir"
    echo ">>     python setup.py ${command} ${options}"
    python setup.py ${command} ${options}
    popd
}

command="install"
options=""
while getopts hdu OPT; do
    case $OPT in 
	h) echo "$usage"; exit 0;;
	d) command="develop";;
	u) options="${options} --user";;
	'?') die "Unknown option. Try -h for help." 2;;
    esac
done

setup_py $command package "${options}"
setup_py $command testsuite "${options}"