From c49d1113bf1692081521bd60509643ded775bc31 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Sat, 23 Jun 2018 18:17:57 -0700 Subject: Revert "SConstruct: refactor some systemd code" This reverts commit baaf8eff8d4a6199e43851b55c21eae415253a5b. --- SConstruct | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 97b2236e..e337b8a9 100644 --- a/SConstruct +++ b/SConstruct @@ -2297,11 +2297,6 @@ env.Command('www/hardware.html', ['gpscap.py', # Note that a udev event can be triggered with an invocation like: # udevadm trigger --sysname-match=ttyUSB0 --action add -udev_install = Utility('udev-install', 'install', [ - 'mkdir -p ' + DESTDIR + env['udevdir'] + '/rules.d', - 'cp $SRCDIR/gpsd.rules ' + DESTDIR + env['udevdir'] + - '/rules.d/25-gpsd.rules', ] + hotplug_wrapper_install) - if env['systemd']: systemdinstall_target = [env.Install(DESTDIR + systemd_dir, "systemd/%s" % (x,)) for x in @@ -2314,23 +2309,33 @@ if env['systemd']: env.AlwaysBuild(systemd_uninstall) env.Precious(systemd_uninstall) - hotplug_wrapper_install = [] - env.Requires(udev_install, systemd_install) - if not env["sysroot"]: - systemctl_daemon_reload = Utility('systemctl-daemon-reload', '', - ['systemctl daemon-reload || true']) - env.AlwaysBuild(systemctl_daemon_reload) - env.Precious(systemctl_daemon_reload) - env.Requires(systemctl_daemon_reload, systemd_install) - env.Requires(udev_install, systemctl_daemon_reload) +if env['systemd']: + hotplug_wrapper_install = [] else: hotplug_wrapper_install = [ 'cp $SRCDIR/gpsd.hotplug ' + DESTDIR + env['udevdir'], 'chmod a+x ' + DESTDIR + env['udevdir'] + '/gpsd.hotplug' ] +udev_install = Utility('udev-install', 'install', [ + 'mkdir -p ' + DESTDIR + env['udevdir'] + '/rules.d', + 'cp $SRCDIR/gpsd.rules ' + DESTDIR + env['udevdir'] + + '/rules.d/25-gpsd.rules', ] + hotplug_wrapper_install) + +if env['systemd']: + env.Requires(udev_install, systemd_install) + +if env['systemd'] and not env["sysroot"]: + systemctl_daemon_reload = Utility('systemctl-daemon-reload', '', + ['systemctl daemon-reload || true']) + env.AlwaysBuild(systemctl_daemon_reload) + env.Precious(systemctl_daemon_reload) + env.Requires(systemctl_daemon_reload, systemd_install) + env.Requires(udev_install, systemctl_daemon_reload) + + Utility('udev-uninstall', '', [ 'rm -f %s/gpsd.hotplug' % env['udevdir'], 'rm -f %s/rules.d/25-gpsd.rules' % env['udevdir'], -- cgit v1.2.1