mirror of https://github.com/nirenjan/libx52.git
feat: Add udev rules to meson.build
parent
726b5ba21f
commit
0c0a6c1228
12
meson.build
12
meson.build
|
@ -307,3 +307,15 @@ executable('x52ctl', 'daemon/x52ctl.c',
|
|||
|
||||
install_data('daemon/x52d.conf',
|
||||
install_dir: join_paths(get_option('sysconfdir'), 'x52d'))
|
||||
|
||||
# udev rules
|
||||
if dep_udev.found()
|
||||
udev_rules_dir = join_paths(dep_udev.get_variable('udevdir'), 'rules.d')
|
||||
udev_file = configure_file(
|
||||
input: 'udev/60-saitek-x52-x52pro.rules.in',
|
||||
output: '60-saitek-x52-x52pro.rules',
|
||||
configuration: {'input_group': 'plugdev'}
|
||||
)
|
||||
install_data(udev_file, install_dir: udev_rules_dir)
|
||||
meson.add_install_script('udev/install-hook.sh')
|
||||
endif
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh -x
|
||||
# Run the following command when installing files
|
||||
|
||||
# If DESTDIR is not specified or is not /, quit early
|
||||
if ! test -n "${DESTDIR}" || [ "${DESTDIR}" != "/" ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = "0" ]
|
||||
then
|
||||
udevadm control --reload-rules && \
|
||||
udevadm trigger --subsystem-match=usb --attr-match=idVendor=06a3 --action=add
|
||||
fi
|
||||
|
||||
true
|
Loading…
Reference in New Issue