Updating to release 15

- Actually use sysconfig files (881976)
- Modify lirc.service to not fork.
- Add support for iguanaIR driver (#954146).
- Add hardened build flag (955144).
- Use actual systemd macros (850191).
- Clean up some nowadays not used directives.
- Run autoreconf by default (926082).
- Cleanup some obsoleted autotools usage, two new patches.
- Deactivate other decoders on start (923978).
- Filter away docdir dependencies.
- Remove obsolete F8 upgrade Obsoletes: (sic!).
- Fix inconsistent/duplicate /usr/share/lirc in %%files.
- Add %%doc (notably COPYING) to remotes subpackage.
- Claim /etc/lirc.
- Update to latest upstream (10 patches).
- Use /var and /etc instead of %%{_sysconfdir} and %%{localstatedir}.
- Removed obsolete code to move config files to /etc/lirc in %%post.
- Renamed main systemd service: lirc.service -> lircd.service.
- Added socket activation support.
- Don't claim temporary files in /run/lirc, they are just transient.
- Initiate lircd.conf, lircmd.conf from external template.
- Bumping release, 14 is published.
epel8
Alec Leamas 11 years ago
parent 04b95fae5a
commit 3462c826c9

@ -0,0 +1,26 @@
From 7635b1e321bf2f98468ae4f2233e28e3d78505cb Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas@nowhere.net>
Date: Fri, 11 Oct 2013 05:50:12 +0200
Subject: [PATCH] configure-ac: revert to git branch
rebasing for further changes to match upstream merge request.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5a9b31d..9efe2f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AC_INIT
AC_CONFIG_SRCDIR([daemons/lircd.c])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(lirc, 0.9.0)
+AM_INIT_AUTOMAKE(lirc, 0.9.0-git)
AM_CONFIG_HEADER(config.h)
CFLAGS="${CFLAGS--O2 -g -Wall}"
--
1.8.3.1

@ -0,0 +1,58 @@
From 7e07ae592ef6bfdc7c4a200809a0c9c9a0b41646 Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Tue, 8 Oct 2013 14:57:08 +0200
Subject: [PATCH 1/3] lirc-0.9.0: libusb config is no more
---
lirc-0.9.0/configure.ac | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/lirc-0.9.0/configure.ac b/lirc-0.9.0/configure.ac
index 052908b..20e37a4 100644
--- a/lirc-0.9.0/configure.ac
+++ b/lirc-0.9.0/configure.ac
@@ -20,11 +20,11 @@ AC_PROG_MAKE_SET
AC_PATH_PROG(mknod, mknod, /bin/mknod)
AC_PATH_PROG(mkfifo, mkfifo, /usr/bin/mkfifo)
AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
-AC_PATH_PROG(LIBUSB_CONFIG, libusb-config)
AC_PROG_LN_S
AC_PROG_LIBTOOL
AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
+LIBUSB_CONFIG="pkg-config libusb"
dnl Checks for header files.
AC_HEADER_STDC
@@ -310,15 +310,14 @@ AH_TEMPLATE([SYSCONFDIR],
AH_TEMPLATE([USE_SYSLOG],
[define if you want to log to syslog instead of logfile])
-if test -n "${LIBUSB_CONFIG}"; then
- AC_DEFINE(HAVE_LIBUSB)
- possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
-fi
-
AC_CHECK_LIB(caraca_client, caraca_init,
AC_DEFINE(HAVE_LIBCARACA)
possible_drivers="${possible_drivers} (caraca)"
)
+AC_CHECK_HEADER(usb.h,
+ AC_DEFINE(HAVE_LIBUSB)
+ possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
+)
AC_CHECK_HEADER(ftdi.h,
AC_DEFINE(HAVE_FTDI)
possible_drivers="${possible_drivers} (ftdi)"
@@ -1449,7 +1448,7 @@ Get it at:
Or install these packages from your distro:
libusb
- libusb-dev
+ libusb-devel
])
;;
--
1.8.3.1

@ -0,0 +1,12 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1708,7 +1708,9 @@
AH_TOP([
/* device file names - beneath DEVDIR (default /dev) */
-#define DEV_LIRC "lirc"
+#define DEV_LIRC "lirc0"
+
+/* daemon socket file names - beneath $varrundir (default /var/run/lirc) */
#define DEV_LIRCD "lircd"
#define DEV_LIRCM "lircm"

@ -0,0 +1,89 @@
From 413e83bf504fe9a9a177f27742220cfcb184b034 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Jes=C3=BAs=20Garc=C3=ADa=20de=20Soria=20Lucena?=
<skandalfo@gmail.com>
Date: Wed, 30 Mar 2011 16:46:35 -0400
Subject: [PATCH 07/17] Make lirc_wpc8769l functional again
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_wpc8769l/lirc_wpc8769l.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/lirc_wpc8769l/lirc_wpc8769l.c b/drivers/lirc_wpc8769l/lirc_wpc8769l.c
index f820d11..4d04063 100644
--- a/drivers/lirc_wpc8769l/lirc_wpc8769l.c
+++ b/drivers/lirc_wpc8769l/lirc_wpc8769l.c
@@ -816,10 +816,6 @@ static int set_use_inc(void *data)
/* Reset last timeout value. */
lastus = 0;
- /* Init the read buffer. */
- if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0)
- return -ENOMEM;
-
/* Acquire the IRQ. */
result = request_irq(irq, irq_handler,
IRQF_DISABLED | IRQF_SHARED,
@@ -863,9 +859,6 @@ static void set_use_dec(void *data)
/* Free the IRQ. */
free_irq(irq, THIS_MODULE);
dprintk("Freed IRQ %d\n", irq);
-
- /* Free the RX buffer. */
- lirc_buffer_free(&rbuf);
}
static struct lirc_driver driver = {
@@ -1065,19 +1058,29 @@ static int __init lirc_wpc8769l_module_init(void)
/* Do load-time checks. */
wpc8769l_power_up_and_check_if_we_woke_us_up();
+ /* Init the read buffer. */
+ if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0) {
+ rc = -ENOMEM;
+ goto exit_platform_exit;
+ }
+
/* Configure the driver hooks. */
driver.features = LIRC_CAN_REC_MODE2;
+ driver.dev = &lirc_wpc8769l_platform_dev->dev;
driver.minor = lirc_register_driver(&driver);
if (driver.minor < 0) {
eprintk("lirc_register_driver failed!\n");
rc = -EIO;
- goto exit_platform_exit;
+ goto exit_release_buffer;
}
iprintk("Driver loaded.\n");
return 0; /* Everything OK. */
+exit_release_buffer:
+ lirc_buffer_free(&rbuf);
+
exit_platform_exit:
lirc_wpc8769l_platform_exit();
@@ -1095,12 +1098,15 @@ module_init(lirc_wpc8769l_module_init);
static void __exit lirc_wpc8769l_module_exit(void)
{
- /* Unregister the platform driver and device. */
- lirc_wpc8769l_platform_exit();
-
/* Unregister the LIRC driver. */
lirc_unregister_driver(driver.minor);
+ /* Free the buffer. */
+ lirc_buffer_free(&rbuf);
+
+ /* Unregister the platform driver and device. */
+ lirc_wpc8769l_platform_exit();
+
/* Release the second range. */
if (baseport2)
release_region(baseport2, WPC8769L_IO_REGION_2_SIZE);
--
1.8.3.1

@ -0,0 +1,60 @@
From be3ec6c75e33b4a175799218b2921be47ad4c842 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Thu, 31 Mar 2011 17:44:15 -0400
Subject: [PATCH 08/17] lirc_sir: fix resource busy error from bunk lirc_open
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_sir/lirc_sir.c | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/lirc_sir/lirc_sir.c b/drivers/lirc_sir/lirc_sir.c
index eefe0c9..c397ce0 100644
--- a/drivers/lirc_sir/lirc_sir.c
+++ b/drivers/lirc_sir/lirc_sir.c
@@ -203,8 +203,6 @@ static int debug;
/* SECTION: Prototypes */
/* Communication with user-space */
-static int lirc_open(struct inode *inode, struct file *file);
-static int lirc_close(struct inode *inode, struct file *file);
static unsigned int lirc_poll(struct file *file, poll_table *wait);
static ssize_t lirc_read(struct file *file, char *buf, size_t count,
loff_t *ppos);
@@ -275,22 +273,6 @@ static void safe_udelay(unsigned long usecs)
/* SECTION: Communication with user-space */
-static int lirc_open(struct inode *inode, struct file *file)
-{
- spin_lock(&dev_lock);
- if (MOD_IN_USE) {
- spin_unlock(&dev_lock);
- return -EBUSY;
- }
- spin_unlock(&dev_lock);
- return 0;
-}
-
-static int lirc_close(struct inode *inode, struct file *file)
-{
- return 0;
-}
-
static unsigned int lirc_poll(struct file *file, poll_table *wait)
{
poll_wait(file, &lirc_read_queue, wait);
@@ -519,8 +501,8 @@ static struct file_operations lirc_fops = {
.compat_ioctl = lirc_ioctl,
#endif
#endif
- .open = lirc_open,
- .release = lirc_close,
+ .open = lirc_dev_fop_open,
+ .release = lirc_dev_fop_close,
};
static int set_use_inc(void *data)
--
1.8.3.1

@ -0,0 +1,40 @@
From 5efb56bf22a5077db564c766ba7cc37bc269231d Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Wed, 6 Apr 2011 11:04:12 -0400
Subject: [PATCH 09/17] lircd: handle larger config files in write_socket
better
Pointed out by Michael Zanetti on list, irsend LIST has issues with long
config files, which didn't exist in maintainer mode, as we were using a
do while loop to make sure we spit out everything. Just use that loop
all the time.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
daemons/lircd.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/daemons/lircd.c b/daemons/lircd.c
index 6c21a3a..ddcca05 100644
--- a/daemons/lircd.c
+++ b/daemons/lircd.c
@@ -231,14 +231,10 @@ inline int write_socket(int fd, const char *buf, int len)
int done, todo = len;
while (todo) {
-#ifdef SIM_REC
do {
done = write(fd, buf, todo);
- }
- while (done < 0 && errno == EAGAIN);
-#else
- done = write(fd, buf, todo);
-#endif
+ } while (done < 0 && errno == EAGAIN);
+
if (done <= 0)
return (done);
buf += done;
--
1.8.3.1

@ -0,0 +1,31 @@
From ec3c5660e67c122e2d5eb9cfa838c9709fccf8e0 Mon Sep 17 00:00:00 2001
From: Jason Martin <publicmsu@gmail.com>
Date: Fri, 3 Jun 2011 00:12:51 -0400
Subject: [PATCH 10/17] lirc_atiusb: fix buffer alloc to work with new kfifo
I came across posts with regards to lirc_atiusb and its compatibility
with newer kernels, and their use of kfifo.I spent a little bit of time
this evening, and was able to correct the issues with the driver, and
now have a functioning lirc_atiusb device under the 2.6.38 kernel.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_atiusb/lirc_atiusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/lirc_atiusb/lirc_atiusb.c b/drivers/lirc_atiusb/lirc_atiusb.c
index 52080de..bf2b631 100644
--- a/drivers/lirc_atiusb/lirc_atiusb.c
+++ b/drivers/lirc_atiusb/lirc_atiusb.c
@@ -1048,7 +1048,7 @@ static struct atirf_dev *new_irctl(struct usb_interface *intf)
goto new_irctl_failure_check;
}
- if (lirc_buffer_init(driver->rbuf, dclen, 1)) {
+ if (lirc_buffer_init(driver->rbuf, dclen, 2)) {
mem_failure = 4;
goto new_irctl_failure_check;
}
--
1.8.3.1

@ -0,0 +1,60 @@
From 02c5c3f2181381a44e03cdfb8962bcbf67a8139a Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 7 Jun 2011 00:14:20 -0400
Subject: [PATCH 11/17] libusb has no libusb-config any longer, use pkg-config
by default
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
configure.ac | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6c07e0d..1a3347e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,11 +20,11 @@ AC_PROG_MAKE_SET
AC_PATH_PROG(mknod, mknod, /bin/mknod)
AC_PATH_PROG(mkfifo, mkfifo, /usr/bin/mkfifo)
AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
-AC_PATH_PROG(LIBUSB_CONFIG, libusb-config)
AC_PROG_LN_S
AC_PROG_LIBTOOL
AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
+LIBUSB_CONFIG="pkg-config libusb"
dnl Checks for header files.
AC_HEADER_STDC
@@ -310,15 +310,14 @@ AH_TEMPLATE([SYSCONFDIR],
AH_TEMPLATE([USE_SYSLOG],
[define if you want to log to syslog instead of logfile])
-if test -n "${LIBUSB_CONFIG}"; then
- AC_DEFINE(HAVE_LIBUSB)
- possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
-fi
-
AC_CHECK_LIB(caraca_client, caraca_init,
AC_DEFINE(HAVE_LIBCARACA)
possible_drivers="${possible_drivers} (caraca)"
)
+AC_CHECK_HEADER(usb.h,
+ AC_DEFINE(HAVE_LIBUSB)
+ possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
+)
AC_CHECK_HEADER(ftdi.h,
AC_DEFINE(HAVE_FTDI)
possible_drivers="${possible_drivers} (ftdi)"
@@ -1449,7 +1448,7 @@ Get it at:
Or install these packages from your distro:
libusb
- libusb-dev
+ libusb-devel
])
;;
--
1.8.3.1

@ -0,0 +1,89 @@
From 9592bb4a2bccedf5ef205cf93c4d17f5b27edf5c Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Wed, 29 Jun 2011 17:31:28 -0400
Subject: [PATCH 12/17] Silence some clang warnings, courtesy of nox
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
daemons/dump_config.c | 12 ++++++------
daemons/ir_remote.c | 3 ++-
daemons/lircd.c | 4 ++--
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/daemons/dump_config.c b/daemons/dump_config.c
index a83c27e..56fb183 100644
--- a/daemons/dump_config.c
+++ b/daemons/dump_config.c
@@ -120,11 +120,11 @@ void fprint_remote_head(FILE * f, struct ir_remote *rem)
if (!is_raw(rem)) {
if (rem->pre_data_bits > 0) {
fprintf(f, " pre_data_bits %d\n", rem->pre_data_bits);
- fprintf(f, " pre_data 0x%llX\n", rem->pre_data);
+ fprintf(f, " pre_data 0x%llX\n", (unsigned long long)rem->pre_data);
}
if (rem->post_data_bits > 0) {
fprintf(f, " post_data_bits %d\n", rem->post_data_bits);
- fprintf(f, " post_data 0x%llX\n", rem->post_data);
+ fprintf(f, " post_data 0x%llX\n", (unsigned long long)rem->post_data);
}
if (rem->pre_p != 0 && rem->pre_s != 0) {
fprintf(f, " pre %5u %5u\n", (__u32) rem->pre_p, (__u32) rem->pre_s);
@@ -151,15 +151,15 @@ void fprint_remote_head(FILE * f, struct ir_remote *rem)
if (rem->min_code_repeat > 0) {
fprintf(f, " min_code_repeat %d\n", rem->min_code_repeat);
}
- fprintf(f, " toggle_bit_mask 0x%llX\n", rem->toggle_bit_mask);
+ fprintf(f, " toggle_bit_mask 0x%llX\n", (unsigned long long)rem->toggle_bit_mask);
if (has_toggle_mask(rem)) {
- fprintf(f, " toggle_mask 0x%llX\n", rem->toggle_mask);
+ fprintf(f, " toggle_mask 0x%llX\n", (unsigned long long)rem->toggle_mask);
}
if (rem->rc6_mask != 0) {
- fprintf(f, " rc6_mask 0x%llX\n", rem->rc6_mask);
+ fprintf(f, " rc6_mask 0x%llX\n", (unsigned long long)rem->rc6_mask);
}
if (has_ignore_mask(rem)) {
- fprintf(f, " ignore_mask 0x%llX\n", rem->ignore_mask);
+ fprintf(f, " ignore_mask 0x%llX\n", (unsigned long long)rem->ignore_mask);
}
if (is_serial(rem)) {
fprintf(f, " baud %d\n", rem->baud);
diff --git a/daemons/ir_remote.c b/daemons/ir_remote.c
index 3e9e0f6..e5f60f9 100644
--- a/daemons/ir_remote.c
+++ b/daemons/ir_remote.c
@@ -490,7 +490,8 @@ int write_message(char *buffer, size_t size, const char *remote_name, const char
{
int len;
- len = snprintf(buffer, size, "%016llx %02x %s%s %s\n", code, reps, button_name, button_suffix, remote_name);
+ len = snprintf(buffer, size, "%016llx %02x %s%s %s\n",
+ (unsigned long long)code, reps, button_name, button_suffix, remote_name);
return len;
}
diff --git a/daemons/lircd.c b/daemons/lircd.c
index ddcca05..8ace7af 100644
--- a/daemons/lircd.c
+++ b/daemons/lircd.c
@@ -1314,7 +1314,7 @@ int send_remote(int fd, char *message, struct ir_remote *remote)
codes = remote->codes;
while (codes->name != NULL) {
- len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", codes->code, codes->name);
+ len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", (unsigned long long)codes->code, codes->name);
if (len >= PACKET_SIZE + 1) {
len = sprintf(buffer, "code_too_long\n");
}
@@ -1334,7 +1334,7 @@ int send_name(int fd, char *message, struct ir_ncode *code)
(write_socket_len(fd, protocol_string[P_BEGIN]) && write_socket_len(fd, message)
&& write_socket_len(fd, protocol_string[P_SUCCESS]) && write_socket_len(fd, protocol_string[P_DATA])))
return (0);
- len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", code->code, code->name);
+ len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", (unsigned long long)code->code, code->name);
if (len >= PACKET_SIZE + 1) {
len = sprintf(buffer, "1\ncode_too_long\n");
}
--
1.8.3.1

@ -0,0 +1,34 @@
From d0175df5cd2ac4a261332ea21a67179f2c85072c Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Fri, 2 Dec 2011 14:10:21 -0500
Subject: [PATCH 13/17] userspace: use /dev/lirc0 as default device
The lirc_dev kernel driver results in a first lirc chardev of
/dev/lirc0, not /dev/lirc, so lets default to that now. The old way is
from pre-udev days or something, I think... While we're at it, update
the adjacent comment about the daemon socket locations to reflect
current reality too.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
configure.ac | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 1a3347e..ff4780f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1708,7 +1708,9 @@ AC_DEFINE_UNQUOTED(LIRC_SYSLOG, $facility)
AH_TOP([
/* device file names - beneath DEVDIR (default /dev) */
-#define DEV_LIRC "lirc"
+#define DEV_LIRC "lirc0"
+
+/* daemon socket file names - beneath $varrundir (default /var/run/lirc) */
#define DEV_LIRCD "lircd"
#define DEV_LIRCM "lircm"
--
1.8.3.1

@ -0,0 +1,41 @@
From 441e4879e694b18ca10a7c107e81362790c7bd25 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 7 Feb 2012 10:29:58 -0500
Subject: [PATCH 14/17] lirc: make chardev nonseekable
Merge change from upstream kernel
commit d9d2e9d5c9eead1f73f92f5fc03424dab90b6c95
Author: Arnd Bergmann <arnd@arndb.de>
Date: Sun Aug 15 18:51:56 2010 +0200
lirc: make chardev nonseekable
There does not seem to be a need for lirc to
allow seeking on the file descriptor, so let's
just disallow this before users start relying
on it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_dev/lirc_dev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/lirc_dev/lirc_dev.c b/drivers/lirc_dev/lirc_dev.c
index d4a5114..95ba25e 100644
--- a/drivers/lirc_dev/lirc_dev.c
+++ b/drivers/lirc_dev/lirc_dev.c
@@ -583,6 +583,8 @@ error:
mutex_unlock(&lirc_dev_lock);
+ nonseekable_open(inode, file);
+
return retval;
}
EXPORT_SYMBOL(lirc_dev_fop_open);
--
1.8.3.1

@ -0,0 +1,99 @@
From 887e6314eff34eb9a2e518bb96b65b82cd2f5e68 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 7 Feb 2012 10:48:50 -0500
Subject: [PATCH 15/17] [media] lirc_dev: fixes in lirc_dev_fop_read()
Backport from upstream kernel:
commit 250f7a5f62a08985af5cf7728ae7ba9edbfdc0a9
Author: Dan Carpenter <error27@gmail.com>
Date: Wed Nov 17 02:20:15 2010 -0300
[media] lirc_dev: fixes in lirc_dev_fop_read()
This makes several changes but they're in one function and sort of
related:
"buf" was leaked on error. The leak if we try to read an invalid
length is the main concern because it could be triggered over and
over.
If the copy_to_user() failed, then the original code returned the
number of bytes remaining. read() is supposed to be the opposite way,
where we return the number of bytes copied. I changed it to just return
-EFAULT on errors.
Also I changed the debug output from "-EFAULT" to just "<fail>" because
it isn't -EFAULT necessarily. And since we go though that path if the
length is invalid now, there was another debug print that I removed.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_dev/lirc_dev.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/lirc_dev/lirc_dev.c b/drivers/lirc_dev/lirc_dev.c
index 95ba25e..96c9148 100644
--- a/drivers/lirc_dev/lirc_dev.c
+++ b/drivers/lirc_dev/lirc_dev.c
@@ -769,18 +769,18 @@ ssize_t lirc_dev_fop_read(struct file *file,
if (!buf)
return -ENOMEM;
- if (mutex_lock_interruptible(&ir->irctl_lock))
- return -ERESTARTSYS;
+ if (mutex_lock_interruptible(&ir->irctl_lock)) {
+ ret = -ERESTARTSYS;
+ goto out_unlocked;
+ }
if (!ir->attached) {
- mutex_unlock(&ir->irctl_lock);
- return -ENODEV;
+ ret = -ENODEV;
+ goto out_locked;
}
if (length % ir->chunk_size) {
- dprintk(LOGHEAD "read result = -EINVAL\n",
- ir->d.name, ir->d.minor);
- mutex_unlock(&ir->irctl_lock);
- return -EINVAL;
+ ret = -EINVAL;
+ goto out_locked;
}
/*
@@ -831,19 +831,23 @@ ssize_t lirc_dev_fop_read(struct file *file,
lirc_buffer_read(ir->buf, buf);
ret = copy_to_user((void *)buffer+written, buf,
ir->buf->chunk_size);
- written += ir->buf->chunk_size;
+ if (!ret)
+ written += ir->buf->chunk_size;
+ else
+ ret = -EFAULT;
}
}
remove_wait_queue(&ir->buf->wait_poll, &wait);
set_current_state(TASK_RUNNING);
+out_locked:
mutex_unlock(&ir->irctl_lock);
out_unlocked:
kfree(buf);
dprintk(LOGHEAD "read result = %s (%d)\n",
- ir->d.name, ir->d.minor, ret ? "-EFAULT" : "OK", ret);
+ ir->d.name, ir->d.minor, ret ? "<fail>" : "OK", ret);
return ret ? ret : written;
}
--
1.8.3.1

@ -0,0 +1,76 @@
From 6a17924477f64028cc5ff5b51047f3a9fd962a5f Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 7 Feb 2012 11:46:37 -0500
Subject: [PATCH 16/17] [media] lirc_dev: add some __user annotations
Backport from upstream kernel:
commit 0e835087dfe7db19f1f072046f5e116d4ec6662b
Author: Dan Carpenter <error27@gmail.com>
Date: Wed Nov 17 02:13:39 2010 -0300
[media] lirc_dev: add some __user annotations
Sparse complains because there are no __user annotations.
drivers/media/rc/lirc_dev.c:156:27: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))
drivers/media/rc/lirc_dev.c:156:27: expected int ( *read )( ... )
drivers/media/rc/lirc_dev.c:156:27: got int ( extern [toplevel] *<noident> )( ... )
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_dev/lirc_dev.c | 8 +++-----
drivers/lirc_dev/lirc_dev.h | 6 +++---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/lirc_dev/lirc_dev.c b/drivers/lirc_dev/lirc_dev.c
index 96c9148..5b25c5f 100644
--- a/drivers/lirc_dev/lirc_dev.c
+++ b/drivers/lirc_dev/lirc_dev.c
@@ -748,10 +748,8 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}
EXPORT_SYMBOL(lirc_dev_fop_ioctl);
-ssize_t lirc_dev_fop_read(struct file *file,
- char *buffer,
- size_t length,
- loff_t *ppos)
+ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer,
+ size_t length, loff_t *ppos)
{
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
unsigned char *buf;
@@ -870,7 +868,7 @@ void *lirc_get_pdata(struct file *file)
EXPORT_SYMBOL(lirc_get_pdata);
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer,
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
size_t length, loff_t *ppos)
{
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
diff --git a/drivers/lirc_dev/lirc_dev.h b/drivers/lirc_dev/lirc_dev.h
index ca641f8..34056aa 100644
--- a/drivers/lirc_dev/lirc_dev.h
+++ b/drivers/lirc_dev/lirc_dev.h
@@ -257,9 +257,9 @@ int lirc_dev_fop_ioctl(struct inode *inode, struct file *file,
#else
long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
#endif
-ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length,
+ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
loff_t *ppos);
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,
- loff_t *ppos);
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
+ size_t length, loff_t *ppos);
#endif
--
1.8.3.1

@ -0,0 +1,43 @@
From e0ab92be1fa293b8593a77636b3d025fa2aefb82 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Tue, 7 Feb 2012 11:47:31 -0500
Subject: [PATCH 17/17] [media] media: rc: lirc_dev: check kobject_set_name()
result
Backport from upstream kernel:
commit b395cbac36e58a55729fe7e6262a3f0b1691bced
Author: Vasiliy Kulikov <segoon@openwall.com>
Date: Fri Nov 26 14:06:41 2010 -0300
[media] media: rc: lirc_dev: check kobject_set_name() result
kobject_set_name() may fail with -ENOMEM, check for it.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/lirc_dev/lirc_dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/lirc_dev/lirc_dev.c b/drivers/lirc_dev/lirc_dev.c
index 5b25c5f..9d52188 100644
--- a/drivers/lirc_dev/lirc_dev.c
+++ b/drivers/lirc_dev/lirc_dev.c
@@ -236,7 +236,9 @@ static int lirc_cdev_add(struct irctl *ir)
cdev_init(cdev, &lirc_dev_fops);
cdev->owner = THIS_MODULE;
}
- kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
+ retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
+ if (retval)
+ return retval;
retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
if (retval)
--
1.8.3.1

@ -0,0 +1,91 @@
From 7c8034be8a79dce219b60cce3afcf39f1b85d004 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod@redhat.com>
Date: Fri, 25 Mar 2011 18:27:31 -0400
Subject: [PATCH] Start lirc 0.9.1-git
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
ANNOUNCE | 4 ++--
NEWS | 8 ++++++--
configure.ac | 2 +-
doc/html-source/index.html | 2 +-
setup.sh | 2 +-
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/ANNOUNCE b/ANNOUNCE
index 4db8756..da33538 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,8 +1,8 @@
-LIRC - Linux Infrared Remote Control, Version: 0.9.0-git
+LIRC - Linux Infrared Remote Control, Version: 0.9.1-git
Copyright (C) 1996 Ralph Metzler <rjkm@thp.uni-koeln.de>
Copyright (C) 1998-2010 Christoph Bartelmus <lirc@bartelmus.de>
-Copyright (C) 2010 Jarod Wilson <jarod@redhat.com>
+Copyright (C) 2010-2011 Jarod Wilson <jarod@redhat.com>
(according to GNU General Public Licence 2.0 or later)
LIRC is a package that allows you to decode and send infra-red signals
diff --git a/NEWS b/NEWS
index 08d1abf..c097f0d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,9 @@
-0.9.0-git: UNDER DEVELOPMENT
+0.9.1-git: UNDER DEVELOPMENT
+ * TBD
+
+0.9.0: 03/25/11
+ * Remove mceusb, streamzap, it8x, ene0100 drivers, as they're
+ now redundant with upstream kernel drivers
* fix oops unplugging igorplugusb receiver while in use (special
thanks to Timo Boettcher for providing hardware)
* more error-checking for NULL irctl in various lirc_dev paths
@@ -13,7 +18,6 @@
* use portable type definitions all over the place
* drop an old GLIBC work-around for printing 64-bit values
* fix timing-specific repeat-after-release issue (Christoph Bartelmus)
- * renamed lirc_ite8709 to lirc_it85 and updated (Yan-Min Lin, ITE)
0.8.7: 09/06/10
* improved usb-uirt support for FreeBSD (John Wehle)
diff --git a/configure.ac b/configure.ac
index 485b8f3..4fedee1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AC_INIT
AC_CONFIG_SRCDIR([daemons/lircd.c])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(lirc, 0.9.0-git)
+AM_INIT_AUTOMAKE(lirc, 0.9.1-git)
AM_CONFIG_HEADER(config.h)
CFLAGS="${CFLAGS--O2 -g -Wall}"
diff --git a/doc/html-source/index.html b/doc/html-source/index.html
index 77bf381..0e44f83 100644
--- a/doc/html-source/index.html
+++ b/doc/html-source/index.html
@@ -1,5 +1,5 @@
<A NAME="welcome"></A><HR>
- <H1 ALIGN="CENTER">Welcome to the LIRC 0.9.0-git Manual</H1>
+ <H1 ALIGN="CENTER">Welcome to the LIRC 0.9.1-git Manual</H1>
<HR WIDTH="70%">
<P>
diff --git a/setup.sh b/setup.sh
index 6220cda..9a3bdec 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,6 +1,6 @@
#! /bin/sh
-LIRC_VERSION="0.9.0-git"
+LIRC_VERSION="0.9.1-git"
#############################################################################
## Default Values
--
1.8.3.1

@ -0,0 +1,26 @@
From 7635b1e321bf2f98468ae4f2233e28e3d78505cb Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas@nowhere.net>
Date: Fri, 11 Oct 2013 05:50:12 +0200
Subject: [PATCH] configure-ac: revert to git branch
rebasing for further changes to match upstream merge request.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5a9b31d..9efe2f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AC_INIT
AC_CONFIG_SRCDIR([daemons/lircd.c])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(lirc, 0.9.0)
+AM_INIT_AUTOMAKE(lirc, 0.9.1-git)
AM_CONFIG_HEADER(config.h)
CFLAGS="${CFLAGS--O2 -g -Wall}"
--
1.8.3.1

@ -0,0 +1,182 @@
From 7b05725dd224e79a3c6023d8cd3e609aa95ac693 Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Thu, 10 Oct 2013 09:22:39 +0200
Subject: [PATCH] Stripping some eol whitespace.
---
Makefile.am | 2 +-
configure.ac | 26 +++++++++++++-------------
daemons/Makefile.am | 2 +-
doc/Makefile.am | 2 +-
tools/Makefile.am | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 409a4df..f026548 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## $Id: Makefile.am,v 5.12 2009/07/07 20:44:44 lirc Exp $
-## Process this file with automake to produce Makefile.in
+## Process this file with automake to produce Makefile.in
## Makefile.am, (c)1999 Tom Wheeley <tw104@york.ac.uk>
## we need version 1.5 of automake for DIST_SUBDIRS to work and dist-bzip2.
diff --git a/configure.ac b/configure.ac
index ff4780f..e130f1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ in its directory.
])]
)]
)
-
+
dnl Determine default configuration based on OS
case "${host_os}" in
@@ -187,7 +187,7 @@ AH_TEMPLATE([DEVDIR],
AH_TEMPLATE([DYNCODES],
[Define to use dynamic IR codes])
-AH_TEMPLATE([HAVE_ALSA_SB_RC],
+AH_TEMPLATE([HAVE_ALSA_SB_RC],
[Define if the ALSA library with SB RC support is installed])
AH_TEMPLATE([HAVE_FORKPTY],
@@ -198,7 +198,7 @@ AH_TEMPLATE([HAVE_IGUANAIR],
AH_TEMPLATE([HAVE_FTDI],
[Define if the libftdi library is installed])
-
+
AH_TEMPLATE([HAVE_LIBALSA],
[Define if the ALSA library is installed])
@@ -479,7 +479,7 @@ fi
if test "$driver" = "userspace" -o "$driver" = "all"; then
AC_DEFINE(LIRC_DRIVER_ANY)
lirc_driver=$driver
-
+
any_possible_drivers=`echo ${possible_drivers} | sed -e's/ /-/g' \
-e's/)-(/ /g' -e's/(//g' -e's/)//g' \
-e's/-$//g'`
@@ -696,7 +696,7 @@ if test "$driver" = "userspace" -o "$driver" = "all"; then
{ for token in $*; do echo $token; done; }
newline_to_space()
{ echo $*; }
-
+
hw_module=$(newline_to_space $(space_to_newline ${hw_module}| sort -u))
fi
@@ -717,7 +717,7 @@ if test "$driver" = "act220l"; then
lirc_driver="lirc_dev lirc_sir"
AC_DEFINE(LIRC_SIR_ACTISYS_ACT220L)
fi
-
+
if test "$driver" = "adaptec"; then
lirc_driver="lirc_dev lirc_i2c"
lircd_conf="adaptec/lircd.conf.AVC-2410"
@@ -1016,7 +1016,7 @@ fi
if test "$driver" = "imon"; then
lirc_driver="lirc_dev lirc_imon"
- lircd_conf="imon/lircd.conf.imon"
+ lircd_conf="imon/lircd.conf.imon"
fi
if test "$driver" = "imon_24g"; then
@@ -1037,12 +1037,12 @@ fi
if test "$driver" = "imon_pad"; then
lirc_driver="lirc_dev lirc_imon"
- lircd_conf="imon/lircd.conf.imon-pad"
+ lircd_conf="imon/lircd.conf.imon-pad"
fi
if test "$driver" = "imon_rsc"; then
lirc_driver="lirc_dev lirc_imon"
- lircd_conf="imon/lircd.conf.imon-rsc"
+ lircd_conf="imon/lircd.conf.imon-rsc"
fi
if test "$driver" = "irdeo"; then
@@ -1444,7 +1444,7 @@ else
Get it at:
http://libusb.sourceforge.net/
-
+
Or install these packages from your distro:
libusb
@@ -1550,7 +1550,7 @@ devdir=${devdir_default})
default_moduledir=/lib/modules/`uname -r`/misc
AC_ARG_WITH(moduledir,
-[ --with-moduledir=DIR kernel modules in DIR (/lib/modules/`uname -r`/misc)],
+[ --with-moduledir=DIR kernel modules in DIR (/lib/modules/`uname -r`/misc)],
moduledir=${withval},
moduledir=${default_moduledir})
@@ -1649,7 +1649,7 @@ fi
dnl if --prefix is not specified, then $prefix is still set to NONE by
dnl configure. That's bad here where we want to expand it!
cur_prefix=$prefix
-test "x${prefix}" = "xNONE" && prefix=$ac_default_prefix
+test "x${prefix}" = "xNONE" && prefix=$ac_default_prefix
test "${sysconfdir}" = "\${prefix}/etc" && sysconfdir=/etc
test "${localstatedir}" = "\${prefix}/var" && localstatedir=/var
varrundir="${localstatedir}/run"
@@ -1675,7 +1675,7 @@ AC_SUBST(moduledir)
AC_SUBST(driver)
AC_SUBST(lirc_driver)
AC_SUBST(hw_module_libs)
-AC_SUBST(vga_progs)
+AC_SUBST(vga_progs)
AC_SUBST(x_progs)
AC_SUBST(hw_module)
AC_SUBST(receive)
diff --git a/daemons/Makefile.am b/daemons/Makefile.am
index 0b58a8e..42873af 100644
--- a/daemons/Makefile.am
+++ b/daemons/Makefile.am
@@ -1,6 +1,6 @@
## $Id: Makefile.am,v 5.73 2010/05/13 16:23:23 lirc Exp $
-## Process this file with automake to produce Makefile.in
+## Process this file with automake to produce Makefile.in
## these are used by programs in the tools directory, but not by
## programs in this directory. So we must make sure they get distributed
diff --git a/doc/Makefile.am b/doc/Makefile.am
index c970876..3dd3e09 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
## $Id: Makefile.am,v 1.12 2007/11/08 20:58:56 lirc Exp $
-## Process this file with automake to produce Makefile.in
+## Process this file with automake to produce Makefile.in
EXTRA_DIST=lirc.css irxevent.keys lirc.hwdb
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 93235f3..3326707 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,6 +1,6 @@
## $Id: Makefile.am,v 5.20 2009/12/27 19:04:10 lirc Exp $
-## Process this file with automake to produce Makefile.in
+## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)
--
1.8.3.1

@ -0,0 +1,114 @@
From cc6bb81503e7ad71de97c49d9b6adfaca8aeef4b Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Thu, 10 Oct 2013 09:28:34 +0200
Subject: [PATCH 102/105] Update autotools config files.
Kills some warnings while running autoconf and also
replaces some other macros which are deprecated. Add the
standard aclocal include path m4 - without it there is
warnings or worse.
---
Makefile.am | 1 +
configure.ac | 8 ++++----
daemons/Makefile.am | 3 ++-
doc/Makefile.am | 1 +
tools/Makefile.am | 5 ++---
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 409a4df..e237945 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,7 @@
## Process this file with automake to produce Makefile.in
## Makefile.am, (c)1999 Tom Wheeley <tw104@york.ac.uk>
+ACLOCAL_AMFLAGS = -I m4
## we need version 1.5 of automake for DIST_SUBDIRS to work and dist-bzip2.
AUTOMAKE_OPTIONS = 1.5 check-news dist-bzip2
diff --git a/configure.ac b/configure.ac
index e130f1e..af28e4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,12 +3,12 @@ dnl $Id: configure.ac,v 1.44 2010/07/12 03:25:55 jarodwilson Exp $
dnl Process this file with autoconf to produce a configure script.
dnl configure.ac, (c)1999 Tom Wheeley <tw104@york.ac.uk>
-AC_INIT
+AC_INIT([lirc], [0.9.1-git])
AC_CONFIG_SRCDIR([daemons/lircd.c])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(lirc, 0.9.1-git)
-AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE
+AC_CONFIG_HEADERS(config.h)
CFLAGS="${CFLAGS--O2 -g -Wall}"
@@ -21,7 +21,7 @@ AC_PATH_PROG(mknod, mknod, /bin/mknod)
AC_PATH_PROG(mkfifo, mkfifo, /usr/bin/mkfifo)
AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
AC_PROG_LN_S
-AC_PROG_LIBTOOL
+LT_INIT([disable-static])
AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
LIBUSB_CONFIG="pkg-config libusb"
diff --git a/daemons/Makefile.am b/daemons/Makefile.am
index 42873af..314048f 100644
--- a/daemons/Makefile.am
+++ b/daemons/Makefile.am
@@ -1,11 +1,12 @@
## $Id: Makefile.am,v 5.73 2010/05/13 16:23:23 lirc Exp $
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
## these are used by programs in the tools directory, but not by
## programs in this directory. So we must make sure they get distributed
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir)
BUILT_SOURCES = input_map.inc
diff --git a/doc/Makefile.am b/doc/Makefile.am
index c970876..cb02678 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,7 @@
## $Id: Makefile.am,v 1.12 2007/11/08 20:58:56 lirc Exp $
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST=lirc.css irxevent.keys lirc.hwdb
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 3326707..978c388 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,16 +1,15 @@
## $Id: Makefile.am,v 5.20 2009/12/27 19:04:10 lirc Exp $
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
-INCLUDES = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@
EXTRA_PROGRAMS = smode2 xmode2 irxevent
bin_PROGRAMS = irw irpty irexec ircat mode2 irsend \
lircrcd \
@vga_progs@ @x_progs@
-AM_CPPFLAGS = @X_CFLAGS@
-
## simple programs
irw_SOURCES = irw.c
irpty_SOURCES = irpty.c
--
1.8.3.1

@ -0,0 +1,28 @@
From c913583f3d7d166a1cf8505dcb695b88b980a1fc Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Tue, 8 Oct 2013 21:59:01 +0200
Subject: [PATCH 103/105] xmode2.c: Use generic fixed font instead of Courier.
This used to be a sed command in the Fedora spec file. Using
the generic fixed font is simply a better default more
generally available.
---
tools/xmode2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/xmode2.c b/tools/xmode2.c
index b7d858e..27ae7fc 100644
--- a/tools/xmode2.c
+++ b/tools/xmode2.c
@@ -69,7 +69,7 @@ Display *d1;
Window w0, w1; /*w0 = root */
char w1_wname[] = "xmode2";
char w1_iname[] = "xmode2";
-char font1_name[] = "-*-Courier-medium-r-*-*-8-*-*-m-*-iso8859-1";
+char font1_name[]= "-misc-fixed-*-r-*-*-12-*-*-*-*-*-iso8859-1";
int w1_x = 0, w1_y = 0;
unsigned int w1_w = 640, w1_h = 480, w1_border = 0;
--
1.8.3.1

@ -0,0 +1,180 @@
From 171ac321f1e97a60fbda3858c4c84d60d0b7dacb Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Wed, 9 Oct 2013 20:57:12 +0200
Subject: [PATCH 104/105] Add systemd socket activation support.
Since systemd was introduced lirc clients have had problems at
startup when trying to connect to the lircd socket before it's
created. The root cause is the aggressive parallell boot performed
by systemd.
The solution is to add socket activation. In this mode, the socket
is created by systemd and handed over to lircd at startup. The patch
implements this. It should be reasonably transparent.
At configure time it enables systemd support if it's available,
otherwise it's silently ignored.
In runtime lircd looks for and uses a socket handed over by systemd.
If there is no such socket it proceeds as normal.
Adds a dependency on pkg-config for the PKG_CHECK_MODULES macro.
---
configure.ac | 7 +++++
daemons/lircd.c | 94 ++++++++++++++++++++++++++++++++++-----------------------
2 files changed, 63 insertions(+), 38 deletions(-)
diff --git a/configure.ac b/configure.ac
index af28e4f..7df186a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,6 +232,9 @@ AH_TEMPLATE([HAVE_SCSI],
AH_TEMPLATE([HAVE_SOUNDCARD],
[defined if soundcard API is available])
+AH_TEMPLATE([HAVE_SYSTEMD],
+ [defined if systemd API is available])
+
AH_TEMPLATE([HAVE_VSYSLOG],
[define if you have vsyslog( prio, fmt, va_arg )])
@@ -414,6 +417,10 @@ AC_CHECK_HEADERS(linux/i2c-dev.h,[
]
)
+PKG_CHECK_MODULES([SYSTEMD],[libsystemd-daemon],[AC_DEFINE(HAVE_SYSTEMD)],[true])
+CFLAGS="$CFLAGS $SYSTEMD_CFLAGS"
+LIBS="$LIBS $SYSTEMD_LIBS"
+
dnl here we see what driver the user wants.
AC_ARG_WITH(driver,
diff --git a/daemons/lircd.c b/daemons/lircd.c
index 8ace7af..9cde69b 100644
--- a/daemons/lircd.c
+++ b/daemons/lircd.c
@@ -63,6 +63,10 @@
#include "input_map.h"
#endif
+#ifdef HAVE_SYSTEMD
+#include "systemd/sd-daemon.h"
+#endif
+
#if defined __APPLE__ || defined __FreeBSD__
#include <sys/ioctl.h>
#endif
@@ -855,6 +859,7 @@ void start_server(mode_t permission, int nodaemon)
int ret;
int new = 1;
int fd;
+ int n;
/* create pid lockfile in /var/run */
if ((fd = open(pidfile, O_RDWR | O_CREAT, 0644)) == -1 || (pidf = fdopen(fd, "r+")) == NULL) {
@@ -881,51 +886,64 @@ void start_server(mode_t permission, int nodaemon)
(void)ftruncate(fileno(pidf), ftell(pidf));
/* create socket */
- sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
- if (sockfd == -1) {
- fprintf(stderr, "%s: could not create socket\n", progname);
- perror(progname);
+ sockfd = -1;
+#ifdef HAVE_SYSTEMD
+ n = sd_listen_fds(0);
+ if (n > 1) {
+ fprintf(stderr, "Too many file descriptors received.\n");
goto start_server_failed0;
- }
+ exit(1);
+ }
+ else if (n == 1)
+ sockfd = SD_LISTEN_FDS_START + 0;
+#endif
+ if (sockfd == -1) {
+ sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (sockfd == -1) {
+ fprintf(stderr, "%s: could not create socket\n", progname);
+ perror(progname);
+ goto start_server_failed0;
+ }
- /*
- get owner, permissions, etc.
- so new socket can be the same since we
- have to delete the old socket.
- */
- ret = stat(lircdfile, &s);
- if (ret == -1 && errno != ENOENT) {
- fprintf(stderr, "%s: could not get file information for %s\n", progname, lircdfile);
- perror(progname);
- goto start_server_failed1;
- }
- if (ret != -1) {
- new = 0;
- ret = unlink(lircdfile);
- if (ret == -1) {
- fprintf(stderr, "%s: could not delete %s\n", progname, lircdfile);
- perror(NULL);
+ /*
+ get owner, permissions, etc.
+ so new socket can be the same since we
+ have to delete the old socket.
+ */
+ ret = stat(lircdfile, &s);
+ if (ret == -1 && errno != ENOENT) {
+ fprintf(stderr, "%s: could not get file information for %s\n", progname, lircdfile);
+ perror(progname);
goto start_server_failed1;
}
- }
+ if (ret != -1) {
+ new = 0;
+ ret = unlink(lircdfile);
+ if (ret == -1) {
+ fprintf(stderr, "%s: could not delete %s\n", progname, lircdfile);
+ perror(NULL);
+ goto start_server_failed1;
+ }
+ }
- serv_addr.sun_family = AF_UNIX;
- strcpy(serv_addr.sun_path, lircdfile);
- if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == -1) {
- fprintf(stderr, "%s: could not assign address to socket\n", progname);
- perror(progname);
- goto start_server_failed1;
- }
+ serv_addr.sun_family = AF_UNIX;
+ strcpy(serv_addr.sun_path, lircdfile);
+ if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == -1) {
+ fprintf(stderr, "%s: could not assign address to socket\n", progname);
+ perror(progname);
+ goto start_server_failed1;
+ }
- if (new ? chmod(lircdfile, permission)
- : (chmod(lircdfile, s.st_mode) == -1 || chown(lircdfile, s.st_uid, s.st_gid) == -1)
- ) {
- fprintf(stderr, "%s: could not set file permissions\n", progname);
- perror(progname);
- goto start_server_failed1;
- }
+ if (new ? chmod(lircdfile, permission)
+ : (chmod(lircdfile, s.st_mode) == -1 || chown(lircdfile, s.st_uid, s.st_gid) == -1)
+ ) {
+ fprintf(stderr, "%s: could not set file permissions\n", progname);
+ perror(progname);
+ goto start_server_failed1;
+ }
- listen(sockfd, 3);
+ listen(sockfd, 3);
+ }
nolinger(sockfd);
if (useuinput) {
--
1.8.3.1

@ -0,0 +1,115 @@
From 9c384a1a84faea2d17af360a7f227d611f847160 Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec@tests.notat.diaspora.com>
Date: Thu, 10 Oct 2013 09:42:12 +0200
Subject: [PATCH 105/105] Update COPYING to latest version.
As stated on the mailing list, current COPYING has wrong address to the
Free Software Foundation (they have moved) which causes some packaging
noise. Updated from latest version available at
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
---
COPYING | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/COPYING b/COPYING
index 60549be..d159169 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
--
1.8.3.1

@ -0,0 +1,27 @@
From 6470e34d1be9e8be5c275a1e10929cd0f973478b Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas@nowhere.net>
Date: Fri, 11 Oct 2013 06:00:28 +0200
Subject: [PATCH] Revert to 0.9.0
Technically, current release is 0.9.0 + some patches rather than
a 0.9.1 pre-release.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 7df186a..46380a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl $Id: configure.ac,v 1.44 2010/07/12 03:25:55 jarodwilson Exp $
dnl Process this file with autoconf to produce a configure script.
dnl configure.ac, (c)1999 Tom Wheeley <tw104@york.ac.uk>
-AC_INIT([lirc], [0.9.1-git])
+AC_INIT([lirc], [0.9.0])
AC_CONFIG_SRCDIR([daemons/lircd.c])
AC_CONFIG_MACRO_DIR([m4])
--
1.8.3.1

@ -0,0 +1,18 @@
## Fedora README
As of current releases, the Fedora lirc package sports systemd socket
activation. This should fix the problems at startup when clients can't
connect to /var/run/lircd because the lircd service is yet not started.
To start the lircd service using socket activation:
# systemctl enable lircd.socket
# systemctl start lircd.socket
The lircmd is started the usual way:
# systemctl enable lircmd.service
# systemctl start lircmd.service
http://stackoverflow.com/questions/11939255/writing-to-dev-uinput-on-ubuntu-12-04

@ -0,0 +1,7 @@
- Move to -devel (?): irw, *mode2, others?
note: xmode2 inflicts a dependency on X, and smode2 on svgalib
- does someone actually need xmode2/smode2 for something?
- Split utils into subpackage (keep daemons in main package), perhaps also
having the irw, *mode2 etc.
- Don't run as root and/or create dedicated group, reduce fifo permissions?
http://stackoverflow.com/questions/11939255/writing-to-dev-uinput-on-ubuntu-12-04

@ -0,0 +1,2 @@
# Populated config files can be found in the lirc-remotes sub-package
# or at http://lirc.sourceforge.net/remotes/".

@ -1,14 +1,11 @@
# TODO:
# - caraca driver (req: caraca, http://caraca.sf.net/)
# - irman driver (req: libirman, http://lirc.sf.net/software/snapshots/)
# - iguanaIR driver (req: http://iguanaworks.net/ir/usb/installation.shtml)
# -> would cause license change to "GPLv2"
# - move to -devel (?): irw, *mode2, others?
# note: xmode2 inflicts a dependency on X, and smode2 on svgalib
# - does someone actually need xmode2/smode2 for something?
# - split utils into subpackage (keep daemons in main package)
# - don't run as root and/or create dedicated group, reduce fifo permissions?
# - Fixup /etc/lirc(m)d.conf %%ghost'ification, existence after erase etc.
#
# rpmlint warnings:
# only-non-binary-in-usr-lib:
# https://bugzilla.redhat.com/show_bug.cgi?id=794777
# incorrect-fsf-address :
# https://sf.net/mailarchive/forum.php?forum_name=lirc-list&viewmonth=201310
#
%bcond_without alsa
%bcond_without portaudio
@ -16,7 +13,9 @@
%bcond_with svgalib
%bcond_without irman
%bcond_without ftdi
%bcond_with iguanaIR
%bcond_without iguanaIR
%global _hardened_build 1
%global released 1
%define pre pre1
@ -24,58 +23,87 @@
Name: lirc
Version: 0.9.0
%if 0%{?released}
Release: 13%{?dist}
Release: 15%{?dist}
%else
Release: 0.4.%{pre}%{?dist}
Release: 0.2.%{pre}%{?dist}
%endif
Summary: The Linux Infrared Remote Control package
Group: System Environment/Daemons
License: GPLv2+
# Some LGPLv2 files in iguanaIR promoted to GPLv2
License: GPLv2
URL: http://www.lirc.org/
%if 0%{?released}
Source0: http://downloads.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
%else
Source0: http://www.lirc.org/software/snapshots/%{name}-%{version}-%{pre}.tar.bz2
%endif
Source1: %{name}.service
Source2: %{name}.sysconfig
Source3: %{name}md.service
Patch0: lirc-0.9.0-libusb-config-is-no-more.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source1: lircd.service
Source2: lirc.sysconfig
Source3: lircmd.service
Source4: lircd.socket
Source5: lirc.conf
Source6: README.fedora
# Patches 7..17 are from upstream.
Patch7: 0007-Make-lirc_wpc8769l-functional-again.patch
Patch8: 0008-lirc_sir-fix-resource-busy-error-from-bunk-lirc_open.patch
Patch9: 0009-lircd-handle-larger-config-files-in-write_socket-bet.patch
Patch10: 0010-lirc_atiusb-fix-buffer-alloc-to-work-with-new-kfifo.patch
Patch11: 0011-libusb-has-no-libusb-config-any-longer-use-pkg-confi.patch
Patch12: 0012-Silence-some-clang-warnings-courtesy-of-nox.patch
Patch13: 0013-userspace-use-dev-lirc0-as-default-device.patch
Patch14: 0014-lirc-make-chardev-nonseekable.patch
Patch15: 0015-media-lirc_dev-fixes-in-lirc_dev_fop_read.patch
Patch16: 0016-media-lirc_dev-add-some-__user-annotations.patch
Patch17: 0017-media-media-rc-lirc_dev-check-kobject_set_name-resul.patch
Patch18: 0018-Start-lirc-0.9.1-git.patch
# 101-104 is upstream merge request, 101+105
# local support which should no upstream.
Patch100: 0100-configure-ac-revert-to-git-branch.patch
Patch101: 0101-Stripping-some-eol-whitespace.patch
Patch102: 0102-Update-autotools-config-files.patch
Patch103: 0103-xmode2.c-Use-generic-fixed-font-instead-of-Courier.patch
Patch104: 0104-Add-systemd-socket-activation-support.patch
Patch105: 0105-configure-ac-back-to-0.9.0.patch
BuildRequires: %{__perl}
BuildRequires: libusb-devel, libusb1-devel, python-devel
BuildRequires: automake libtool
%if %{with irman}
BuildRequires: libirman-devel
Buildrequires: autoconf
BuildRequires: automake
%if %{with alsa}
BuildRequires: alsa-lib-devel
%endif
%if %{with iguanaIR}
BuildRequires: iguanaIR-devel
%endif
%if %{with ftdi}
BuildRequires: libftdi-devel
%endif
%if %{with alsa}
BuildRequires: alsa-lib-devel
%if %{with irman}
BuildRequires: libirman-devel
%endif
BuildRequires: libtool
BuildRequires: libusb-devel
BuildRequires: libusb1-devel
%if %{with x}
BuildRequires: libXt-devel
%endif
%if %{with portaudio}
BuildRequires: portaudio-devel >= 19
%endif
BuildRequires: python2-devel
%if %{with svgalib}
BuildRequires: svgalib-devel
%endif
%if %{with x}
BuildRequires: libXt-devel
%endif
%if %{with iguanaIR}
BuildRequires: iguanaIR-devel
%endif
BuildRequires: systemd-devel
Requires: %{name}-libs = %{version}-%{release}
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
#for triggerun
Requires(post): systemd-sysv
Requires(post): systemd
#for triggerun
Requires(post): systemd-sysv
Requires(postun): systemd
Requires(preun): systemd
%description
LIRC is a package that allows you to decode and send infra-red and
@ -87,8 +115,6 @@ computer with a remote control.
%package libs
Summary: LIRC libraries
Group: System Environment/Libraries
# Fix old F8 multilib upgrade path issue
Obsoletes: %{name} < 0.8.3
%description libs
LIRC is a package that allows you to decode and send infra-red and
@ -136,19 +162,42 @@ computer with a remote control. This package contains a collection
of remote control configuration files.
# Don't provide or require anything from _docdir, per policy.
%global __provides_exclude_from ^%{_docdir}/.*$
%global __requires_exclude_from ^%{_docdir}/.*$
%prep
%if 0%{?released}
%setup -q
%else
%setup -q -n %{name}-%{version}-%{pre}
%endif
%patch0 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
chmod 644 contrib/*
chmod +x contrib/hal
chmod +x daemons/input_map.sh
sed -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc
sed -i -e 's|/sbin/init.d/lircd|%{_initrddir}/lirc|' contrib/lircs
for f in remotes/chronos/lircd.conf.chronos \
@ -157,34 +206,12 @@ for f in remotes/chronos/lircd.conf.chronos \
iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
done
# use /dev/lirc0 by default instead of /dev/lirc
sed -i -e 's|#define DEV_LIRC "lirc"|#define DEV_LIRC "lirc0"|' config.h.in
# use fixed instead of Courier w/xmode2, should be more prevalent on linux boxen
sed -i -e 's|char.*font1_name.*Courier.*$|char font1_name[]="-misc-fixed-*-r-*-*-12-*-*-*-*-*-iso8859-1";|g' tools/xmode2.c
sed -i -e 's|"/lib /usr/lib |"/%{_lib} %{_libdir} |' configure # lib64 rpath
# *cough* I wish there was a good way to disable alsa/portaudio/svgalib...
%if ! %{with alsa}
sed -i -e 's/asoundlib.h/ALSA_DISABLED/g' configure*
%endif
%if ! %{with portaudio}
sed -i -e 's/portaudio.h/PORTAUDIO_DISABLED/g' configure*
%endif
%if ! %{with svgalib}
sed -i -e 's/vga.h/SVGALIB_DISABLED/g' configure*
%endif
touch -r aclocal.m4 configure.ac # avoid autofoo re-run
# Re-run autofoo for new cvs features
#autoreconf -i -f
#automake
chmod +x daemons/input_map.sh
%build
autoreconf -fi
%configure \
--libdir=%{_libdir} \
--disable-static \
--disable-dependency-tracking \
--enable-sandboxed \
@ -193,15 +220,27 @@ chmod +x daemons/input_map.sh
%endif
--with-syslog=LOG_DAEMON \
--with-driver=userspace
# make %{?_smp_mflags}
# make %%{?_smp_mflags}
# parallel makes are currently busted, do single-threaded for now
make
%install
rm -rf $RPM_BUILD_ROOT __docs
%install
make install DESTDIR=$RPM_BUILD_ROOT
install -pm 755 contrib/irman2lirc $RPM_BUILD_ROOT%{_bindir}
install -Dpm 644 doc/lirc.hwdb $RPM_BUILD_ROOT%{_datadir}/lirc/lirc.hwdb
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/lircd.service
install -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/lircmd.service
install -Dpm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/lircd.socket
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lirc
install -Dpm 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/lirc/lircd.conf
install -Dpm 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/lirc/lircmd.conf
cp -a %{SOURCE6} README.fedora
# Put remote definitions in place
cp -ar remotes $RPM_BUILD_ROOT%{_datadir}/lirc-remotes
rm $RPM_BUILD_ROOT%{_libdir}/liblirc_client.la
%if ! %{with svgalib}
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smode2.1*
%endif
@ -210,75 +249,28 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/irxevent.1*
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/xmode2.1*
%endif
install -Dpm 644 doc/lirc.hwdb $RPM_BUILD_ROOT%{_datadir}/lirc/lirc.hwdb
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/lirc.service
install -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/lircmd.service
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
mkdir __docs
rm -rf __docs; mkdir __docs
cp -pR doc contrib __docs
cd __docs
rm -rf doc/Makefile* doc/.libs doc/man* doc/lirc.hwdb
rm -rf contrib/irman2lirc contrib/lirc.* contrib/sendxevent.c
cd ..
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/lirc
for f in lircd.conf lircmd.conf
do
echo "# Populated config files can be found in the lirc-remotes sub-package
# or at http://lirc.sourceforge.net/remotes/" > $RPM_BUILD_ROOT%{_sysconfdir}/lirc/$f
done
install -dm 755 $RPM_BUILD_ROOT%{_localstatedir}/run/lirc/
touch $RPM_BUILD_ROOT%{_localstatedir}/run/lirc/lirc{d,m}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
echo "d %{_localstatedir}/run/lirc 0755 root root 10d" > $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/lirc.conf
rm $RPM_BUILD_ROOT%{_libdir}/liblirc_client.la
# Put remote definitions in place
cp -ar remotes $RPM_BUILD_ROOT%{_datadir}/lirc-remotes
%clean
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/tmpfiles.d
echo "d /var/run/lirc 0755 root root 10d" \
> $RPM_BUILD_ROOT/etc/tmpfiles.d/lirc.conf
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
# If we're upgrading, move config files into their new location, if need be
if [ $1 -ge 2 ] ; then
if [ -e %{_sysconfdir}/lircd.conf -a ! -e %{_sysconfdir}/lirc/lircd.conf ]; then
mv %{_sysconfdir}/lircd.conf %{_sysconfdir}/lirc/lircd.conf
fi
if [ -e %{_sysconfdir}/lircmd.conf -a ! -e %{_sysconfdir}/lirc/lircmd.conf ]; then
mv %{_sysconfdir}/lircmd.conf %{_sysconfdir}/lirc/lircmd.conf
fi
fi
%systemd_post lircd.service lircmd.service
%post libs -p /sbin/ldconfig
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable lirc.service > /dev/null 2>&1 || :
/bin/systemctl stop lirc.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable lircmd.service > /dev/null 2>&1 || :
/bin/systemctl stop lircmd.service > /dev/null 2>&1 || :
fi
%systemd_preun lircd.service lircmd.service
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart lirc.service >/dev/null 2>&1 || :
/bin/systemctl try-restart lircmd.service >/dev/null 2>&1 || :
fi
%systemd_postun_with_restart lircd.service lircmd.servic
%postun libs -p /sbin/ldconfig
@ -291,54 +283,64 @@ fi
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del lirc >/dev/null 2>&1 || :
/bin/systemctl try-restart lirc.service >/dev/null 2>&1 || :
/bin/systemctl try-restart lircd.service >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO
%config(noreplace) %{_sysconfdir}/lirc/lirc*d.conf
%config(noreplace) %{_sysconfdir}/sysconfig/lirc
%config(noreplace) %{_sysconfdir}/tmpfiles.d/lirc.conf
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO README.fedora
%dir /etc/lirc
%config(noreplace) /etc/lirc/lirc*d.conf
%config(noreplace) /etc/sysconfig/lirc
%config(noreplace) /etc/tmpfiles.d/lirc.conf
%{_unitdir}/lirc*
%{_bindir}/*ir*
%{_bindir}/*mode2
%{_sbindir}/lirc*d
%dir %{_datadir}/lirc/
%{_datadir}/lirc/
%{_mandir}/man1/*ir*.1*
%{_mandir}/man1/*mode2*.1*
%{_mandir}/man8/lirc*d.8*
%dir %{_localstatedir}/run/lirc/
%ghost %{_localstatedir}/run/lirc/lirc*
%files libs
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/liblirc_client.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/lirc/
%{_libdir}/liblirc_client.so
%files doc
%defattr(-,root,root,-)
%doc __docs/* COPYING
%files remotes
%defattr(-,root,root,-)
%dir %{_datadir}/lirc-remotes
%{_datadir}/lirc-remotes/*
%doc AUTHORS ChangeLog COPYING README
%{_datadir}/lirc-remotes
%changelog
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.9.0-12
- Perl 5.18 rebuild
* Thu Oct 10 2013 Alec Leamas <leamas.alec@nowhere.net> - 0.9.0-15
- Actually use sysconfig files (881976)
- Modify lirc.service to not fork.
- Add support for iguanaIR driver (#954146).
- Add hardened build flag (955144).
- Use actual systemd macros (850191).
- Clean up some nowadays not used directives.
- Run autoreconf by default (926082).
- Cleanup some obsoleted autotools usage, two new patches.
- Deactivate other decoders on start (923978).
- Filter away docdir dependencies.
- Remove obsolete F8 upgrade Obsoletes: (sic!).
- Fix inconsistent/duplicate /usr/share/lirc in %%files.
- Add %%doc (notably COPYING) to remotes subpackage.
- Claim /etc/lirc.
- Update to latest upstream (10 patches).
- Use /var and /etc instead of %%{_sysconfdir} and %%{localstatedir}.
- Removed obsolete code to move config files to /etc/lirc in %%post.
- Renamed main systemd service: lirc.service -> lircd.service.
- Added socket activation support.
- Don't claim temporary files in /run/lirc, they are just transient.
- Initiate lircd.conf, lircmd.conf from external template.
- Bumping release, 14 is published.
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
@ -638,7 +640,7 @@ fi
- Update to 0.7.0; major rework of the package:
- Change default driver to "any".
- Add -devel subpackage.
- Improve init script, add %%{_sysconfdir}/sysconfig/lirc for options.
- Improve init script, add /etc/sysconfig/lirc for options.
- Rename init script to "lirc" to follow upstream; the script is not only
for lircd, but lircmd as well.
- Log to syslog instead of separate log file.

@ -8,16 +8,15 @@ LIRCD_OPTIONS=""
# The infrared receiver (and/or transmitter) driver to be used by lircd(8),
# similar to passing "-H driver" to lircd(8).
# Run "/usr/sbin/lircd -H help" to get a listing of supported drivers.
LIRC_DRIVER=""
LIRC_DRIVER="default"
# Which lirc device will be used by lircd(8).
# This is the same as passing "-d device" to lircd.
# An empty value will use the default /dev/lirc0 device.
LIRC_DEVICE=""
LIRC_DEVICE="/dev/lirc0"
# If "yes", the init script will try to start lircmd(8) too.
ENABLE_LIRCMD="no"
# Options to lircmd(8).
LIRCMD_OPTIONS=""
# Options to lircmd(8). The default --version effectively disables
# lircmd, setting it to "" enables it with default options. lircmd
# always runs with --nodaemon added to LIRCMD_OPTIONS.
LIRCMD_OPTIONS="--version"

@ -0,0 +1,13 @@
[Unit]
Description=LIRC Infrared Signal Decoder
After=network.target
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/lirc
ExecStartPre=/bin/sh -c 'echo lirc > /sys/class/rc/rc0/protocols'
ExecStart=/usr/sbin/lircd $LIRCD_OPTIONS \
--driver $LIRC_DRIVER --device $LIRC_DEVICE --nodaemon
[Install]
WantedBy=multi-user.target

@ -0,0 +1,6 @@
[Socket]
ListenStream=/run/lirc/lircd
[Install]
WantedBy=sockets.target

@ -4,8 +4,9 @@ Requires=lirc.service
After=network.target lirc.service
[Service]
Type=forking
ExecStart=/usr/sbin/lircmd
Type=simple
EnvironmentFile=-/etc/sysconfig/lirc
ExecStart=/usr/sbin/lircmd $LIRCMD_OPTIONS --nodaemon
[Install]
WantedBy=multi-user.target

Loading…
Cancel
Save