Add ruby build configure options to rbenv module

- Allows you to pass in configure options to ruby build environment when
  building rubies via rbenv
This commit is contained in:
Brian Lanier 2014-01-07 10:34:24 -08:00
parent 87b25ed67a
commit 864f936046

View File

@ -19,6 +19,7 @@ __func_alias__ = {
__opts__ = { __opts__ = {
'rbenv.root': None, 'rbenv.root': None,
'rbenv.build_env': None,
} }
@ -163,8 +164,16 @@ def install_ruby(ruby, runas=None):
ruby = re.sub(r'^ruby-', '', ruby) ruby = re.sub(r'^ruby-', '', ruby)
env = None env = None
env_list = []
if __grains__['os'] in ('FreeBSD', 'NetBSD', 'OpenBSD'): if __grains__['os'] in ('FreeBSD', 'NetBSD', 'OpenBSD'):
env = 'MAKE=gmake' env_list.append('MAKE=gmake')
if __salt__['config.option']('rbenv.build_env'):
env_list.append(__salt__['config.option']('rbenv.build_env'))
if env_list:
env = ' '.join(env_list)
ret = {} ret = {}
ret = _rbenv_exec('install', ruby, env=env, runas=runas, ret=ret) ret = _rbenv_exec('install', ruby, env=env, runas=runas, ret=ret)