summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-06-22 15:20:53 -0700
committerGary E. Miller <gem@rellim.com>2018-06-22 15:20:53 -0700
commitbaaf8eff8d4a6199e43851b55c21eae415253a5b (patch)
tree363323923ccc41fdc9a2254aedaf21ea93b00858 /SConstruct
parent840b68e852ba9098a3e18d47375a90882bfe1107 (diff)
downloadgpsd-baaf8eff8d4a6199e43851b55c21eae415253a5b.tar.gz
SConstruct: refactor some systemd code
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct33
1 files changed, 14 insertions, 19 deletions
diff --git a/SConstruct b/SConstruct
index e337b8a9..97b2236e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2297,6 +2297,11 @@ 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
@@ -2309,33 +2314,23 @@ 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'],