build: install bash and zsh completions

This commit is contained in:
William Hubbs 2021-09-07 12:45:53 -05:00
parent 593be166d1
commit 7c29fbd36f
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,10 @@
bash_completions = [
'openrc',
'openrc-service-script',
'rc-service',
'rc-status',
'rc-update',
]
install_data(bash_completions,
install_dir : get_option('datadir') / 'bash-completion/completions')

View File

@ -156,6 +156,9 @@ init_d_conf_data.set('SYSCONFDIR', get_option('sysconfdir'))
dl_dep = cc.find_library('dl', required: false)
util_dep = cc.find_library('util', required: false)
if get_option('bash-completions')
subdir('bash-completion')
endif
subdir('conf.d')
subdir('etc')
subdir('init.d')
@ -169,6 +172,9 @@ subdir('sh')
subdir('src')
subdir('support')
subdir('sysctl.d')
if get_option('zsh-completions')
subdir('zsh-completion')
endif
meson.add_install_script('tools/meson_runlevels.sh',
os,

View File

@ -1,5 +1,7 @@
option('audit', type : 'feature', value : 'auto',
description : 'enable libaudit support')
option('bash-completions', type : 'boolean',
description : 'install bash completions')
option('branding', type : 'string',
description : 'Add branding to OpenRC')
option('local_prefix', type : 'string', value : '/usr/local',
@ -31,3 +33,5 @@ option('termcap', type : 'combo',
choices :
[ '', 'ncurses', 'termcap' ],
description : 'the termcap library to use')
option('zsh-completions', type : 'boolean',
description : 'install zsh completions')

View File

@ -0,0 +1,9 @@
zsh_completions = [
'_openrc',
'_rc-service',
'_rc-status',
'_rc-update',
]
install_data(zsh_completions,
install_dir : get_option('datadir') / 'zsh/site-functions')