#!/bin/bash
 
set -e
set -x
 
apt-get update --allow-releaseinfo-change > /dev/null 2>&1
 
apt-get install -y build-essential zlib1g-dev libgif-dev > /dev/null 2>&1
 
wget -P /tmp http://www.ijg.org/files/jpegsrc.v8.tar.gz
cd /tmp && tar -zxf jpegsrc.v8.tar.gz > /dev/null 2>&1
cd /tmp/jpeg-8 && ./configure && make && make install
 
wget -P /tmp http://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz
cd /tmp && tar -zxf freetype-2.10.1.tar.gz > /dev/null 2>&1
cd /tmp/freetype-2.10.1
rm -f config.cache
ranlib /usr/local/lib/libjpeg.a
ldconfig /usr/local/lib
LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
make && make install
 
cd /tmp && git clone https://gitlab.com/tikiwiki/libraries/forks/swftools.git
cd /tmp/swftools
LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
make || make && make install
 
echo "Dependency setup complete"