Latest upstream, spec cleanup, add python3 support.
This commit is contained in:
parent
91d10847cc
commit
6feb354f8b
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ pyusb-0.4.1.tar.gz
|
||||
/pyusb-1.0.0-a1.tar.gz
|
||||
/pyusb-1.0.0a2.tar.gz
|
||||
/pyusb-1.0.0a3.tar.gz
|
||||
/pyusb-1.0.0b1.zip
|
||||
|
||||
69
pyusb.spec
69
pyusb.spec
@ -1,16 +1,23 @@
|
||||
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||
%if 0%{?fedora} > 12
|
||||
%global with_python3 1
|
||||
%{!?python3_sitearch: %define python_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||
%else
|
||||
%{!?python_sitearch: %define python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||
%endif
|
||||
|
||||
%global alphatag a3
|
||||
%global alphatag b1
|
||||
Name: pyusb
|
||||
Version: 1.0.0
|
||||
Release: 0.7.%{alphatag}%{?dist}
|
||||
Release: 0.8.%{alphatag}%{?dist}
|
||||
Summary: Python bindings for libusb
|
||||
Group: Development/Languages
|
||||
License: BSD
|
||||
URL: http://pyusb.sourceforge.net/
|
||||
Source0: pyusb-%{version}%{alphatag}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: python-devel
|
||||
Source0: Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}%{alphatag}.zip
|
||||
BuildRequires: python2-devel
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%endif # if with_python3
|
||||
BuildRequires: libusb-devel
|
||||
BuildArch: noarch
|
||||
|
||||
@ -18,30 +25,64 @@ BuildArch: noarch
|
||||
PyUSB provides easy USB access to python. The module contains classes and
|
||||
methods to support most USB operations.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-pyusb
|
||||
Summary: Python 3 bindings for libusb
|
||||
Group: Development/Languages
|
||||
|
||||
%description -n python3-pyusb
|
||||
PyUSB provides easy USB access to python. The module contains classes and
|
||||
methods to support most USB operations.
|
||||
%endif # with_python3
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}%{alphatag}
|
||||
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||
%endif # with_python3
|
||||
|
||||
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
|
||||
sed -i -e 's/\r//g' README.rst
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
%endif
|
||||
|
||||
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.rst LICENSE
|
||||
%{python_sitelib}/*
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-pyusb
|
||||
%doc README.rst LICENSE
|
||||
%{python3_sitelib}/*
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Fri Sep 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.7.a3
|
||||
* Mon Nov 11 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.8.b1
|
||||
- Latest upstream.
|
||||
- Add python3 support, spec cleanup, BZ 1022851.
|
||||
- Fixed changelog.
|
||||
|
||||
* Fri Sep 13 2013 Jon Ciesla <limburgher@gmail.com> - 1.0.0-0.7.a3
|
||||
- Latest upstream.
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-0.6.a2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user