From 6034ebea2781d01b2730c9840707687312e7ebfb Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 11 Aug 2017 07:53:52 +0000 Subject: [PATCH] #1611 add working version of python-uinput git-svn-id: https://xpra.org/svn/Xpra/trunk@16678 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- rpmbuild/python-uinput.spec | 151 ++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 rpmbuild/python-uinput.spec diff --git a/rpmbuild/python-uinput.spec b/rpmbuild/python-uinput.spec new file mode 100644 index 0000000000..e74217e569 --- /dev/null +++ b/rpmbuild/python-uinput.spec @@ -0,0 +1,151 @@ + +%global with_python3 1 + +# No python3 on el6 +%if 0%{?el6} +%global with_python3 0 +%endif + +Name: python2-uinput +Version: 0.11.2 +Release: 1%{?dist} +Summary: Pythonic API to the Linux uinput kernel module + +License: GPLv3 +URL: http://pypi.python.org/pypi/python-uinput/ +Source0: https://pypi.python.org/packages/54/b7/be7d0e8bbbbd440fef31242974d92d4edd21eb95ed96078b18cf207c7ccb/python-uinput-0.11.2.tar.gz + +Provides: python-uinput +Obsoletes: python-uinput < 0.11.2 +Conflicts: python-uinput < 0.11.2 + +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 python-uinput-%{version} + +# Use unversioned .so +sed -i "s/libudev.so.0/libudev.so/" setup.py + +%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 +* Fri Aug 11 2017 Miro Hrončok - 0.11.2-1 +- new upstream release + +* Mon Dec 19 2016 Miro Hrončok - 0.10.1-10 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 0.10.1-9 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 0.10.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Nov 10 2015 Fedora Release Engineering - 0.10.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Thu Jun 18 2015 Fedora Release Engineering - 0.10.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 0.10.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.10.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 28 2014 Kalev Lember - 0.10.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Fri Mar 28 2014 Fabian Deutsch - 0.10.1-2 +- Don't build py3 on el6 + +* Fri Feb 28 2014 Fabian Deutsch - 0.10.1-1 +- Update to latest upstram + +* Sun Aug 04 2013 Fedora Release Engineering - 0.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 20 2012 Fabian Deutsch - 0.9-2 +- Add documentation and examples + +* Mon Nov 19 2012 Fabian Deutsch - 0.9-1 +- Initial package.