Skip to content
Snippets Groups Projects

Add separate udev rules for systemd installs, rework service

Open Arnaud Ferraris requested to merge a-wai/bootmac:master into master
1 file
+ 58
0
Compare changes
  • Side-by-side
  • Inline
  • 6c6d8451
    Add meson.build · 6c6d8451
    Arnaud Ferraris authored
    This can ease installation, while providing enough flexibility to cover
    both installation use-cases:
    * systemd installs, using the service file and specific udev rules
    * generics installs, using the basic udev rules only
meson.build 0 → 100644
+ 58
0
project(
'bootmac', 'c',
version: '0.6.0',
license : 'GPL-3.0-or-later',
)
prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
libdir = prefix / get_option('libdir')
pkg = import('pkgconfig')
systemd = dependency('systemd', required : false)
# udev is only used to get the rules location, we can have a fallback
udev = dependency('udev', required : false)
if udev.found()
udev_rules_dir = udev.get_variable(pkgconfig : 'udevdir') / 'rules.d'
else
udev_rules_dir = libdir / 'udev' / 'rules.d'
endif
# By default, install the udev rules that execute bootmac directly
bt_udev_rules = 'bootmac-bluetooth.rules'
wifi_udev_rules = 'bootmac-wifi.rules'
if systemd.found()
# On systemd-based system, install a specific udev rule for bluetooth, using
# unit activation and a template service we can instantiate for either
# bluetooth or wifi
systemd_system_unit_dir = systemd.get_variable(
pkgconfig : 'systemdsystemunitdir',
pkgconfig_define: ['prefix', prefix]
)
install_data(
'systemd/bootmac@.service',
install_dir: systemd_system_unit_dir
)
bt_udev_rules = 'systemd/bootmac-bluetooth.rules'
endif
install_data(
bt_udev_rules,
wifi_udev_rules,
install_dir: udev_rules_dir,
rename: [
'90-bootmac-bluetooth.rules',
'90-bootmac-wifi.rules'
],
)
install_data(
'bootmac',
install_dir: bindir,
install_mode: 'rwxr-xr-x'
)
Loading