%bcond_with systemd %global _udevrulesdir /lib/udev/rules.d # Don't provide or require anything from _docdir, per policy. %global __provides_exclude_from ^%{_docdir}/.*$ %global __requires_exclude_from ^%{_docdir}/.*$ Summary: The Linux Infrared Remote Control package. Summary(ja): 赤外線リモートコントロールパッケージ Name: lirc Version: 0.10.1 Release: 1%{?_dist_release}%{?with_systemd:.systemd} Group: system Vendor: Project Vine Distribution: Vine Linux Packager: owa, kazutaka # lib/ciniparser* and lib/dictionary* are BSD, others GPLv2 License: GPLv2 and BSD URL: https://www.lirc.org/ Source0: https://prdownloads.sourceforge.net/lirc/%{name}-%{version}.tar.bz2 Source1: lirc.init Source2: lircd.logrotate Source3: lirc.sysconfig Source4: 99-remote-control-lirc.rules Patch2: 0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch Patch6: 0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch # Vine patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: perl BuildRequires: libusb1-devel BuildRequires: automake libtool BuildRequires: alsa-lib-devel BuildRequires: libXt-devel BuildRequires: libxslt BuildRequires: python3-devel BuildRequires: python3-rpm-macros BuildRequires: python3-setuptools ## Currently not supportd (yet) for Vine Linux #BuildRequires: libftdi-devel, libirman-devel %if %{with systemd} BuildRequires: systemd-devel %{?systemd_requires} %else Requires(post): /sbin/chkconfig Requires(post): /sbin/ldconfig Requires(preun): /sbin/chkconfig Requires(postun): /sbin/ldconfig %endif %description LIRC stands for 'Linux Infra-red Remote Control'. This package provides the daemons and some utilities to support infra-red remote controls under Linux. %description -l ja LIRC は 'Linux Infra-red Remote Control' の略です。 このパッケージには Linux で赤外線リモコンをサポートする為に 必要なデーモンといくつかのユーティリティが含まれています。 %package devel Summary: Development files for LIRC Summary(ja): LIRCを用いた開発用のファイル Group: programming Requires: lirc = %{version}-%{release} %description devel LIRC is a package that allows you to decode and send infra-red and other signals of many (but not all) commonly used remote controls. Included applications include daemons which decode the received signals as well as user space applications which allow controlling a computer with a remote control. This package includes files for developing applications that use LIRC. %package -n dkms-%{name} Summary: Kernel modules for LIRC Group: system Requires(post): dkms Requires(preun):dkms %description -n dkms-%{name} This package provides the kernel modules for LIRC. Install this package if the LIRC driver you are using requires them and your kernel doesn't include them. Note that lirc_gpio and lirc_parallel are in packages of their own. %description -n dkms-%{name} -l ja このパッケージには LIRC 用のカーネルモジュールが含まれています。 もしあなたが使っている赤外線リモコン用のドライバがカーネルに 含まれていない場合は、このパッケージをインストールしてください。 注記: lirc_gpio と lirc_parallel は別のパッケージになっています。 ## This package up (uni processor) kernel, but only smp kernel is supplied officially. ## So we don't create this sub package. #%package -n dkms-%{name}-parallel #Summary: Parallel port module for LIRC #Group: System/Kernel and hardware #Requires: dkms-%{name} = %version #Requires(post): dkms #Requires(preun):dkms # #%description -n dkms-%{name}-parallel #This package provides the parallel port module for LIRC. # #This module requires a non-SMP kernel. # #%description -n dkms-%{name}-parallel -l ja #このパッケージにはパラレルポート接続の LIRC 用のカーネル #モジュールが含まれています。 # #このモジュールは SMP カーネルでは使用できません。 ## Required header files (bttv.h ...) are not included in kernel-devel. ## So we can't build this package (now?). #%package -n dkms-%{name}-gpio #Summary: GPIO module for LIRC #Group: System/Kernel and hardware #Requires: dkms-%{name} = %version #Requires(post): dkms #Requires(preun):dkms # #%description -n dkms-%{name}-gpio #This package provides the GPIO module for LIRC. # #%description -n dkms-%{name}-gpio -l ja #このパッケージには GPIO 接続の LIRC 用のカーネルモジュールが #含まれています。 %prep %autosetup -p1 -n %{name}-%{version}%{?tag:-}%{?tag} sed -i -e 's/#effective-user/effective-user /' lirc_options.conf sed -i -e '/^effective-user/s/=$/= lirc/' lirc_options.conf sed -i '/User=/s/; *//' systemd/lircd.service sed -i '/Group=/s/; *//' systemd/lircd.service sed -i 's/; *user=/User=/' systemd/irexec.service sed -i 's/; *group=/Group=/' systemd/irexec.service sed -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc %build autoreconf -if %configure \ --disable-static \ --disable-manage-devices \ --enable-sandboxed \ --with-x \ --with-transmitter \ --with-driver=userspace \ --with-kerneldir=$(pwd) make LANG=C.utf8 V=0 %{?_smp_mflags} %install %{__rm} -rf $RPM_BUILD_ROOT __docs make -s V=0 LIBTOOLFLAGS="--silent %{?Wnone}" DESTDIR=$RPM_BUILD_ROOT install chmod 755 $RPM_BUILD_ROOT%{_datadir}/lirc/contrib/irman2lirc find $RPM_BUILD_ROOT%{_libdir}/ -name \*.la -delete install -pm 755 contrib/irman2lirc $RPM_BUILD_ROOT%{_bindir} install -Dpm 644 contrib/60-lirc.rules \ $RPM_BUILD_ROOT%{_udevrulesdir}/60-lirc.rules install -Dpm 644 %{SOURCE2} \ $RPM_BUILD_ROOT%{_udevrulesdir}/99-remote-control-lirc.rules %if %{with systemd} mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} echo "d %{_rundir}/lirc 0755 lirc lirc -" \ > $RPM_BUILD_ROOT%{_tmpfilesdir}/lirc.conf %else %{__install} -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lirc %{__install} -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc %endif #%{__install} -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/lircd ## For DKMS sub packagtes # #for lircsrcdir in %{name} %{name}-parallel %{name}-gpio; do for lircsrcdir in %{name}; do install -d -m755 $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release} cp -a Makefile Makefile.in Makefile.am \ configure.ac config.status config.h \ $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release} # Makefiles call there to unnecessarily regenerate files echo '#!/bin/true' > $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure chmod +x $RPM_BUILD_ROOT/usr/src/$lircsrcdir-%{version}-%{release}/configure done cp -a drivers $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release} #for drivername in parallel gpio; do #install -d -m755 $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers #mv $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/drivers/lirc_$drivername \ # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/ #cp -a drivers/*.h drivers/Makefile* drivers/lirc_dev \ # $RPM_BUILD_ROOT/usr/src/%{name}-$drivername-%{version}-%{release}/drivers/ # #done # get modulelist pushd drivers drivers=$(echo lirc_* | sed "s/lirc_parallel //" | sed "s/lirc_gpio //") popd # Anssi 2009-03 empty directory drivers="${drivers/lirc_cmdir /}" cat > $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <> $RPM_BUILD_ROOT/usr/src/%{name}-%{version}-%{release}/dkms.conf <<-EOF BUILT_MODULE_NAME[$i]="$module" BUILT_MODULE_LOCATION[$i]="drivers/$module" DEST_MODULE_LOCATION[$i]="/kernel/drivers/input/misc" EOF i=$((i+1)) done #for drivername in parallel gpio; do #cat > %{buildroot}/usr/src/%{name}-$drivername-%{version}-%{release}/dkms.conf </dev/null || groupadd -r lirc getent passwd lirc >/dev/null || \ useradd -r -g lirc -d /var/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 || : exit 0 %post %if %{with systemd} %systemd_post lircd.service lircmd.service systemd-tmpfiles --create %{_tmpfilesdir}/lirc.conf %else /sbin/chkconfig --add lirc %endif # 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 /sbin/ldconfig %preun %if %{with systemd} %systemd_preun lircd.service lircmd.service %else if [ $1 -eq 0 -o -x /bin/systemctl ] ; then /sbin/service lirc stop || : /sbin/chkconfig --del lirc || : fi %endif /sbin/ldconfig %postun %if %{with systemd} %systemd_postun_with_restart lircd.service lircmd.service %else if [ "$1" -ge "1" ]; then /sbin/service lirc condrestart || : fi %endif %post -n dkms-%{name} dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade && dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force || : %preun -n dkms-%{name} dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all || : #%post -n dkms-%{name}-parallel #dkms add -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade && #dkms build -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade && #dkms install -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --force || : # #%preun -n dkms-%{name}-parallel #dkms remove -m %{name}-parallel -v %{version}-%{release} --rpm_safe_upgrade --all || : #%post -n dkms-%{name}-gpio #dkms add -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade && #dkms build -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade && #dkms install -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --force || : # #%preun -n dkms-%{name}-gpio #dkms remove -m %{name}-gpio -v %{version}-%{release} --rpm_safe_upgrade --all || : %clean %{__rm} -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %license COPYING %doc ANNOUNCE AUTHORS ChangeLog NEWS README TODO %doc __docs/* #/etc/logrotate.d/lircd %dir %{_sysconfdir}/lirc %dir %{_sysconfdir}/lirc/lircd.conf.d %ghost %config(noreplace) %{_sysconfdir}/lirc/*.conf %ghost %config(noreplace) %{_sysconfdir}/lirc/irexec.lircrc %ghost %config(noreplace) %{_sysconfdir}/lirc/lircd.conf.d/* %{_bindir}/* %{_sbindir}/* %{_libdir}/*.so.* %{_libdir}/lirc %{_datadir}/lirc/ %{_docdir}/lirc %{_mandir}/man?/* %{_localstatedir}/lib/lirc %{_udevrulesdir}/* %{_libdir}/python%{python3_version}/site-packages/lirc %{_libdir}/python%{python3_version}/site-packages/lirc-setup %if %{with systemd} %{_tmpfilesdir}/lirc.conf %{_unitdir}/lirc* %{_unitdir}/irexec.service %else %{_initdir}/lirc %config(noreplace) %{_sysconfdir}/sysconfig/lirc %endif %files devel %{_includedir}/lirc/ %{_includedir}/*.h %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %files -n dkms-%{name} %defattr(-,root,root) /usr/src/%{name}-%{version}-%{release} #%files -n dkms-%{name}-parallel #%defattr(-,root,root) #/usr/src/%{name}-parallel-%{version}-%{release} #%files -n dkms-%{name}-gpio #%defattr(-,root,root) #/usr/src/%{name}-gpio-%{version}-%{release} %changelog * Sun Aug 16 2020 Tomohiro "Tomo-p" KATO 0.10.1-1 - new upstream release. - added systemd support (disabled as default). * Sat Jul 16 2016 Tomohiro "Tomo-p" KATO 0.9.4-1 - updated to 0.9.4. - dropped Patch0. - added a subpackage: lirc-devel. * Fri Dec 27 2013 Yoji TOYODA 0.9.0-1 - update to 0.9.0 - remove Patch1 (lirc-0.8.6-standardized-remote-keycodes.patch) - remove Patch2 (lirc-0.8.4-make-remote-names-all-unique.patch) - remove Patch100 (lirc-0.8.7-mceusb-GV-MC7_RCKIT.patch) * Sun Oct 17 2010 Kazutaka HARADA 0.8.7-1 - new upstream release - update Patch1, 2 and 100 - drop Patch3 (already merged by upstream) * Fri Feb 05 2010 Shu KONNO 0.8.6-3 - rebuilt with python-2.6.4-3 * Wed Dec 23 2009 Kazutaka HARADA 0.8.6-2 - add Patch3 to fix compilation error against kernel-2.6.32 * Sat Nov 14 2009 Kazutaka HARADA 0.8.6-1 - new upstream release - drop obsolete patches - add new patches and configuration files from fedora package - rewrite spec - add dkms-lirc sub packages refer to mandriva package (but we don't build lirc-paralle and lirc-gpio sub packages) * Sat Aug 09 2008 Shu KONNO 0.6.5-1vl5 - added lirc-0.6.5-config.patch for x86_64 - applied new versioning policy - spec in utf-8 * Mon Feb 16 2004 Daisuke SUZUKI 0.6.5-0vl1 - initial build for Vine Linux