Blob Blame History Raw
From fa0085b8773ed9f69d70ce617ac824d52a4f8dff Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Tue, 25 Dec 2012 13:26:05 +0100
Subject: [PATCH 7/8] Use fedora-specific default socket directory.

Fedora conventions requires the use of /var/run (or, after 17, just /run)
for the temporary socket directory. Fixed in this patch.

Using this means that docs need an update, fix: sed -i
's|/dev/iguanaIR|/var/run/iguanaIR|g' docs/TroubleShooting docs/driver docs/lirc

Note that the reasoning  behind this probably is valid for all Linux
distributions: it's simply that Filesystem Hierarchy Standard (FHS)
assumes that these kind of directories goes into /run. A more complete
but also untested patch is in https://bugzilla.redhat.com/show_bug.cgi?id=642773,
fixes.patch bundled in the source rpm.

For the time being /var/run is used for historical reasons. On recent
platforms it's a symlink to /run. Over time, using just /run should be
better.

Signed-off-by: Alec Leamas <leamas.alec@gmail.com>
---
 iguanaIR.h          | 2 ++
 reflasher/looper    | 5 ++++-
 udev/iguanaIR.rules | 4 ++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/iguanaIR.h b/iguanaIR.h
index bbc27ae..e3301b0 100644
--- a/iguanaIR.h
+++ b/iguanaIR.h
@@ -53,6 +53,8 @@
 
     #ifdef __APPLE__
         #define IGSOCK_NAME "/tmp/iguanaIR/"
+    #elif FEDORA
+        #define IGSOCK_NAME "/var/run/iguanaIR/"
     #else
         #define IGSOCK_NAME "/dev/iguanaIR/"
     #endif
diff --git a/reflasher/looper b/reflasher/looper
index 15c3e20..c0db224 100755
--- a/reflasher/looper
+++ b/reflasher/looper
@@ -7,6 +7,7 @@ import stat
 import sys
 import os
 import errno
+import platform
 
 #versions = [3, 4, 0x0101, 0x0102]
 versions = [4]
@@ -16,7 +17,9 @@ import iguanaIR
 
 if sys.platform == 'darwin':
     deviceDir = '/tmp/iguanaIR'
-else:
+elif sys.platform == 'linux2' and platform.linux_distribution()[0] == 'Fedora':
+    deviceDir = '/var/run/iguanaIR'
+else
     deviceDir = '/dev/iguanaIR'
 
 def listDevices(path = deviceDir):
diff --git a/udev/iguanaIR.rules b/udev/iguanaIR.rules
index e43aa91..79d6573 100644
--- a/udev/iguanaIR.rules
+++ b/udev/iguanaIR.rules
@@ -10,8 +10,8 @@
 
 ATTR{manufacturer} == "IguanaWorks", ATTR{product} == "USB IR Transceiver", \
                OWNER = "iguanair", MODE = "0664", \
-               RUN  = "/bin/mkdir -p /dev/iguanaIR", \
-               RUN += "/bin/chown iguanair /dev/iguanaIR", \
+               RUN  = "/bin/mkdir -p /var/run/iguanaIR", \
+               RUN += "/bin/chown iguanair /var/run/iguanaIR", \
                RUN += "/etc/init.d/iguanaIR rescan"
 
 # FOR DEBUGGING TRY ADDING TO THE RUN LINES:
-- 
1.7.11.4