%global with_python3 1 Name: python-uinput Version: 0.9 Release: 2%{?dist} Summary: Pythonic API to the Linux uinput kernel module License: GPLv3 URL: http://pypi.python.org/pypi/python-uinput/0.9 Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildRequires: python-devel BuildRequires: kernel-headers BuildRequires: libudev-devel %if %{?with_python3} BuildRequires: python3-devel %endif # if with_python3 %filter_provides_in %{python_sitearch}/.*\.so$ %filter_provides_in %{python3_sitearch}/.*\.so$ %filter_setup %description Python-uinput is Python interface to the Linux uinput kernel module which allows attaching userspace device drivers into kernel. %if 0%{?with_python3} %package -n python3-uinput Summary: Pythonic API to the Linux uinput kernel module %description -n python3-uinput Python-uinput is Python interface to the Linux uinput kernel module which allows attaching userspace device drivers into kernel. %endif # with_python3 %prep %setup -q -n %{name}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build popd %endif # with_python3 %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %{__python} setup.py install --skip-build --root %{buildroot} chmod a-x examples/* %files %doc COPYING NEWS README examples %{python_sitearch}/python_uinput-%{version}-py?.?.egg-info %{python_sitearch}/_libsuinput.so %{python_sitearch}/uinput %if 0%{?with_python3} %files -n python3-uinput %doc COPYING NEWS README examples %{python3_sitearch}/python_uinput-%{version}-py?.?.egg-info %{python3_sitearch}/_libsuinput.*.so %{python3_sitearch}/uinput %endif # with_python3 %changelog * Tue Nov 20 2012 Fabian Deutsch - 0.9-2 - Add documentation and examples * Mon Nov 19 2012 Fabian Deutsch - 0.9-1 - Initial package.