6feb354
%if 0%{?fedora} > 12
6feb354
%global with_python3 1
6feb354
%{!?python3_sitearch: %define python_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
6feb354
%else
6feb354
%{!?python_sitearch: %define python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
6feb354
%endif
3383006
6feb354
%global alphatag b1
3383006
Name: pyusb
e0f7b08
Version: 1.0.0
47fbb8c
Release: 0.9.%{alphatag}%{?dist}
3383006
Summary: Python bindings for libusb
3383006
Group: Development/Languages
3383006
License: BSD	
e0f7b08
URL: http://pyusb.sourceforge.net/
6feb354
Source0: Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}%{alphatag}.zip
6feb354
BuildRequires: python2-devel
6feb354
%if 0%{?with_python3}
6feb354
BuildRequires:  python3-devel
6feb354
%endif # if with_python3
3383006
BuildRequires: libusb-devel
e0f7b08
BuildArch: noarch
3383006
3383006
%description
3383006
PyUSB provides easy USB access to python. The module contains classes and 
3383006
methods to support most USB operations.
3383006
6feb354
%if 0%{?with_python3}
6feb354
%package -n python3-pyusb
6feb354
Summary:        Python 3 bindings for libusb
6feb354
Group:          Development/Languages
6feb354
6feb354
%description -n python3-pyusb
6feb354
PyUSB provides easy USB access to python. The module contains classes and 
6feb354
methods to support most USB operations.
6feb354
%endif # with_python3
6feb354
3383006
%prep
6c45ec1
%setup -q -n %{name}-%{version}%{alphatag}
3383006
6feb354
%if 0%{?with_python3}
6feb354
rm -rf %{py3dir}
6feb354
cp -a . %{py3dir}
6feb354
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
6feb354
%endif # with_python3
6feb354
6feb354
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
3383006
3383006
%build
6feb354
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
6c45ec1
sed -i -e 's/\r//g' README.rst
3383006
6feb354
%if 0%{?with_python3}
6feb354
pushd %{py3dir}
6feb354
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
6feb354
popd
6feb354
%endif # with_python3
6feb354
6feb354
3383006
%install
6feb354
%if 0%{?with_python3}
6feb354
pushd %{py3dir}
6feb354
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
6feb354
%endif
6feb354
6feb354
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
3383006
3383006
3383006
%files
6c45ec1
%doc README.rst LICENSE
e0f7b08
%{python_sitelib}/*
3383006
6feb354
%if 0%{?with_python3}
6feb354
%files -n python3-pyusb
6feb354
%doc README.rst LICENSE
6feb354
%{python3_sitelib}/*
6feb354
%endif # with_python3
3383006
3383006
%changelog
47fbb8c
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.0-0.9.b1
47fbb8c
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
47fbb8c
6feb354
* Mon Nov 11 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.8.b1
6feb354
- Latest upstream.
6feb354
- Add python3 support, spec cleanup, BZ 1022851.
6feb354
- Fixed changelog.
6feb354
6feb354
* Fri Sep 13 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.7.a3
91d1084
- Latest upstream.
91d1084
26db3a5
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.6.a2
26db3a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
26db3a5
7c4146a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.5.a2
7c4146a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
7c4146a
9350de1
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.4.a2
9350de1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9350de1
6c45ec1
* Mon Jan 23 2012 Tim Waugh <twaugh@redhat.com> - 1.0.0-0.3.a2
6c45ec1
- 1.0.0-a2.
6c45ec1
66d2247
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.2.a1
66d2247
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
66d2247
e0f7b08
* Thu Jun 30 2011 Tim Waugh <twaugh@redhat.com> - 1.0.0-0.1.a1
e0f7b08
- 1.0.0-a1 (bug #586950).
e0f7b08
93e8235
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-7
93e8235
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
93e8235
d2c9100
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.4.1-6
d2c9100
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
d2c9100
a0add67
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-5
a0add67
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
a0add67
e41dadb
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-4
e41dadb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
e41dadb
caf6776
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.4.1-3
caf6776
- Rebuild for Python 2.6
caf6776
3383006
* Mon Jun 16 2008 Jeremy Katz <katzj@redhat.com> - 0.4.1-2
3383006
- Fix end-of-line in README
3383006
3383006
* Mon Jun 16 2008 Jeremy Katz <katzj@redhat.com> - 0.4.1-1
3383006
- Initial packaging
3383006