#!/usr/bin/env bash

# install dependencies
apt-get -fyq install cmake libilmbase-dev libopenexr-dev libtiff5-dev

# create a temporary folder
mkdir /ampas

# download the aces_continer@1.0.2 source code
wget -qO- https://github.com/ampas/aces_container/archive/v1.0.2.tar.gz | tar xvz -C /ampas

# compile and build aces_container lib
cd /ampas/aces_container-1.0.2/
mkdir build && cd build
cmake ..
make
make install

# download the ctl@1.5.2 source code
wget -qO- https://github.com/ampas/CTL/archive/ctl-1.5.2.tar.gz | tar xvz -C /ampas
cd /ampas/CTL-ctl-1.5.2/

# compile and build
mkdir build && cd build
cmake ..
make
make install

# remove the temporary folder
rm -r /ampas
