gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] systemd/*: Use @SBINDIR@.


From: Ladislav Michl
Subject: [PATCH] systemd/*: Use @SBINDIR@.
Date: Mon, 3 Aug 2020 11:29:30 +0200

---
 .gitignore                                | 1 +
 SConstruct                                | 1 +
 systemd/{gpsd.service => gpsd.service.in} | 2 +-
 systemd/gpsdctl@.service.in               | 4 ++--
 4 files changed, 5 insertions(+), 3 deletions(-)
 rename systemd/{gpsd.service => gpsd.service.in} (82%)

diff --git a/.gitignore b/.gitignore
index fd0b32d8e..5331d4548 100644
--- a/.gitignore
+++ b/.gitignore
@@ -197,6 +197,7 @@ tmp*
 # config file created by gpsd.php
 gpsd_config.inc
 # for systemd(umb)
+systemd/gpsd.service
 systemd/gpsdctl@.service
 systemd/gpsd.socket
 # for 3rd party packaging
diff --git a/SConstruct b/SConstruct
index 9385b96d9..d91f5b067 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2080,6 +2080,7 @@ substmap = (
     ('@PYPACKETH@',  pythonized_header),
     ('@QTVERSIONED@', env['qt_versioned']),
     ('@RUNDIR@',     env['rundir']),
+    ('@SBINDIR@',    installdir('sbindir', add_destdir=False)),
     ('@SCPUPLOAD@',  scpupload),
     ('@SHAREPATH@',  installdir('sharedir')),
     ('@SITENAME@',   sitename),
diff --git a/systemd/gpsd.service b/systemd/gpsd.service.in
similarity index 82%
rename from systemd/gpsd.service
rename to systemd/gpsd.service.in
index c1f193cc6..768e3dcd6 100644
--- a/systemd/gpsd.service
+++ b/systemd/gpsd.service.in
@@ -8,7 +8,7 @@ After=chronyd.service
 Type=forking
 EnvironmentFile=-/etc/default/gpsd
 EnvironmentFile=-/etc/sysconfig/gpsd
-ExecStart=/usr/local/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
+ExecStart=@SBINDIR@/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
 
 [Install]
 WantedBy=multi-user.target
diff --git a/systemd/gpsdctl@.service.in b/systemd/gpsdctl@.service.in
index c09fc19f9..dd8d3cb89 100644
--- a/systemd/gpsdctl@.service.in
+++ b/systemd/gpsdctl@.service.in
@@ -10,5 +10,5 @@ Environment="GPSD_SOCKET=@RUNDIR@/gpsd.sock"
 EnvironmentFile=-/etc/default/gpsd
 EnvironmentFile=-/etc/sysconfig/gpsd
 RemainAfterExit=yes
-ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/local/sbin/gpsdctl add 
/dev/%I || :"
-ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/local/sbin/gpsdctl remove 
/dev/%I || :"
+ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl add /dev/%I 
|| :"
+ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl remove 
/dev/%I || :"
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]