#!/bin/bash # Based on https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87 set -e # Installing dependencies apt-get -q -y install build-essential automake libtool git buildDir="/tmp/sass-build" version="3.2.5" prefix="/usr/local" sources=(libsass sassc) export SASS_LIBSASS_PATH="$buildDir/libsass" if [ -d "$buildDir" ]; then rm -rf "$buildDir"; fi # Create build dir inside /tmp echo "Creating build directory ($buildDir)" mkdir "$buildDir" cd $buildDir for src in "${sources[@]}"; do echo "[$src] Cloning repository" git clone -q https://github.com/sass/$src --branch $version --depth 1 > /dev/null 2>&1 && cd $src echo "[$src] Creating configuration" autoreconf --force --install > /dev/null 2>&1 echo "[$src] Configuring compiler" ./configure --enable-shared --prefix=$prefix > /dev/null 2>&1 echo "[$src] Compiling installer" make > /dev/null 2>&1 echo "[$src] Installing " make install > /dev/null 2>&1 echo "[$src] Done" cd .. done rm -rf "$buildDir" echo "Everything is done"