diff --git a/debian/feedbackd.udev b/data/90-feedbackd.rules similarity index 100% rename from debian/feedbackd.udev rename to data/90-feedbackd.rules diff --git a/data/meson.build b/data/meson.build index 0c8590f..f9b78e6 100644 --- a/data/meson.build +++ b/data/meson.build @@ -68,4 +68,8 @@ if json_glib_validate.found() command: [json_glib_validate.full_path()] + jsons) endif +if get_option('udev') + install_data('90-feedbackd.rules', install_dir: udevdir) +endif + endif # daemon diff --git a/debian/control b/debian/control index 1743808..1efc50f 100644 --- a/debian/control +++ b/debian/control @@ -20,6 +20,7 @@ Build-Depends: meson, pkg-config, python3-docutils , + systemd-dev, umockdev, valac, Standards-Version: 4.6.2 diff --git a/debian/feedbackd.install b/debian/feedbackd.install index 732f8bd..fcfbd17 100644 --- a/debian/feedbackd.install +++ b/debian/feedbackd.install @@ -1,4 +1,5 @@ -/usr/bin/ -/usr/libexec/ -/usr/share/dbus-1/ -/usr/share/feedbackd/ +usr/bin/ +usr/lib/udev/ +usr/libexec/ +usr/share/dbus-1/ +usr/share/feedbackd/ diff --git a/debian/feedbackd.postinst b/debian/feedbackd.postinst index b6a2dbc..aec183b 100644 --- a/debian/feedbackd.postinst +++ b/debian/feedbackd.postinst @@ -22,6 +22,9 @@ case "$1" in if ! getent group feedbackd >/dev/null; then addgroup --quiet --system feedbackd fi + + # we ship udev rules, so trigger an update + udevadm trigger --subsystem-match=leds --action=change || true ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/rules b/debian/rules index 0b3673d..1d70ac0 100755 --- a/debian/rules +++ b/debian/rules @@ -2,7 +2,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all -CONFIGURE_OPTS=--wrap-mode=default +CONFIGURE_OPTS=--wrap-mode=default -Dudev=true ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) CONFIGURE_OPTS += -Dtests=false @@ -30,10 +30,6 @@ endif override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_OPTS) -override_dh_installudev: - # Make sure all the symlink rules in 60 ran: - dh_installudev --priority=90 - override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) dbus-run-session ninja -C _build test diff --git a/meson.build b/meson.build index 1801045..4df9c65 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('feedbackd', 'c', version : '0.4.0', license : 'LGPLv3+', - meson_version : '>= 0.56.0', + meson_version : '>= 1.0.0', default_options : [ 'warning_level=1', 'buildtype=debugoptimized', @@ -12,6 +12,7 @@ project('feedbackd', 'c', gio = dependency('gio-2.0', version: '>=2.50.0') gio_unix = dependency('gio-unix-2.0', version: '>=2.50.0') glib = dependency('glib-2.0', version: '>=2.50.0') +udev = dependency('udev', required: false) if get_option('daemon') gobject = dependency('gobject-2.0', version: '>=2.50.0') gmobile = dependency('gmobile', @@ -40,6 +41,11 @@ libexecdir = join_paths(prefix, get_option('libexecdir')) typelibdir = join_paths(prefix, join_paths(libdir, 'girepository-1.0')) vapidir = join_paths(prefix, join_paths(datadir, 'vala', 'vapi')) feedbackd_theme_dir = join_paths(datadir, 'feedbackd', 'themes') +if udev.found() and get_option('daemon') + udevdir = udev.get_variable('udevdir') / 'rules.d' +else + udevdir = prefix / 'lib' / 'udev' / 'rules.d' +endif run_data = configuration_data() run_data.set('ABS_BUILDDIR', meson.current_build_dir()) @@ -127,6 +133,7 @@ summary = [ 'feedbackd @0@'.format(meson.project_version()), '', ' Daemon: @0@'.format(get_option('daemon')), + ' Udev rules: @0@'.format(get_option('udev')), ' Documentation: @0@'.format(get_option('gtk_doc')), ' Manual pages: @0@'.format(get_option('man')), ' Introspection: @0@'.format(introspection), diff --git a/meson_options.txt b/meson_options.txt index 59e2281..33a5071 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,9 @@ option('introspection', type: 'feature', value: 'auto') option('vapi', type: 'boolean', value: true) +option('udev', + type: 'boolean', value: true, + description: 'Whether to install the udev rules') option('daemon', type: 'boolean', value: true, description: 'Whether to build the daemon')