-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup
executable file
·63 lines (52 loc) · 1.33 KB
/
setup
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
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
if [ ! -n "${RMFILE}" ]; then
RMFILE="$(command -v rm) -rf"
fi
if [ ! -n "${PYTHON}" ]; then
PYTHON="$(command -v python)"
fi
if [ ! -n "${MKDIR}" ]; then
MKDIR="$(command -v mkdir) -v"
fi
if [ ! -n "${INSTALL}" ]; then
INSTALL="$(command -v install) -v -c"
fi
if [ ! -n "${PREFIX}" ]; then
PREFIX=$(${PYTHON} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib());")
fi
printandrun() {
echo ${1}
eval ${1}
}
testandcreatedir() {
printandrun "test -z \"${1}\" || ${MKDIR} -p \"${1}\""
}
installpyfiles() {
printandrun "${INSTALL} \"${1}\" \"${2}\""
}
buildwithpy() {
printandrun "${PYTHON} -m compileall \"${PREFIX}/${1}\""
printandrun "${PYTHON} -O -m compileall \"${PREFIX}/${1}\""
}
OLDCWD="$(pwd)"
echo "Installing Python Moudle upcean";
echo "Checking for Python Moudle PIL"
${PYTHON} -c "import PIL"
if [ "$?" -ne "0" ]; then
echo "Sorry could not find Python Moudle PIL";
exit 0;
fi
echo "Checking for Python Moudle ReadLine"
${PYTHON} -c "import readline"
if [ "$?" -ne "0" ]; then
echo "Sorry could not find Python Moudle ReadLine";
exit 0;
fi
testandcreatedir "${PREFIX}/upcean"
for f in ./upcean/*; do
installpyfiles "${f}" "${PREFIX}/upcean/$(basename ${f})"
done
printandrun "cd \"${PREFIX}\""
buildwithpy "upcean"
printandrun "cd \"${OLDCWD}\""
echo "Finished installing Python Moudle upcean";