diff --git a/contrib/meson.build b/contrib/meson.build index b8c4f5c..99977f9 100644 --- a/contrib/meson.build +++ b/contrib/meson.build @@ -1,2 +1,4 @@ subdir('openrc') +subdir('runit') +subdir('s6') subdir('systemd') diff --git a/contrib/runit/meson.build b/contrib/runit/meson.build new file mode 100644 index 0000000..7d02eb8 --- /dev/null +++ b/contrib/runit/meson.build @@ -0,0 +1,17 @@ +runit = get_option('runit') + +runit_config_data = configuration_data() +runit_config_data.set('LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name())) + +runit_config_data_file = configure_file( + input: 'run.in', + output: 'run', + configuration: runit_config_data +) + +if runit + install_data( + runit_config_data_file, + install_dir: join_paths(get_option('sysconfdir'), 'runit', 'sv', 'tufmanager') + ) +endif diff --git a/contrib/runit/run.in b/contrib/runit/run.in new file mode 100755 index 0000000..6fd976f --- /dev/null +++ b/contrib/runit/run.in @@ -0,0 +1,3 @@ +#!/bin/sh +sv check dbus >/dev/null || exit 1 +exec @LIBEXECDIR@/tuf-server -f diff --git a/contrib/s6/dependencies b/contrib/s6/dependencies new file mode 100644 index 0000000..e2182f1 --- /dev/null +++ b/contrib/s6/dependencies @@ -0,0 +1 @@ +dbus diff --git a/contrib/s6/meson.build b/contrib/s6/meson.build new file mode 100644 index 0000000..10519f7 --- /dev/null +++ b/contrib/s6/meson.build @@ -0,0 +1,17 @@ +s6 = get_option('s6') + +s6_config_data = configuration_data() +s6_config_data.set('LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name())) + +s6_config_data_file = configure_file( + input: 'run.in', + output: 'run', + configuration: s6_config_data +) + +if s6 + install_data( + [s6_config_data_file, 'type', 'dependencies'], + install_dir: join_paths(get_option('sysconfdir'), 's6', 'sv', 'tufmanager') + ) +endif diff --git a/contrib/s6/run.in b/contrib/s6/run.in new file mode 100644 index 0000000..2b650af --- /dev/null +++ b/contrib/s6/run.in @@ -0,0 +1,3 @@ +#!/usr/bin/execlineb -P +fdmove -c 2 1 +exec @LIBEXECDIR@/tuf-server -f diff --git a/contrib/s6/type b/contrib/s6/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/contrib/s6/type @@ -0,0 +1 @@ +longrun diff --git a/meson_options.txt b/meson_options.txt index dd2b918..14d1ab8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -34,6 +34,18 @@ option( value: false, description: 'Install OpenRC script' ) +option( + 'runit', + type : 'boolean', + value: false, + description: 'Install runit script' +) +option( + 's6', + type : 'boolean', + value: false, + description: 'Install s6 scripts' +) option( 'systemd', type : 'boolean',