-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
37 lines (30 loc) · 1.2 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
project('tarpyt',
license: 'GPL3+',
version: '0.0.1',
meson_version: '>=1.1.0')
find_program('python3', version: '>=3.11', required: true)
dependency('libsystemd', version: '>=247', required: true)
systemd_install_dir = get_option('libdir') / 'systemd' / 'system'
# Templated out service files
config_data = {'bindir': get_option('prefix') / get_option('bindir')}
foreach protocol: ['ssh', 'http', 'smtp']
config_data += {'PROTOCOL': protocol}
configure_file(input: 'tarpyt@.socket.in',
output:'tarpyt-@0@@.socket'.format(protocol),
configuration: config_data,
install_dir: systemd_install_dir)
configure_file(input: 'tarpyt@.service.in',
output: 'tarpyt-@0@@.service'.format(protocol),
configuration: config_data,
install_dir: systemd_install_dir)
endforeach
install_data('tarpyt', install_dir: get_option('bindir'), install_mode: 'rwxr-xr-x')
# Testing
if get_option('enable_tests')
tarpyt = meson.current_source_dir() / meson.project_name()
find_program('curl')
find_program('ssh')
test('ssh', files('test' / 'test_ssh.sh'), args: [tarpyt])
test('http', files('test' / 'test_http.sh'), args: [tarpyt])
test('smtp', files('test' / 'test_smtp.sh'), args: [tarpyt])
endif