|
|
|
@ -1,119 +1,232 @@
|
|
|
|
|
# $Id: lirc.spec 2135 2004-08-30 13:51:15Z dude $
|
|
|
|
|
# Authority: matthias
|
|
|
|
|
|
|
|
|
|
# The driver(s) you want to compile in, e.g. "pctv", "serial", "any"
|
|
|
|
|
%define driver "pctv"
|
|
|
|
|
|
|
|
|
|
# Are we compiling drivers that will need a kernel module too
|
|
|
|
|
# (you'll still need to recompile an entire kernel, keep the sources, then
|
|
|
|
|
# recompile lirc to get the modules...)
|
|
|
|
|
%define kmodule 0
|
|
|
|
|
|
|
|
|
|
#%%if %{kmodule}
|
|
|
|
|
#%%define kunamer %%(uname -r)
|
|
|
|
|
#%%define kver %%(echo $(uname -r) | sed -e s/smp// -)
|
|
|
|
|
#%%define karch %%(rpm -q --qf '%%%{arch}' kernel-%%{kversion})
|
|
|
|
|
#%%define krelver %%(echo %%{kunamer} | tr -s '-' '_')
|
|
|
|
|
#%%endif
|
|
|
|
|
|
|
|
|
|
Summary: The Linux Infrared Remote Control package
|
|
|
|
|
Name: lirc
|
|
|
|
|
Version: 0.6.6
|
|
|
|
|
#%%if %{kmodule}
|
|
|
|
|
#Release: fr1_%{krelver}
|
|
|
|
|
#%%else
|
|
|
|
|
Release: 4
|
|
|
|
|
#%%endif
|
|
|
|
|
License: GPL
|
|
|
|
|
Group: System Environment/Daemons
|
|
|
|
|
URL: http://www.lirc.org/
|
|
|
|
|
Source0: http://dl.sf.net/lirc/%{name}-%{version}.tar.bz2
|
|
|
|
|
Source1: lircd.init
|
|
|
|
|
Source2: lircd.logrotate
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
|
|
|
PreReq: /sbin/chkconfig, /sbin/service
|
|
|
|
|
BuildRequires: perl
|
|
|
|
|
#%%if %{kmodule}
|
|
|
|
|
#Requires: kernel = %{kver}
|
|
|
|
|
#BuildRequires: kernel-source = %{kver}
|
|
|
|
|
#%%endif
|
|
|
|
|
# Driver TODO, sometime maybe:
|
|
|
|
|
# - audio (req: portaudio)
|
|
|
|
|
# - caraca (req: caraca_client)
|
|
|
|
|
# - irman: (req: libirman)
|
|
|
|
|
# - drivers that need drivers/media/video/bttv*.h (not in kernel-module-devel)
|
|
|
|
|
# - gpio: flyvideo avermedia avermedia98
|
|
|
|
|
# - i2c: hauppauge
|
|
|
|
|
# Other TODO:
|
|
|
|
|
# - move to -devel (?): irw, *mode2, others?
|
|
|
|
|
# - 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.
|
|
|
|
|
# - kernel modules: Figure out sane permissions for /dev/lirc, use
|
|
|
|
|
# console.perms/udev, general FC3 adjustments.
|
|
|
|
|
|
|
|
|
|
%{!?kernel: %{expand: %%define kernel %(uname -r)}}
|
|
|
|
|
%define ksrc %{_libdir}/kernel-module-devel/%{kernel}-%{_target_cpu}
|
|
|
|
|
# Kernel module drivers
|
|
|
|
|
%define drivers sir_com3 it87 tekram_bt829 com1 atiusb mceusb lpt1
|
|
|
|
|
|
|
|
|
|
Name: lirc
|
|
|
|
|
Version: 0.7.0
|
|
|
|
|
Release: 1
|
|
|
|
|
Summary: The Linux Infrared Remote Control package
|
|
|
|
|
|
|
|
|
|
Group: System Environment/Daemons
|
|
|
|
|
License: GPL
|
|
|
|
|
URL: http://www.lirc.org/
|
|
|
|
|
Source0: http://download.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
|
|
|
|
|
Source1: %{name}.init
|
|
|
|
|
Source2: %{name}.sysconfig
|
|
|
|
|
Source3: %{name}.makedev
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
|
|
|
|
|
BuildRequires: %{__perl}
|
|
|
|
|
%if 0%{!?_with_kmod:1}
|
|
|
|
|
BuildRequires: alsa-lib-devel XFree86-devel libusb-devel
|
|
|
|
|
BuildConflicts: svgalib-devel
|
|
|
|
|
%endif
|
|
|
|
|
Requires(post): /sbin/chkconfig /sbin/ldconfig
|
|
|
|
|
Requires(preun): /sbin/chkconfig
|
|
|
|
|
Requires(postun): /sbin/ldconfig
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
LIRC is the Linux Infrared Remote Control package.
|
|
|
|
|
This package features a clean lircd initscript and a logrotate config file.
|
|
|
|
|
|
|
|
|
|
The default binary build of this package will only work with the Pinnacle
|
|
|
|
|
PCTV serial remote, if you have a different device, you will probably need
|
|
|
|
|
to recompile the source RPM changing the "--with-driver=" configure option
|
|
|
|
|
to your device.
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Development files for LIRC
|
|
|
|
|
Group: Development/Libraries
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
|
|
%package -n kernel-module-%{name}-%{kernel}
|
|
|
|
|
Summary: Kernel modules for LIRC
|
|
|
|
|
Group: System Environment/Kernel
|
|
|
|
|
Provides: kernel-module
|
|
|
|
|
Provides: kernel-module-%{name} = %{version}
|
|
|
|
|
%if 0%{?_with_kmod:1}
|
|
|
|
|
BuildRequires: %{ksrc} MAKEDEV
|
|
|
|
|
%endif
|
|
|
|
|
Requires: modutils %{name} = %{version}
|
|
|
|
|
Requires: /boot/vmlinuz-%{kernel}
|
|
|
|
|
|
|
|
|
|
If your remote requires special kernel modules to run, I guess you're stuck
|
|
|
|
|
having to recompile a kernel and recompile lirc manually to get the modules!
|
|
|
|
|
%description -n kernel-module-%{name}-%{kernel}
|
|
|
|
|
LIRC kernel modules built for kernel
|
|
|
|
|
%{kernel} (%{_target_cpu}).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup
|
|
|
|
|
%setup -q
|
|
|
|
|
%{__perl} -pi -e 's|^CFLAGS="-O2 -g -Wall"|CFLAGS="\$CFLAGS -Wall"|' configure
|
|
|
|
|
chmod 644 contrib/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%if 0%{?_with_kmod:1}
|
|
|
|
|
for driver in %{drivers} ; do
|
|
|
|
|
# lpt1 is not smp safe @@@ TODO: verify this?
|
|
|
|
|
test $driver = lpt1 && grep -q '^CONFIG_SMP=y' %{ksrc}/.config && continue
|
|
|
|
|
mkdir -p buildroot/"$driver"
|
|
|
|
|
%configure \
|
|
|
|
|
--enable-sandboxed \
|
|
|
|
|
--enable-debug \
|
|
|
|
|
--disable-dependency-tracking \
|
|
|
|
|
--with-kerneldir=%{ksrc} \
|
|
|
|
|
--with-moduledir=/tmp \
|
|
|
|
|
--with-driver=$driver
|
|
|
|
|
make %{?_smp_mflags} -C drivers
|
|
|
|
|
make -C drivers install DESTDIR=$PWD/buildroot/$driver
|
|
|
|
|
done
|
|
|
|
|
%else
|
|
|
|
|
%configure \
|
|
|
|
|
--with-driver=%{driver} \
|
|
|
|
|
--disable-manage-devices
|
|
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
--with-syslog=LOG_DAEMON \
|
|
|
|
|
--enable-sandboxed \
|
|
|
|
|
--enable-debug \
|
|
|
|
|
--disable-dependency-tracking \
|
|
|
|
|
--with-driver=any
|
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
%{__make} install DESTDIR=%{buildroot}
|
|
|
|
|
%{__install} -m 755 -D %{SOURCE1} %{buildroot}/etc/init.d/lircd
|
|
|
|
|
%{__install} -m 644 -D %{SOURCE2} %{buildroot}/etc/logrotate.d/lircd
|
|
|
|
|
%{__perl} -pi -e 's|\@SBINDIR\@|%{_sbindir}|g' %{buildroot}/etc/init.d/lircd
|
|
|
|
|
%{__rm} -f doc/Makefile*
|
|
|
|
|
%{__mkdir_p} %{buildroot}/dev
|
|
|
|
|
%{__ln_s} -f ttyS0 %{buildroot}/dev/lirc
|
|
|
|
|
touch %{buildroot}/etc/lircd.conf
|
|
|
|
|
touch %{buildroot}/etc/lircmd.conf
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT __docs
|
|
|
|
|
|
|
|
|
|
%if 0%{?_with_kmod:1}
|
|
|
|
|
for driver in %{drivers} ; do
|
|
|
|
|
# lpt1 is not SMP safe @@@ TODO: verify this?
|
|
|
|
|
test $driver = lpt1 && grep -q '^CONFIG_SMP=y' %{ksrc}/.config && continue
|
|
|
|
|
install -dm 755 $RPM_BUILD_ROOT/lib/modules/%{kernel}/updates/lirc
|
|
|
|
|
# 0755 here to allow stripping, fixed later in %%files
|
|
|
|
|
install -pm 755 buildroot/$driver/tmp/* \
|
|
|
|
|
$RPM_BUILD_ROOT/lib/modules/%{kernel}/updates/lirc
|
|
|
|
|
done
|
|
|
|
|
install -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d/lirc
|
|
|
|
|
cp -p %{_sysconfdir}/makedev.d/00macros $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d
|
|
|
|
|
/dev/MAKEDEV -M \
|
|
|
|
|
-c $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d \
|
|
|
|
|
-d $RPM_BUILD_ROOT/dev lirc \
|
|
|
|
|
| sed "s|$RPM_BUILD_ROOT||g" \
|
|
|
|
|
| grep -v ' /dev$' \
|
|
|
|
|
> devices.list
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/makedev.d/00macros
|
|
|
|
|
|
|
|
|
|
%else
|
|
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smode2.1* # if no svgalib
|
|
|
|
|
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/lirc
|
|
|
|
|
%{__perl} -pi -e \
|
|
|
|
|
's|/etc/|%{_sysconfdir}/|g ;
|
|
|
|
|
s|/var/|%{_localstatedir}/|g ;
|
|
|
|
|
s|/usr/sbin/|%{_sbindir}/|g' \
|
|
|
|
|
$RPM_BUILD_ROOT%{_initrddir}/lirc
|
|
|
|
|
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/lirc
|
|
|
|
|
mkdir __docs
|
|
|
|
|
cp -pR doc contrib __docs
|
|
|
|
|
cd __docs
|
|
|
|
|
rm -rf doc/Makefile* doc/.libs doc/man* contrib/lirc.* contrib/sendxevent.c
|
|
|
|
|
cd ..
|
|
|
|
|
touch $RPM_BUILD_ROOT%{_sysconfdir}/lirc{d,md}.conf
|
|
|
|
|
install -dm 755 $RPM_BUILD_ROOT/dev
|
|
|
|
|
touch $RPM_BUILD_ROOT/dev/lirc{d,m}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
/sbin/ldconfig
|
|
|
|
|
/sbin/chkconfig --add lircd
|
|
|
|
|
/sbin/chkconfig --add lirc
|
|
|
|
|
# Backwards compatibility (init script lircd -> lirc rename):
|
|
|
|
|
if [ $1 -gt 0 -a -x %{_initrddir}/lircd ] ; then
|
|
|
|
|
%{_initrddir}/lircd status >/dev/null 2>&1
|
|
|
|
|
ret=$?
|
|
|
|
|
%{_initrddir}/lircd stop >/dev/null || :
|
|
|
|
|
/sbin/chkconfig --del lircd || :
|
|
|
|
|
if [ $ret -eq 0 ] ; then
|
|
|
|
|
%{_initrddir}/lirc start >/dev/null || :
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%post -n kernel-module-%{name}-%{kernel}
|
|
|
|
|
depmod -ae -F /boot/System.map-%{kernel} %{kernel} >/dev/null || :
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
if [ $1 = 0 ]; then
|
|
|
|
|
/sbin/service lircd stop > /dev/null 2>&1 || :
|
|
|
|
|
/sbin/chkconfig --del lircd
|
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
|
%{_initrddir}/lirc stop >/dev/null || :
|
|
|
|
|
/sbin/chkconfig --del lirc || :
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
/sbin/ldconfig
|
|
|
|
|
if [ "$1" -ge "1" ]; then
|
|
|
|
|
/sbin/service lircd condrestart >/dev/null 2>&1 || :
|
|
|
|
|
if [ $1 -gt 0 ] ; then
|
|
|
|
|
%{_initrddir}/lirc try-restart >/dev/null || :
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
%postun -n kernel-module-%{name}-%{kernel}
|
|
|
|
|
depmod -ae -F /boot/System.map-%{kernel} %{kernel} >/dev/null || :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{!?_with_kmod:1}
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-, root, root, 0755)
|
|
|
|
|
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO doc remotes
|
|
|
|
|
%doc contrib/*.conf contrib/irman2lirc contrib/lircrc contrib/lircs
|
|
|
|
|
/etc/init.d/lircd
|
|
|
|
|
/etc/logrotate.d/lircd
|
|
|
|
|
%ghost %config(noreplace) /etc/lircd.conf
|
|
|
|
|
%ghost %config(noreplace) /etc/lircmd.conf
|
|
|
|
|
%{_bindir}/*
|
|
|
|
|
%{_sbindir}/*
|
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO remotes __docs/*
|
|
|
|
|
%ghost %config(noreplace) %{_sysconfdir}/lirc*d.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/lirc
|
|
|
|
|
%config %{_initrddir}/lirc
|
|
|
|
|
%{_bindir}/ir*
|
|
|
|
|
%{_bindir}/*mode2
|
|
|
|
|
%{_sbindir}/lirc*d
|
|
|
|
|
%{_libdir}/liblirc_client.so.*
|
|
|
|
|
%{_mandir}/man1/ir*.1*
|
|
|
|
|
%{_mandir}/man1/*mode2*.1*
|
|
|
|
|
%{_mandir}/man8/lirc*d.8*
|
|
|
|
|
%ghost /dev/lirc*
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
%{_includedir}/lirc
|
|
|
|
|
%{_libdir}/liblirc_*
|
|
|
|
|
%{_mandir}/man?/*
|
|
|
|
|
%if %{kmodule}
|
|
|
|
|
#/lib/modules/%{kver}/misc/*
|
|
|
|
|
%attr(0644, root, root) %dev(c, 61, 0) /dev/lirc
|
|
|
|
|
%else
|
|
|
|
|
/dev/lirc
|
|
|
|
|
%{_libdir}/liblirc_client.a
|
|
|
|
|
%{_libdir}/liblirc_client.so
|
|
|
|
|
%exclude %{_libdir}/liblirc_client.la
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?_with_kmod:1}
|
|
|
|
|
%files -n kernel-module-%{name}-%{kernel} -f devices.list
|
|
|
|
|
%defattr(644,root,root,755)
|
|
|
|
|
%config %{_sysconfdir}/makedev.d
|
|
|
|
|
/lib/modules/%{kernel}/updates
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Sun Dec 5 2004 Ville Skyttä <ville.skytta at iki.fi> - 0.7.0-1
|
|
|
|
|
- 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.
|
|
|
|
|
- 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.
|
|
|
|
|
- %%ghost'ify /dev/lirc*.
|
|
|
|
|
- Build kernel modules when rebuilt with "--with kmod". This stuff was mostly
|
|
|
|
|
borrowed from Axel Thimm's packages, and is not really ready for FC3+ yet.
|
|
|
|
|
- Enable debugging features.
|
|
|
|
|
- Specfile cleanups.
|
|
|
|
|
|
|
|
|
|
* Mon Aug 30 2004 Matthias Saou <http://freshrpms.net/> 0.6.6-3
|
|
|
|
|
- Added missing /sbin/ldconfig calls.
|
|
|
|
|
|
|
|
|
|