http-redirect: add meson build
Install the minimal http-redirection awk script.
Also, install systemd socket and service files.
Change-Id: I44e6365a8a48f82e62f9f348c91b165cf3b5ce1e
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
diff --git a/http-redirect/meson.build b/http-redirect/meson.build
new file mode 100644
index 0000000..e73b4ae
--- /dev/null
+++ b/http-redirect/meson.build
@@ -0,0 +1,25 @@
+redirect = dependency('systemd', required: get_option('http-redirect'))
+
+
+if redirect.found()
+ install_data(
+ 'http-redirect.awk',
+ install_mode: 'rwxr-xr-x',
+ install_dir: get_option('bindir'),
+ )
+
+ configure_file(
+ input: 'http-redirect.socket',
+ output: 'http-redirct.socket',
+ copy: true,
+ install_dir:
+ redirect.get_pkgconfig_variable('systemdsystemunitdir'),
+ )
+ configure_file(
+ input: 'http-redirect@.service',
+ output: 'http-redirct@.service',
+ copy: true,
+ install_dir:
+ redirect.get_pkgconfig_variable('systemdsystemunitdir'),
+ )
+endif
diff --git a/meson.build b/meson.build
index 49736b5..5419464 100644
--- a/meson.build
+++ b/meson.build
@@ -5,3 +5,4 @@
)
subdir('firstboot')
+subdir('http-redirect')
diff --git a/meson_options.txt b/meson_options.txt
index af2e039..b9aade8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,6 @@
option(
'first-boot-set-hostname', type: 'feature', description: 'Set hostname on first boot.',
)
+option(
+ 'http-redirect', type: 'feature', description: 'Redirect http traffic to https.',
+)