diff --git a/meson.build b/meson.build index 4974d28..e8969cc 100644 --- a/meson.build +++ b/meson.build @@ -1,8 +1,14 @@ # Project definition -project('zlevis', license: 'GPL3', version: '2.3') +project('zlevis', license: 'GPL3') -# Define bin dir -bin_dir = join_paths(get_option('prefix'), get_option('bindir')) +# Define bindir +bindir = join_paths(get_option('prefix'), get_option('bindir')) + +# Define bins list +bins = [] # Define subdir with bins subdir('src') + +# Install bins in bindir +install_data(bins, install_dir: bindir) diff --git a/src/meson.build b/src/meson.build index a7fbadc..09c3d2c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,14 +1,14 @@ -# Find the scripts -frontend = find_program('zlevis.in') -encrypt = find_program('zlevis-encrypt.in') -decrypt = find_program('zlevis-decrypt.in') +# Find scripts +main = find_program('zlevis') +encrypt = find_program('zlevis-encrypt') +decrypt = find_program('zlevis-decrypt') # Test the scripts -test('zlevis', frontend, args: '--summary') +test('zlevis', main, args: '--summary') test('zlevis-encrypt', encrypt, args: '--summary') test('zlevis-decrypt', decrypt, args: '--summary') -# Configure the scripts -configure_file(input: 'zlevis.in', output: 'zlevis', configuration: {'VERSION': meson.project_version()}, install: true, install_dir: bin_dir) -configure_file(input: 'zlevis-encrypt.in', output: 'zlevis-encrypt', configuration: {'VERSION': meson.project_version()}, install: true, install_dir: bin_dir) -configure_file(input: 'zlevis-decrypt.in', output: 'zlevis-decrypt', configuration: {'VERSION': meson.project_version()}, install: true, install_dir: bin_dir) +# Add paths of scripts to bins +bins += join_paths(meson.current_source_dir(), 'zlevis') +bins += join_paths(meson.current_source_dir(), 'zlevis-encrypt') +bins += join_paths(meson.current_source_dir(), 'zlevis-decrypt') \ No newline at end of file diff --git a/src/zlevis.in b/src/zlevis similarity index 89% rename from src/zlevis.in rename to src/zlevis index 33ccb49..34acddc 100755 --- a/src/zlevis.in +++ b/src/zlevis @@ -3,24 +3,15 @@ # Exit immediately if a command exits with a non-zero status set -e -# Summary of the functionality of zlevis +# Summary of the script's functionality summary="A tool that enables automatic decryption of ZFS rpools with TPM2" -# Version of zlevis -version="@VERSION@" - # Display summary if requested if [ "$1" = "--summary" ]; then echo "$summary" exit 0 fi -# Display version if requested -if [ "$1" = "--version" ]; then - echo "$version" - exit 0 -fi - # Function to display usage information of zlevis info() { exec >&2 @@ -57,4 +48,4 @@ else fi # Exit with the status of the last command -exit $? +exit $? \ No newline at end of file diff --git a/src/zlevis-decrypt.in b/src/zlevis-decrypt similarity index 94% rename from src/zlevis-decrypt.in rename to src/zlevis-decrypt index c5a4211..7cac845 100755 --- a/src/zlevis-decrypt.in +++ b/src/zlevis-decrypt @@ -3,13 +3,10 @@ # Exit immediately if a command exits with a non-zero status set -e -# Summary of the functionality of zlevis-decrypt +# Summary of the script's functionality summary="Decrypts a JWE using a TPM2.0 chip" -# Version of zlevis -version="@VERSION@" - -# TPM2.0 owner hierarchy to be used by the operating system +# TPM2.0 owner hierarchy to be used by the Operating System auth="o" # Display summary if requested @@ -18,12 +15,6 @@ if [ "$1" = "--summary" ]; then exit 0 fi -# Display version if requested -if [ "$1" = "--version" ]; then - echo "$version" - exit 0 -fi - # Display usage information if input is from a terminal if [ -t 0 ]; then exec >&2 diff --git a/src/zlevis-encrypt.in b/src/zlevis-encrypt similarity index 97% rename from src/zlevis-encrypt.in rename to src/zlevis-encrypt index fc8503e..6700bbe 100755 --- a/src/zlevis-encrypt.in +++ b/src/zlevis-encrypt @@ -3,12 +3,9 @@ # Exit immediately if a command exits with a non-zero status set -e -# Summary of the functionality of zlevis-encrypt +# Summary of the script's functionality summary="Encrypts using a TPM2.0 chip binding policy" -# Version of zlevis -version="@VERSION@" - # TPM2.0 owner hierarchy to be used by the Operating System auth="o" @@ -21,12 +18,6 @@ if [ "$1" = "--summary" ]; then exit 0 fi -# Display version if requested -if [ "$1" = "--version" ]; then - echo "$version" - exit 0 -fi - # Display usage information if input is from a terminal if [ -t 0 ]; then exec >&2