Skip to content

Instantly share code, notes, and snippets.

@Ch00k
Created August 12, 2013 08:10
Show Gist options
  • Save Ch00k/6209010 to your computer and use it in GitHub Desktop.
Save Ch00k/6209010 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
requirements_solaris_lib_installed()
{
pkg info "$1" >/dev/null 2>&1 || return $?
}
requirements_solaris_libs_install()
{
__rvm_try_sudo pkg install "$@" || return $?
}
requirements_solaris_update_system()
{
__rvm_try_sudo pkg refresh && __rvm_try_sudo pkg update ||
{
typeset ret=$?
case $ret in
(4) return 0 ;; # means nothing to install
esac
return $ret
}
}
requirements_solaris_install_libyaml()
{
# noask (this file should be created somewhere and then passed to pkgadd to make it non-interactive)
echo -e "mail=\ninstance=overwrite\npartial=nocheck\nrunlevel=nocheck\nidepend=nocheck\nrdepend=nocheck\nspace=nocheck\nsetuid=nocheck\nconflict=nocheck\naction=nocheck\nbasedir=default\n" > $rvm_path/tmp/noask
# Install OperCSW repo
__rvm_try_sudo pkgadd -a $rvm_path/tmp/noask -d http://get.opencsw.org/now 'CSWpkgutil' > /dev/null 2>&1
# Install libyaml (from unstable branch)
__rvm_try_sudo /opt/csw/bin/pkgutil -i -y libyaml -t http://mirror.opencsw.org/opencsw/unstable > /dev/null 2>&1
}
requirements_solaris_define()
{
case "$1" in
(rvm)
requirements_check bash curl git text/gnu-patch
;;
(jruby-head*)
requirements_check jdk apache-ant git
;;
(jruby*)
requirements_check jdk
;;
(ir*)
requirements_check mono
;;
(opal)
requirements_check node-devel
;;
(*-head)
requirements_check text/gnu-patch developer/gcc-45 system/header system/library/math/header-math file/gnu-coreutils git
;;
(*)
requirements_check text/gnu-patch developer/gcc-45 system/header system/library/math file/gnu-coreutils
;;
esac
packages_custom+=( libyaml )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment