add systemd

This commit is contained in:
Chris Cromer 2020-08-05 23:18:39 -04:00
parent 28480a6de2
commit d19f8bcffa
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
7 changed files with 33 additions and 1 deletions

View File

@ -1 +1,2 @@
subdir('openrc')
subdir('systemd')

View File

@ -1,3 +1,5 @@
openrc = get_option('openrc')
openrc_config_data = configuration_data()
openrc_config_data.set('SBINDIR', join_paths(get_option('prefix'), get_option('sbindir')))
openrc_config_data.set('LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name()))

View File

@ -0,0 +1,17 @@
systemd = get_option('systemd')
systemd_config_data = configuration_data()
systemd_config_data.set('LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name()))
systemd_config_data_file = configure_file(
input: 'tufmanager.service.in',
output: 'tufmanager.service',
configuration: systemd_config_data
)
if systemd
install_data(
systemd_config_data_file,
install_dir: join_paths(get_option('prefix'), 'lib', 'systemd', 'system')
)
endif

View File

@ -0,0 +1,6 @@
[Unit]
Description=TUF Manager Server
[Service]
Type=forking
ExecStart=@LIBEXECDIR@/tuf-server

View File

@ -2,3 +2,4 @@
Name=org.tuf.manager.server
Exec=@LIBEXECDIR@/tuf-server
User=root
SystemdService=tufmanager.service

View File

@ -21,7 +21,6 @@ add_global_arguments(
always_authenticated = get_option('always-authenticated')
build_cli = get_option('build-cli')
build_gui = get_option('build-gui')
openrc = get_option('openrc')
subdir('po')
subdir('data')

View File

@ -34,3 +34,9 @@ option(
value: false,
description: 'Install OpenRC script'
)
option(
'systemd',
type : 'boolean',
value: false,
description: 'Install systemd unit'
)