@@ -13,13 +13,10 @@ project(
1313
1414opencv_dep = dependency (' opencv4' , static : true )
1515
16- lib_dir = get_option (' libdir' ) / meson .project_name()
17- lib_bin_dir = lib_dir / ' bin'
18- sysconf_dir = get_option (' sysconfdir' )
19- autocomplete_dir = get_option (' datadir' ) / ' bash-completion/completions'
20- boot_service = get_option (' boot_service' )
21- systemd_dir = ' lib/systemd/system'
22- openrc_dir = ' /etc/init.d'
16+ ################
17+ # Lib executable
18+ ################
19+ lib_bin_dir = get_option (' bindir' ) / ' lib' + meson .project_name()
2320
2421executable (
2522 ' driver-generator' ,
@@ -44,6 +41,11 @@ executable(
4441 install_dir : lib_bin_dir,
4542)
4643
44+ #####
45+ # Lib
46+ #####
47+ lib_dir = get_option (' libdir' ) / meson .project_name()
48+
4749configure_version_data = configuration_data ({' version' : meson .project_version()})
4850configure_file (
4951 input : ' sources/linux-enable-ir-emitter.py' ,
@@ -54,14 +56,10 @@ configure_file(
5456 install_mode : ' rwxr-xr-x' ,
5557)
5658
57- install_symlink(
58- meson .project_name(),
59- pointing_to : ' ../' / lib_dir / ' linux-enable-ir-emitter.py' ,
60- install_dir : get_option (' bindir' ),
61- )
59+ boot_service = get_option (' boot_service' )
6260
6361configure_paths_data = configuration_data ({
64- ' SAVE_DRIVER_FOLDER_PATH' : sysconf_dir / meson .project_name(),
62+ ' SAVE_DRIVER_FOLDER_PATH' : get_option ( ' sysconfdir ' ) / meson .project_name(),
6563 ' BIN_EXECUTE_DRIVER_PATH' : ' /usr' / lib_bin_dir / ' execute-driver' ,
6664 ' BIN_DRIVER_GENERATOR_PATH' : ' /usr' / lib_bin_dir / ' driver-generator' ,
6765 ' UDEV_RULE_PATH' : ' /etc/udev/rules.d/99-linux-enable-ir-emitter.rules' ,
@@ -80,6 +78,12 @@ configure_file(
8078 install_dir : lib_dir,
8179)
8280
81+ install_data (
82+ ' sources/boot_service/__init__.py' ,
83+ ' sources/boot_service/base_boot_service.py' ,
84+ install_dir : lib_dir / ' boot_service' ,
85+ )
86+
8387install_data (
8488 ' LICENSE' ,
8589 ' README.md' ,
@@ -95,17 +99,18 @@ install_data(
9599 install_dir : lib_dir / ' command' ,
96100)
97101
98- install_subdir (
102+ ############
103+ # Executable
104+ ############
105+ install_symlink(
99106 meson .project_name(),
100- install_dir : sysconf_dir,
101- )
102-
103- install_data (
104- ' sources/boot_service/__init__.py' ,
105- ' sources/boot_service/base_boot_service.py' ,
106- install_dir : lib_dir / ' boot_service' ,
107+ pointing_to : ' ../' / lib_dir / ' linux-enable-ir-emitter.py' ,
108+ install_dir : get_option (' bindir' ),
107109)
108110
111+ ##############
112+ # Boot service
113+ ##############
109114if boot_service == ' systemd'
110115 install_data (
111116 ' sources/boot_service/systemd/__init__.py' ,
@@ -114,7 +119,7 @@ if boot_service == 'systemd'
114119 )
115120 install_data (
116121 ' sources/boot_service/systemd/linux-enable-ir-emitter.service' ,
117- install_dir : systemd_dir ,
122+ install_dir : ' lib/systemd/system ' ,
118123 )
119124elif boot_service == ' openrc'
120125 install_data (
@@ -124,11 +129,22 @@ elif boot_service == 'openrc'
124129 )
125130 install_data (
126131 ' sources/boot_service/openrc/linux-enable-ir-emitter' ,
127- install_dir : openrc_dir ,
132+ install_dir : ' /etc/init.d ' ,
128133 )
129134endif
130135
136+ ######
137+ # Conf
138+ ######
139+ install_subdir (
140+ meson .project_name(),
141+ install_dir : get_option (' sysconfdir' ),
142+ )
143+
144+ ##################
145+ # Shell completion
146+ ##################
131147install_data (
132148 ' sources/autocomplete/linux-enable-ir-emitter' ,
133- install_dir : autocomplete_dir ,
149+ install_dir : get_option ( ' datadir ' ) / ' bash-completion/completions ' ,
134150)
0 commit comments