summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2014-03-19 20:39:09 +0100
committerEric S. Raymond <esr@thyrsus.com>2014-05-16 13:12:20 -0400
commitd14cce65dfbe95f1e72d3ccd61abeecbbddf21a3 (patch)
tree86111dbd70f08822dfe0af78eb5b43651e8c5e7b
parent11b29ea49a2fe0a84260d5abc530ae8355ca79fb (diff)
downloadgpsd-d14cce65dfbe95f1e72d3ccd61abeecbbddf21a3.tar.gz
Fix paths to gpsd.hotplug in udev rules
The gpsd build system allows us to specify where to install udev rules with "scons udevdir=...", but the rules file itself will always contain (hardcoded) paths to /lib/udev. Which makes it broken. This patch makes it so that the references to gpsd.hotplug stays in sync with where the rules file is installed, by adding a @udevdir@ "magic marker" in the rules file (now renamed to gpsd.rules.in) and then substituting that for the real udevdir install path at build time. Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com> Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rw-r--r--SConstruct3
-rw-r--r--gpsd.rules.in (renamed from gpsd.rules)32
2 files changed, 18 insertions, 17 deletions
diff --git a/SConstruct b/SConstruct
index 8f7ba8a8..edb22b95 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1190,6 +1190,7 @@ def substituter(target, source, env):
('@VERSION@', gpsd_version),
('@prefix@', env['prefix']),
('@libdir@', env['libdir']),
+ ('@udevdir@', env['udevdir']),
('@PYTHON@', sys.executable),
('@DATE@', time.asctime()),
('@MASTER@', 'DO NOT HAND_HACK! THIS FILE IS GENERATED'),
@@ -1282,7 +1283,7 @@ if manbuilder:
build = env.Alias('build',
[libraries, binaries, python_targets,
"gpsd.php", manpage_targets,
- "libgps.pc", "libgpsd.pc"])
+ "libgps.pc", "libgpsd.pc", "gpsd.rules"])
env.Default(*build)
if qt_env:
diff --git a/gpsd.rules b/gpsd.rules.in
index f1dbe631..c5001dbe 100644
--- a/gpsd.rules
+++ b/gpsd.rules.in
@@ -12,42 +12,42 @@
#
# The following setup works on Debian and Ubuntu - something similar
# will apply on other distributions:
-#
+#
# /lib/udev/rules.d/25-gpsd.rules
# /lib/udev/gpsd.hotplug
-#
+#
# Setting the link in /lib/udev/rules.d activates the rule and determines
# when to run it on boot (similar to init.d processing).
SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
# Prolific Technology, Inc. PL2303 Serial Port [linux module: pl2303]
-ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# ATEN International Co., Ltd UC-232A Serial Port [linux module: pl2303]
-ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# PS-360 OEM (GPS sold with MS Street and Trips 2005) [linux module: pl2303]
-ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# FTDI 8U232AM / FT232 [linux module: ftdi_sio]
-ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Cypress M8/CY7C64013 (Delorme uses these) [linux module: cypress_m8]
-ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Cypress M8/CY7C64013 (DeLorme LT-40)
-ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) [linux module: garmin_gps]
-ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x]
-ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Cygnal Integrated Products, Inc. [linux module: cp210x]
-ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# u-blox AG, u-blox 5 (tested with Navilock NL-402U) [linux module: cdc_acm]
-ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# u-blox AG, u-blox 6 (tested with GNSS Evaluation Kit TCXO) [linux module: cdc_acm]
-ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# MediaTek (tested with HOLUX M-1200E) [linux module: cdc_acm]
-ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK="gps%n", RUN+="@udevdir@/gpsd.hotplug"
# Telit wireless solutions (tested with HE910G) [linux module: cdc_acm]
-ATTRS{interface}=="Telit Wireless Module Port", ATTRS{bInterfaceNumber}=="06", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
+ATTRS{interface}=="Telit Wireless Module Port", ATTRS{bInterfaceNumber}=="06", SYMLINK="gps%n", RUN+="@udevdir@/gpsd.hotplug"
-ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug"
+ACTION=="remove", RUN+="@udevdir@/gpsd.hotplug"
LABEL="gpsd_rules_end"