@ -1,25 +1,21 @@
# Driver TODO, sometime maybe:
# Driver TODO, sometime maybe:
# - audio (req: portaudio)
# - caraca (req: caraca, http://caraca.sf.net/)
# - caraca (req: caraca_client)
# - irman: (req: libirman, http://lirc.sf.net/software/snapshots/)
# - irman: (req: libirman)
# - drivers that need drivers/media/video/bttv*.h (not in kernel-devel)
# - gpio: avermedia avermedia98 flyvideo
# Other TODO:
# Other TODO:
# - move to -devel (?): irw, *mode2, others?
# - move to -devel (?): irw, *mode2, others?
# note: xmode2 inflicts a dependency on X, and smode2 on svgalib
# - don't run as root and/or create dedicated group, reduce fifo permissions?
# - 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.
# - Fixup /etc/lirc(m)d.conf %%ghost'ification, existence after erase etc.
# - Verify that the kernel modules work and correct /dev entries get created
# - Verify that the kernel modules work and correct /dev entries get created
# automagically with proper permissions etc.
# automagically with proper permissions etc.
%{!?kernel: %{expand: %%define kernel %(uname -r)}}
%{!?kver: %{expand: %%define kver %(uname -r)}}
%define ksrc %{_usrsrc}/kernels/%{kernel}-%{_target_cpu}
%define ksrc %{_usrsrc}/kernels/%{kver}-%{_target_cpu}
%define mdir /lib/modules/%{kver}/extra
# Kernel module drivers
%define drivers atiusb com1 hauppauge igorplugusb imon it87 lpt1 mceusb sasem sir_com3 streamzap tekram_bt829
Name: lirc
Name: lirc
Version: 0.7.1
Version: 0.7.2
Release: 3
Release: 2%{?dist}
Summary: The Linux Infrared Remote Control package
Summary: The Linux Infrared Remote Control package
Group: System Environment/Daemons
Group: System Environment/Daemons
@ -28,19 +24,31 @@ URL: http://www.lirc.org/
Source0: http://download.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
Source0: http://download.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
Source1: %{name}.init
Source1: %{name}.init
Source2: %{name}.sysconfig
Source2: %{name}.sysconfig
Patch0: %{name}-optflags.patch
Patch1: %{name}-gpio.patch
Patch2: %{name}-nomodules.patch
Patch3: %{name}-nodev-crash.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{__perl}
%if 0%{!?_with_modules:1}
%if 0%{!?_with_modules:1}
BuildRequires: alsa-lib-devel XFree86-devel libusb-devel
BuildRequires: %{__perl}
BuildConflicts: svgalib-devel
BuildRequires: alsa-lib-devel
BuildRequires: xorg-x11-devel
BuildRequires: libusb-devel
BuildRequires: portaudio-devel >= 18
Build%{?_with_svgalib:Requires}%{!?_with_svgalib:Conflicts}: svgalib-devel
%endif
%endif
Requires(post): /sbin/chkconfig /sbin/ldconfig
Requires(post): /sbin/chkconfig
Requires(post): /sbin/ldconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(postun): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%description
%description
LIRC is the Linux Infrared Remote Control package.
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.
%package devel
%package devel
Summary: Development files for LIRC
Summary: Development files for LIRC
@ -50,74 +58,59 @@ Requires: %{name} = %{version}-%{release}
%description devel
%description devel
%{summary}.
%{summary}.
%package -n kernel-module-%{name}-%{kernel }
%package -n kernel-module-%{name}-%{kv er}
Summary: Kernel modules for LIRC
Summary: Kernel modules for LIRC
Group: System Environment/Kernel
Group: System Environment/Kernel
Provides: kernel-module
Provides: kernel-module
Provides: kernel-module-%{name} = %{version}
Provides: kernel-module-%{name} = %{version}
%if 0%{?_with_modules:1}
%if 0%{?_with_modules:1}
BuildRequires: kernel-devel-%{_target_cpu} = %{kernel }
BuildRequires: kernel-devel-%{_target_cpu} = %{kv er}
%endif
%endif
Requires: %{name} = %{version}
Requires: %{name} = %{version}
Requires: moduti ls
Requires: module-init-too ls
Requires: kernel-%{_target_cpu} = %{kernel }
Requires: kernel-%{_target_cpu} = %{kv er}
Requires: udev
Requires: udev
%description -n kernel-module-%{name}-%{kernel }
%description -n kernel-module-%{name}-%{kv er}
LIRC kernel modules built for kernel
LIRC kernel modules built for kernel
%{kernel } (%{_target_cpu}).
%{kv er} (%{_target_cpu}).
%prep
%prep
%setup -q
%setup -q
%{__perl} -pi -e 's|^CFLAGS="-O2 -g -Wall"|CFLAGS="\$CFLAGS -Wall"|' configure
%patch0 -p1
%patch1 -p1
# patch2 needs to be applied on top of patch1
%{!?_with_modules:%patch2 -p1}
%patch3 -p0
chmod 644 contrib/*
chmod 644 contrib/*
touch -r aclocal.m4 configure.in # avoid autofoo re-run
%build
%build
%if 0%{?_with_modules: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 \
%configure \
--with-syslog=LOG_DAEMON \
--disable-static \
--enable-sandboxed \
--enable-debug \
--disable-dependency-tracking \
--disable-dependency-tracking \
--enable-debug \
--enable-sandboxed \
--with-syslog=LOG_DAEMON \
--with-kerneldir=%{ksrc} \
--with-moduledir=%{mdir}/%{name} \
--with-driver=any
--with-driver=any
make %{?_smp_mflags}
make %{?_smp_mflags} %{?_with_modules:-C drivers}
%endif
%install
%install
rm -rf $RPM_BUILD_ROOT __docs
rm -rf $RPM_BUILD_ROOT __docs
%if 0%{?_with_modules:1}
%if 0%{?_with_modules:1}
for driver in %{drivers} ; do
make install DESTDIR=$RPM_BUILD_ROOT -C drivers
# lpt1 is not SMP safe @@@ TODO: verify this?
# executable here to allow stripping, fixed later in %%files
test $driver = lpt1 && grep -q '^CONFIG_SMP=y' %{ksrc}/.config && continue
chmod +x $RPM_BUILD_ROOT%{mdir}/%{name}/*.ko
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
%else
%else
make install DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smode2.1* # if no svgalib
%{!?_with_svgalib:rm $RPM_BUILD_ROOT%{_mandir}/man1/smode2.1*}
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/lirc
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/lirc
%{__perl} -pi -e \
%{__perl} -pi -e \
's|/etc/|%{_sysconfdir}/|g ;
's|/etc/|%{_sysconfdir}/|g ;
@ -133,6 +126,7 @@ cd ..
touch $RPM_BUILD_ROOT%{_sysconfdir}/lirc{d,md}.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/lirc{d,md}.conf
install -dm 755 $RPM_BUILD_ROOT/dev
install -dm 755 $RPM_BUILD_ROOT/dev
touch $RPM_BUILD_ROOT/dev/lirc{d,m}
touch $RPM_BUILD_ROOT/dev/lirc{d,m}
rm $RPM_BUILD_ROOT%{_libdir}/liblirc_client.la
%endif
%endif
@ -143,20 +137,9 @@ rm -rf $RPM_BUILD_ROOT
%post
%post
/sbin/ldconfig
/sbin/ldconfig
/sbin/chkconfig --add lirc
/sbin/chkconfig --add lirc
# Backwards compatibility (init script lircd -> lirc rename),
# drop this in FC5:
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 }
%post -n kernel-module-%{name}-%{kver}
depmod -ae -F /boot/System.map-%{kernel } %{kernel } >/dev/null || :
depmod -ae -F /boot/System.map-%{kver} %{kver} >/dev/null || :
%preun
%preun
if [ $1 -eq 0 ] ; then
if [ $1 -eq 0 ] ; then
@ -170,8 +153,8 @@ if [ $1 -gt 0 ] ; then
%{_initrddir}/lirc try-restart >/dev/null || :
%{_initrddir}/lirc try-restart >/dev/null || :
fi
fi
%postun -n kernel-module-%{name}-%{kernel }
%postun -n kernel-module-%{name}-%{kv er}
depmod -ae -F /boot/System.map-%{kernel } %{kernel } >/dev/null || :
depmod -ae -F /boot/System.map-%{kv er} %{kv er} >/dev/null || :
%if 0%{!?_with_modules:1}
%if 0%{!?_with_modules:1}
@ -180,7 +163,7 @@ depmod -ae -F /boot/System.map-%{kernel} %{kernel} >/dev/null || :
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO remotes __docs/*
%doc ANNOUNCE AUTHORS ChangeLog COPYING NEWS README TODO remotes __docs/*
%ghost %config(noreplace) %{_sysconfdir}/lirc*d.conf
%ghost %config(noreplace) %{_sysconfdir}/lirc*d.conf
%config(noreplace) %{_sysconfdir}/sysconfig/lirc
%config(noreplace) %{_sysconfdir}/sysconfig/lirc
%config %{_initrddir}/lirc
%{_initrddir}/lirc
%{_bindir}/ir*
%{_bindir}/ir*
%{_bindir}/*mode2
%{_bindir}/*mode2
%{_sbindir}/lirc*d
%{_sbindir}/lirc*d
@ -192,20 +175,28 @@ depmod -ae -F /boot/System.map-%{kernel} %{kernel} >/dev/null || :
%files devel
%files devel
%defattr(-,root,root,-)
%defattr(-,root,root,-)
%{_includedir}/lirc
%{_includedir}/lirc/
%{_libdir}/liblirc_client.a
%{_libdir}/liblirc_client.so
%{_libdir}/liblirc_client.so
%exclude %{_libdir}/liblirc_client.la
%endif
%endif
%if 0%{?_with_modules:1}
%if 0%{?_with_modules:1}
%files -n kernel-module-%{name}-%{kernel }
%files -n kernel-module-%{name}-%{kv er}
%defattr(644,root,root,755)
%defattr(644,root,root,755)
/lib/modules/%{kernel}/updates
%{mdir}/
%endif
%endif
%changelog
%changelog
* Sun Aug 14 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.7.2-2
- 0.7.2, patch to fix crash at startup when no device is specified.
- Enable audio input driver support (portaudio).
- Improve package description.
- Don't ship static libraries.
- Drop pre Fedora Extras backwards compatibility hacks.
- Make svgalib support (smode2) build conditional, disabled by default.
- Simplify module package build (still work in progress, disabled by default).
- Other minor specfile cleanups and maintainability improvements.
* Thu May 26 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.7.1-3
* Thu May 26 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.7.1-3
- Adjust kernel module build for FC4 and add hauppauge, igorplugusb, imon,
- Adjust kernel module build for FC4 and add hauppauge, igorplugusb, imon,
sasem, and streamzap to the list of modules to build. This stuff is still
sasem, and streamzap to the list of modules to build. This stuff is still