Sync from SUSE:ALP:Source:Standard:1.0 lirc revision 8f1030650cd8c9c58e37d08c65c2d7a9

This commit is contained in:
Adrian Schröter 2023-10-18 20:23:12 +02:00
commit 178498492a
12 changed files with 17176 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

4
baselibs.conf Normal file
View File

@ -0,0 +1,4 @@
liblirc_client0
obsoletes "lirc-<targettype> < 0.8.5"
liblirc_driver0
liblirc0

View File

@ -0,0 +1,20 @@
Index: lirc-0.10.1/systemd/irexec.service
===================================================================
--- lirc-0.10.1.orig/systemd/irexec.service
+++ lirc-0.10.1/systemd/irexec.service
@@ -5,6 +5,15 @@ Documentation=http://lirc.org/html/confi
Description=Handle events from IR remotes decoded by lircd(8)
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
; user=lirc
; group=lirc

View File

@ -0,0 +1,20 @@
Index: lirc-0.10.1/systemd/lircd-uinput.service
===================================================================
--- lirc-0.10.1.orig/systemd/lircd-uinput.service
+++ lirc-0.10.1/systemd/lircd-uinput.service
@@ -5,6 +5,15 @@ Documentation=http://lirc.org/html/confi
Description=Forward LIRC button presses as uinput events
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
Type=simple
ExecStart=/usr/sbin/lircd-uinput
; user=lirc

View File

@ -0,0 +1,21 @@
Index: lirc-0.10.1/systemd/lircd.service
===================================================================
--- lirc-0.10.1.orig/systemd/lircd.service
+++ lirc-0.10.1/systemd/lircd.service
@@ -6,6 +6,16 @@ Wants=lircd-setup.service
After=network.target lircd-setup.service
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
+#
Type=simple
ExecStart=/usr/sbin/lircd --nodaemon
; User=lirc

View File

@ -0,0 +1,20 @@
Index: lirc-0.10.1/systemd/lircmd.service
===================================================================
--- lirc-0.10.1.orig/systemd/lircmd.service
+++ lirc-0.10.1/systemd/lircmd.service
@@ -5,6 +5,15 @@ Documentation=http://lirc.org/html/confi
Description=Convert IR remotes button presses to mouse movements and clicks
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
Type=simple
ExecStart=/usr/sbin/lircmd --nodaemon
; user=lirc

BIN
lirc-0.10.1.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

15384
lirc-autoconf-py310.patch Normal file

File diff suppressed because it is too large Load Diff

1180
lirc.changes Normal file

File diff suppressed because it is too large Load Diff

378
lirc.spec Normal file
View File

@ -0,0 +1,378 @@
#
# spec file for package lirc
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%bcond_with portaudio_drv
%define _udevdir %(pkg-config --variable udevdir udev)
%if ! %{defined _rundir}
%define _rundir /run
%endif
Name: lirc
Version: 0.10.1
Release: 0
Summary: Tools for Infrared Receivers
License: GPL-2.0-or-later
Group: Hardware/Other
URL: http://www.lirc.org/
Source0: https://downloads.sourceforge.net/project/lirc/LIRC/%{version}/lirc-%{version}.tar.bz2
Source1: baselibs.conf
Patch0: reproducible.patch
Patch1: harden_irexec.service.patch
Patch2: harden_lircd-uinput.service.patch
Patch3: harden_lircd.service.patch
Patch4: harden_lircmd.service.patch
# PATCH-FIX-UPSTREAM pyyaml-60-compatibility.patch sht#lirc#365 mcepl@suse.com
# Makes the package compatible with PyYAML 6.0+
Patch5: pyyaml-60-compatibility.patch
# PATCH-FIX-OPENSUSE lirc-autoconf-py310.patch, ran autoreconf for finding python 3.10
Patch6: lirc-autoconf-py310.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gobject-introspection
BuildRequires: kmod-compat
BuildRequires: libxslt-tools
# for hw_atilibusb driver
BuildRequires: pkgconfig
BuildRequires: python3-PyYAML
BuildRequires: python3-base
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(libftdi1)
BuildRequires: pkgconfig(libirman)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libusb-1.0)
%if %{with portaudio_drv}
BuildRequires: pkgconfig(portaudio-2.0)
%endif
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(x11)
Requires: udev
Recommends: lirc-remotes
Suggests: lirc-kmp
Supplements: lirc-kmp
%ifnarch s390 s390x
# for hw_i2cuser driver
BuildRequires: linux-kernel-headers
%endif
%description
LIRC is a package that supports receiving and sending IR signals with
the most common IR remote controls. It contains a daemon that decodes
and sends IR signals, a mouse daemon that translates IR signals to
mouse movements, and a couple of user programs that allow you to
control your computer with a remote control.
%package core
Summary: LIRC core, always needed to run LIRC
License: GPL-2.0-or-later
Group: Hardware/Other
Requires(pre): shadow
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
%{?systemd_requires}
%description core
The LIRC core contains the lircd daemons, the devinput and
default driver and most of the applications.
%package config
Summary: LIRC Configuration Tools and Data
License: GPL-2.0-or-later
Group: Hardware/Other
Requires: lirc-core = %{version}
Requires: python3-PyYAML
Requires: python3-gobject
Provides: %{name}-remotes = %{version}
Obsoletes: %{name}-remotes < %{version}
BuildArch: noarch
%description config
The LIRC config package contains tools and data to ease the
LIRC configuration process.
%package devel
Summary: LIRC development files
License: GPL-2.0-or-later
Group: Development/Libraries/C and C++
Requires: libirrecord0 = %{version}
Requires: liblirc0 = %{version}
Requires: liblirc_client0 = %{version}
Requires: liblirc_driver0 = %{version}
%description devel
LIRC is a package that supports receiving and sending IR signals with
the most common IR remote controls. It contains a daemon that decodes
and sends IR signals, a mouse daemon that translates IR signals to
mouse movements, and a couple of user programs that allow you to
control your computer with a remote control.
%package -n liblirc_client0
Summary: LIRC client library
License: GPL-2.0-or-later
Group: Hardware/Other
%description -n liblirc_client0
The LIRC client library. To actually use LIRC the lircd daemon from
the 'lirc' package has to be configured and started.
%package -n liblirc_driver0
Summary: LIRC driver library
License: GPL-2.0-or-later
Group: Hardware/Other
%description -n liblirc_driver0
The LIRC driver library. To actually use the lirc plugins.
%package -n libirrecord0
Summary: LIRC record library
License: GPL-2.0-or-later
Group: Hardware/Other
%description -n libirrecord0
The LIRC record library. To actually use the lirc plugins.
%package -n liblirc0
Summary: LIRC driver library
License: GPL-2.0-or-later
Group: Hardware/Other
%description -n liblirc0
The LIRC library. LIRC is a package that supports receiving
and sending IR signals with the most common IR remote controls.
%package disable-kernel-rc
Summary: Disable kernel ir device handling in favor of lirc
License: GPL-2.0-or-later
Group: Hardware/Other
Requires: %{name}-core = %{version}-%{release}
Recommends: lirc-core = %{version}
%description disable-kernel-rc
Udev rule which disables the kernel built-in handling of infrared devices
(i. e., rc* ones) by making lirc the only used protocol.
%package drv-ftdi
Summary: Ftdi LIRC User-Space Driver
License: GPL-2.0-or-later
Group: Hardware/Other
Requires: lirc-core = %{version}
%description drv-ftdi
LIRC user-space driver which works together with the kernel, providing
full support for the ftdi device.
%package drv-portaudio
Summary: Portaudio LIRC User-Space Driver
License: LGPL-2.0-only
Group: Hardware/Other
Requires: lirc-core = %{version}
%description drv-portaudio
LIRC user space driver which supports a IR receiver in microphone input
using the portaudio library.
%package tools-gui
Summary: LIRC GUI tools
License: GPL-2.0-or-later
Group: Hardware/Other
Requires: lirc-core = %{version}
Requires: xorg-x11-fonts-core
%description tools-gui
Some seldom used X11-based tools for debugging lirc configurations.
%prep
%autosetup -p1
# fix up timestamps from patching (lirc-autoconf-py310.patch)
touch tools/Makefile.in
# Don't provide or require anything from _docdir, per policy.
%global __provides_exclude_from ^%{_docdir}/.*$
%global __requires_exclude_from ^%{_docdir}/.*$
sed -i -e 's|/usr/local/etc/|%{_sysconfdir}/|' contrib/irman2lirc
sed -i -e 's/#effective-user/effective-user /' lirc_options.conf
sed -i -e '/^effective-user/s/=$/= lirc/' lirc_options.conf
sed -i -e "1{s|/usr/bin/env bash|$(which bash)|}" \
tools/lirc-config-tool \
tools/lirc-make-devinput
%build
%configure --enable-devinput
make %{?_smp_mflags}
%install
%make_install
chmod a+x %{buildroot}%{_bindir}/pronto2lirc
# Create backward compatibility symlink
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}d
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}md
mkdir -p %{buildroot}%{_tmpfilesdir}
echo "d /run/lirc 0755 root root 10d" \
> %{buildroot}/%{_tmpfilesdir}/lirc.conf
#
# udev stuff
install -d -m 755 %{buildroot}/%{_udevdir}/rules.d
install -Dpm 644 contrib/60-lirc.rules \
%{buildroot}%{_udevrulesdir}/60-lirc.rules
#
install -Dpm 644 contrib/99-remote-control-lirc.rules \
%{buildroot}%{_udevrulesdir}/99-remote-control-lirc.rules
# get rid of libtool file
find %{buildroot} -type f -name "*.la" -delete -print
#
#
# Don't install documentation in a non standard directory
rm -rf %{buildroot}%{_datadir}/doc
# hide python dependency
chmod a+x %{buildroot}%{_bindir}/pronto2lirc
mkdir -p %{buildroot}%{_rundir}
# Remove old %%{_rundir}; deprecated but still installed by lirc, which is not looking for it
rm -rf %{buildroot}%{_localstatedir}
# Remove contrib folder; we will copy it into doc directory
rm -rf %{buildroot}%{_datadir}/lirc/contrib
#
rm -rf %{buildroot}%{_datadir}/lirc/plugindocs
#
rm -rf contrib/.release-process.txt.swp
# remove sources
rm -rf %{buildroot}/%{_datadir}/lirc/lirc-%{version}.tar.gz %{buildroot}/%{_datadir}/lirc/python-pkg
%fdupes -s %{buildroot}
%fdupes -s .
%post -n liblirc_client0 -p /sbin/ldconfig
%post -n liblirc_driver0 -p /sbin/ldconfig
%post -n liblirc0 -p /sbin/ldconfig
%post -n libirrecord0 -p /sbin/ldconfig
%postun -n liblirc_client0 -p /sbin/ldconfig
%postun -n liblirc_driver0 -p /sbin/ldconfig
%postun -n liblirc0 -p /sbin/ldconfig
%postun -n libirrecord0 -p /sbin/ldconfig
%pre core
getent group lirc >/dev/null || groupadd -r lirc
getent passwd lirc >/dev/null || \
useradd -r -g lirc -d %{_localstatedir}/log/lirc -s /sbin/nologin \
-c "LIRC daemon user, runs lircd." lirc
usermod -a -G dialout lirc &> /dev/null || :
usermod -a -G lock lirc &> /dev/null || :
usermod -a -G input lirc &> /dev/null || :
%service_add_pre lircd.service lircmd.service lircd-uinput.service lircd-setup.service lircd.socket irexec.service
%post core
%service_add_post lircd.service lircmd.service lircd-uinput.service lircd-setup.service lircd.socket irexec.service
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%preun core
%service_del_preun lircd.service lircmd.service lircd-uinput.service lircd-setup.service lircd.socket irexec.service
%postun core
%service_del_postun lircd.service lircmd.service lircd-uinput.service lircd-setup.service lircd.socket irexec.service
%files core
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%doc doc/html doc/lirc.hwdb doc/irxevent.keys
%doc contrib
%dir %{_datadir}/%{name}
%dir %{_libdir}/%{name}
%dir %ghost %{_rundir}/lirc
%ghost %{_rundir}/lirc/lircm
%ghost %{_rundir}/lirc/lircd
%exclude %{_bindir}/irxevent
%exclude %{_bindir}/xmode2
%{_bindir}/*
%{_datadir}/%{name}/lirc.hwdb
%{_sbindir}/*
%{_udevdir}/rules.d/60-%{name}.rules
%{_libdir}/%{name}/plugins
%exclude %{_libdir}/%{name}/plugins/ftdi.so
%exclude %{_libdir}/%{name}/plugins/audio.so
%exclude %{_mandir}/man1/irxevent.*
%exclude %{_mandir}/man1/xmode2.*
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%{python3_sitearch}/lirc
%{python3_sitearch}/lirc-setup
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/lircd.conf.d
%config(noreplace,missingok) %{_sysconfdir}/%{name}/lircd.conf
%config(noreplace,missingok) %{_sysconfdir}/%{name}/lircmd.conf
%config(noreplace,missingok) %{_sysconfdir}/%{name}/lirc_options.conf
%config(noreplace,missingok) %{_sysconfdir}/%{name}/lircd.conf.d/README.conf.d
%config(noreplace,missingok) %{_sysconfdir}/%{name}/lircd.conf.d/devinput.lircd.conf
%config(noreplace,missingok) %{_sysconfdir}/%{name}/irexec.lircrc
%{_unitdir}/lirc*
%{_unitdir}/irexec.service
%{_tmpfilesdir}/lirc.conf
%files devel
%dir %{_includedir}/lirc
%{_includedir}/lirc/*
%{_includedir}/lirc_client.h
%{_includedir}/lirc_driver.h
%{_includedir}/lirc_private.h
%{_libdir}/liblirc.so
%{_libdir}/libirrecord.so
%{_libdir}/liblirc_client.so
%{_libdir}/liblirc_driver.so
%{_libdir}/pkgconfig/lirc-driver.pc
%{_libdir}/pkgconfig/lirc.pc
%if %{with portaudio_drv}
%files drv-portaudio
%{_libdir}/lirc/plugins/audio.so
%{_datadir}/lirc/configs/audio.conf
%endif
%files drv-ftdi
%{_libdir}/lirc/plugins/ftdi.so
%{_datadir}/lirc/configs/ftdi.conf
%files config
%{_datadir}/lirc/configs
%exclude %{_datadir}/lirc/configs/ftdi.conf
%exclude %{_datadir}/lirc/configs/audio.conf
%files -n liblirc0
%{_libdir}/liblirc.so.*
%files -n liblirc_client0
%{_libdir}/liblirc_client.so.*
%files -n liblirc_driver0
%{_libdir}/liblirc_driver.so.*
%files -n libirrecord0
%{_libdir}/libirrecord.so.*
%files disable-kernel-rc
%{_udevrulesdir}/99-remote-control-lirc.rules
%files tools-gui
%{_bindir}/xmode2
%{_bindir}/irxevent
%{_mandir}/man1/irxevent*
%{_mandir}/man1/xmode2.1%{?ext_man}
%changelog

View File

@ -0,0 +1,53 @@
---
python-pkg/lirc/database.py | 8 ++++----
tools/check_configs.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/python-pkg/lirc/database.py
+++ b/python-pkg/lirc/database.py
@@ -66,7 +66,7 @@ def _load_kerneldrivers(configdir):
'''
with open(os.path.join(configdir, "kernel-drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
drivers = cf['drivers'].copy()
for driver in cf['drivers']:
if driver == 'default':
@@ -132,14 +132,14 @@ class Database(object):
yamlpath = configdir
db = {}
with open(os.path.join(yamlpath, "confs_by_driver.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
db['lircd_by_driver'] = cf['lircd_by_driver'].copy()
db['lircmd_by_driver'] = cf['lircmd_by_driver'].copy()
db['kernel-drivers'] = _load_kerneldrivers(configdir)
db['drivers'] = db['kernel-drivers'].copy()
with open(os.path.join(yamlpath, "drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
db['drivers'].update(cf['drivers'].copy())
for key, d in db['drivers'].items():
d['id'] = key
@@ -158,7 +158,7 @@ class Database(object):
configs = {}
for path in sorted(glob.glob(configdir + '/*.conf')):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
configs[cf['config']['id']] = cf['config']
db['configs'] = configs
self.db = db
--- a/tools/check_configs.py
+++ b/tools/check_configs.py
@@ -9,7 +9,7 @@ def main():
configs = {}
for path in glob.glob('*.conf'):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
if cf['config']['id'] + '.conf' != path:
print( "Id: %s, path: %s" % (cf['config']['id'], path))
configs[cf['config']['id']] = cf['config']

70
reproducible.patch Normal file
View File

@ -0,0 +1,70 @@
https://sourceforge.net/p/lirc/tickets/301/
https://sourceforge.net/p/lirc/git/merge-requests/33/
https://sourceforge.net/p/lirc/git/merge-requests/34/
https://sourceforge.net/p/lirc/git/merge-requests/36/
Index: lirc-0.10.1/tools/lirc-lsplugins.cpp
===================================================================
--- lirc-0.10.1.orig/tools/lirc-lsplugins.cpp
+++ lirc-0.10.1/tools/lirc-lsplugins.cpp
@@ -415,10 +415,9 @@ static void print_header(void)
static void print_yaml_header(void)
{
static const char* const YAML_HEADER =
- "#\n# Generated by lirc-lsplugins --yaml (%s) at %s#\n ";
- const time_t now = time(NULL);
+ "#\n# Generated by lirc-lsplugins --yaml (%s)#\n ";
- printf(YAML_HEADER, VERSION, ctime(&now));
+ printf(YAML_HEADER, VERSION);
printf("\ndrivers:\n");
}
Index: lirc-0.10.1/python-pkg/lirc/database.py
===================================================================
--- lirc-0.10.1.orig/python-pkg/lirc/database.py
+++ lirc-0.10.1/python-pkg/lirc/database.py
@@ -156,7 +156,7 @@ class Database(object):
d['device_hint'] = hint
configs = {}
- for path in glob.glob(configdir + '/*.conf'):
+ for path in sorted(glob.glob(configdir + '/*.conf')):
with open(path) as f:
cf = yaml.load(f.read())
configs[cf['config']['id']] = cf['config']
Index: lirc-0.10.1/tools/irdb-get
===================================================================
--- lirc-0.10.1.orig/tools/irdb-get
+++ lirc-0.10.1/tools/irdb-get
@@ -9,7 +9,6 @@ import fnmatch
import os
import os.path
import sys
-import time
import urllib.error # pylint: disable=no-name-in-module,F0401,E0611
import urllib.request # pylint: disable=no-name-in-module,F0401,E0611
@@ -193,7 +192,7 @@ def do_yaml_config():
lircmd_by_driver[driver].append("%s/%s" % (tokens[0], tokens[2]))
print("#")
- print("# Created by 'irdb-get yaml-config' at " + time.ctime())
+ print("# Created by 'irdb-get yaml-config'")
print("#")
print("\nlircd_by_driver:")
print_yaml_dict(lircd_by_driver)
Index: lirc-0.10.1/tools/lirc-make-devinput
===================================================================
--- lirc-0.10.1.orig/tools/lirc-make-devinput
+++ lirc-0.10.1/tools/lirc-make-devinput
@@ -61,8 +61,7 @@ if test -n "$lirc_map"; then
fi
-echo "# Generated by $(basename $0) on $(uname -r)"
-echo "# Date: $(date)"
+echo "# Generated by $(basename $0)"
cat <<EOF
begin remote