#!/bin/bash
# This file has been auto-generated by the soa script.
eval "`grep '^REQUIRED=\|^OPTIONAL=' DEPS.txt`"
REQ="$REQUIRED"
OPT="$OPTIONAL"
shopt -q nullglob || resetnullglob=1
shopt -s nullglob
shopt -q dotglob || resetdotglob=1
shopt -s dotglob
echo "[1mPerforming local resolution... [m"
mkdir -p deps/bin
mkdir -p deps/lib
mkdir -p deps/include
mkdir -p deps/scripts
mkdir -p deps/python
for P in $REQ $OPT; do
	echo "[1mImporting from $P ...[m"
	files=(../$P/dist/bin/*);
	[ "$files" ] && cp -a ../$P/dist/bin/* deps/bin/
	files=(../$P/dist/lib/*);
	[ "$files" ] && cp -a ../$P/dist/lib/* deps/lib/
	files=(../$P/dist/include/*);
	[ "$files" ] && cp -a ../$P/dist/include/* deps/include/
	files=(../$P/dist/scripts/*);
	[ "$files" ] && cp -a ../$P/dist/scripts/* deps/scripts/
	files=(../$P/dist/python/*.zip);
	[ "$files" ] && for zipfile in ../$P/dist/python/*.zip; do
		unzip -oqq $zipfile -d deps/python
	done
	files=(../$P/dist/*.cpp.zip);
	[ "$files" ] && for zipfile in ../$P/dist/*.cpp.zip; do
		unzip -oqq $zipfile -d deps/
	done
	files=(../$P/dist/*.py.zip);
	[ "$files" ] && for zipfile in ../$P/dist/*.py.zip; do
		unzip -oqq $zipfile -d deps/python
	done
	files=(../$P/dist/*.scripts.zip);
	[ "$files" ] && for zipfile in ../$P/dist/*.scripts.zip; do
		unzip -oqq $zipfile -d deps/scripts
	done
	chmod -R +x deps/bin
	chmod -R +x deps/scripts
done
echo "[1mDone.[m"
[ "$resetdotglob" ] && shopt -u dotglob
[ "$resetnullglob" ] && shopt -u nullglob  
