#!/bin/sh
-# DON'T USE YET, DRAFT
+# Ensure common schroot packages have been installed
+# ./install-hdl-apt-reqs
-mkdir -p /home/$USER/src
-cd /home/$USER/src
+if [ "$EUID" -ne 0 ]
+ then echo "Please run as root"
+ exit
+fi
+
+apt-get install -y default-jre-headless libncurses5 #libedit-dev
+
+mkdir -p /home/$SUDO_USER/src
+cd /home/$SUDO_USER/src
git clone https://gitlab.lip6.fr/vlsi-eda/tas-yagle.git
cd tas-yagle
./build.sh
+
+cd /home/$SUDO_USER/src
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .