mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-09 09:19:09 +02:00
add systemd unit install logic
This commit is contained in:
parent
8b4fd0f907
commit
588e3aa0de
4 changed files with 31 additions and 3 deletions
|
|
@ -11,6 +11,7 @@ m_dep = cc.find_library('m', required : false)
|
|||
|
||||
subdir('src')
|
||||
subdir('doc')
|
||||
subdir('services')
|
||||
|
||||
executable('espeakup',
|
||||
espeakup_sources,
|
||||
|
|
|
|||
4
services/meson.build
Normal file
4
services/meson.build
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
systemd = dependency('systemd', required: false)
|
||||
if systemd.found()
|
||||
subdir('systemd')
|
||||
endif
|
||||
|
|
@ -6,10 +6,10 @@ After=systemd-udev-settle.service sound.target
|
|||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=/etc/conf.d/espeakup
|
||||
EnvironmentFile=@sysconfdir@/conf.d/espeakup.conf
|
||||
PIDFile=/run/espeakup.pid
|
||||
ExecStartPre=+/sbin/modprobe speakup_soft
|
||||
ExecStart=/usr/bin/espeakup --default-voice=${default_voice}
|
||||
ExecStartPre=+modprobe speakup_soft
|
||||
ExecStart=@bindir@/espeakup --default-voice=${default_voice}
|
||||
ExecReload=kill -HUP $MAINPID
|
||||
Restart=always
|
||||
|
||||
23
services/systemd/meson.build
Normal file
23
services/systemd/meson.build
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
|
||||
prefixdir = get_option('prefix')
|
||||
bindir = join_paths(prefixdir, get_option('bindir'))
|
||||
sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
|
||||
|
||||
unit_conf = configuration_data()
|
||||
|
||||
unit_conf.set('bindir', bindir)
|
||||
unit_conf.set('sysconfdir', sysconfdir)
|
||||
|
||||
service_file = configure_file(
|
||||
input : 'espeakup.service.in',
|
||||
output : 'espeakup.service',
|
||||
configuration : unit_conf
|
||||
)
|
||||
|
||||
install_data(service_file,
|
||||
install_dir : unitdir
|
||||
)
|
||||
|
||||
install_data('espeakup.conf',
|
||||
install_dir : join_paths(sysconfdir, 'conf.d')
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue