%bcond_without python3 %bcond_with rhel5 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: Linux Infrared Remote Control python module Name: python-lirc Version: 0.0.5 Release: 12%{?dist} License: GPLv2+ Group: Development/Languages URL: http://pylirc.mccabe.nu/ Source0: http://downloads.sourceforge.net/pylirc/pylirc-%{version}.tar.gz Source1: python-lirc-README Source2: python-lirc-API Source3: python-lirc-sample-simple.py Source4: python-lirc-sample-multithread.py Patch0: pylirc-0.0.5-python3.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel, lirc-devel %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif Provides: pylirc = %{version}-%{release} %description pyLirc is a module for Python that interacts with lirc to give Python programs the ability to receive commands from remote controls. %if %{with python3} %package -n python3-lirc Summary: Linux Infrared Remote Control python module Group: Development/Languages License: BSD Provides: pylirc = %{version}-%{release} %description -n python3-lirc pyLirc is a module for Python that interacts with lirc to give Python programs the ability to receive commands from remote controls. %endif %prep %setup -q -n pylirc-%{version} %patch0 -p1 -b .python3 %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %if %{with python3} pushd %{py3dir} CFLAGS="%{optflags}" %{__python3} setup.py build popd %endif CFLAGS="%{optflags}" %{__python} setup.py build %install %{__rm} -rf %{buildroot} %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %{__python} setup.py install -O1 --skip-build --root %{buildroot} # Install our docs for later inclusion with %%doc %{__install} -p -m 0644 %{SOURCE1} README %{__install} -p -m 0644 %{SOURCE2} API %{__install} -p -m 0644 %{SOURCE3} sample-simple.py %{__install} -p -m 0644 %{SOURCE4} sample-multithread.py %clean %{__rm} -rf %{buildroot} %if %{with python3} %{__rm} -rf %{py3dir} %endif %files %defattr(-,root,root,-) %doc API PKG-INFO README sample-simple.py sample-multithread.py %{python_sitearch}/pylircmodule.so %{!?with_rhel5:%{python_sitearch}/pylirc-*.egg-info} %if %{with python3} %files -n python3-lirc %defattr(-,root,root,-) %doc API PKG-INFO README sample-simple.py sample-multithread.py %{python3_sitearch}/pylircmodule*.so %{python3_sitearch}/pylirc-*.egg-info %endif %changelog * Sat Feb 26 2011 Paulo Roma - 0.0.5-12 - Ported to python3. * Thu Jul 22 2010 David Malcolm - 0.0.5-11 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Thu Jul 8 2010 Matthias Saou 0.0.5-10 - Add dist tag for the EL-6 build. * Sun Jul 26 2009 Fedora Release Engineering - 0.0.5-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 0.0.5-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.0.5-8 - Rebuild for Python 2.6 * Sun Feb 24 2008 Matthias Saou 0.0.5-7 - Missing egg file, now included. * Tue Feb 19 2008 Fedora Release Engineering - Autorebuild for GCC 4.3 * Wed Aug 22 2007 Matthias Saou 0.0.5-5 - Rebuild for new BuildID feature. * Fri Aug 3 2007 Matthias Saou 0.0.5-4 - Update License field. - Remove dist tag, since the package will seldom change. * Thu Mar 1 2007 Matthias Saou 0.0.5-3 - Prefix all our own documentation source files. - Include a README about our license changes and added docs. * Thu Feb 8 2007 Matthias Saou 0.0.5-2 - Change License from GPL to LGPL as our package links with lirc which is GPL. - Add pylirc (original name) virtual provides. - Include the API doc and both examples from the website. * Thu Feb 8 2007 Matthias Saou 0.0.5-1 - Initial RPM release.