38 lines
1.0 KiB
Bash
38 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
function install_deps_ubuntu {
|
|
|
|
local PHP_BINARY="$(which php)"
|
|
local PACKAGES=""
|
|
if [ -z $PHP_BINARY ]; then
|
|
debug "PHP Version: None"
|
|
PACKAGES="php-cli $PACKAGES"
|
|
else
|
|
debug "PHP Version: $(php --version | head -n1 | cut -d' ' -f2)"
|
|
fi
|
|
|
|
local PHPDEV_STATE="$(dpkg --get-selections | grep php-dev | awk '{ print $2 }')"
|
|
if [ "$PHPDEV_STATE" != "install" ]; then
|
|
PACKAGES="php-dev $PACKAGES"
|
|
fi
|
|
|
|
local PHPPEAR_STATE="$(dpkg --get-selections | grep php-pear | awk '{ print $2 }')"
|
|
if [ "$PHPPEAR_STATE" != "install" ]; then
|
|
PACKAGES="php-pear $PACKAGES"
|
|
fi
|
|
|
|
local GPGME_STATE="$(dpkg --get-selections | grep libgpgme11-dev | awk '{ print $2 }')"
|
|
if [ "$GPGME_STATE" != "install" ]; then
|
|
PACKAGES="libgpgme11-dev $PACKAGES"
|
|
fi
|
|
|
|
if [ -z "$PACKAGES" ]; then
|
|
debug "All required packages are already installed"
|
|
else
|
|
exec "sudo apt -qq -y install $PACKAGES"
|
|
fi
|
|
|
|
}
|
|
|
|
install_deps_ubuntu
|