summaryrefslogtreecommitdiff
path: root/stwcs/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'stwcs/build.sh')
-rw-r--r--stwcs/build.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/stwcs/build.sh b/stwcs/build.sh
new file mode 100644
index 0000000..92417fa
--- /dev/null
+++ b/stwcs/build.sh
@@ -0,0 +1,30 @@
+
+function get_py_version() {
+python --version 2>&1| awk '{sub(/-.*/,"",$2);print $2}'
+}
+export -f get_py_version
+
+function set_py3k() {
+version=`get_py_version`
+major=`echo $version | cut -d '.' -f 1`
+minor=`echo $version | cut -d '.' -f 2`
+hotfix=`echo $version | cut -d '.' -f 3`
+if (( major > 2 )); then
+export PY3K=1
+else
+export PY3K=0
+fi
+}
+export -f set_py3k
+
+set_py3k
+
+
+pip install --no-deps --upgrade --force d2to1
+
+sed -i -e "s|use_2to3=True|use_2to3=False|" setup.py
+if [ $PY3K -ne 0 ] ; then
+sed -i -e "s|stsci.distutils.hooks.tag_svn_revision|#removed|" setup.cfg
+fi
+
+python setup.py install || exit 1 \ No newline at end of file