Files
Fortran-docker-mvc/install_deps_ubu.sh
Tommy Parnell a7037b9e92 init
2017-02-20 16:06:45 -05:00

26 lines
476 B
Bash

#!/bin/bash
pkg_status()
{
state=$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | awk '{ print $1 }')
[ "$state" = install ] && return 0 || return 1
}
ensure_install()
{
local pkg
for pkg in "$@"
do
printf "Checking $pkg"
if ! pkg_status $pkg >/dev/null
then
apt-get install -y $pkg
fi
echo
done
}
apt-get update
ensure_install gfortran make sqlite3 libsqlite3-dev nginx libfcgi-dev spawn-fcgi