%global modname gattlib
Name: python-gattlib
Version: 0.20150805
Release: 2%{?dist}
Summary: Library to access Bluetooth LE devices
License: ASL 2.0 and GPLv2+ and LGPLv2+
# main package under ASL 2.0
# src/bluez under GPLv2+ and LGPLv2+
URL: https://bitbucket.org/OscarAcena/pygattlib
Source0: https://files.pythonhosted.org/packages/source/g/%{modname}/%{modname}-%{version}.tar.gz
Source1: COPYING
#Patch to allow building with Python 3 as present in Fedora
Patch0: gattlib-py3.patch
%description
%{summary}.
%package -n python2-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: boost-python-devel
BuildRequires: glib2-devel
BuildRequires: bluez-libs-devel
%description -n python2-%{modname}
%{summary}.
Python 2 version.
%package -n python%{python3_pkgversion}-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: boost-python3-devel
BuildRequires: glib2-devel
BuildRequires: bluez-libs-devel
%description -n python%{python3_pkgversion}-%{modname}
%{summary}.
Python %{python3_version} version.
%prep
%autosetup -n %{modname}-%{version}
cp %{S:1} .
find . -type f | xargs chmod -x
%build
%py2_build
%py3_build
%install
%py2_install
%py3_install
%check
%{__python2} setup.py test
%{__python3} setup.py test
%files -n python2-%{modname}
%license COPYING
%{python2_sitearch}/gattlib*
%{python2_sitearch}/%{modname}*.egg-info/
%files -n python%{python3_pkgversion}-%{modname}
%license COPYING
%{python3_sitearch}/gattlib*
%{python3_sitearch}/%{modname}*.egg-info/
%changelog
* Tue Dec 12 2017 Gwyn Ciesla <limburgher@gmail.com> - 0.20150805-2
- License clarification.
* Mon Dec 11 2017 Gwyn Ciesla <limburgher@gmail.com> - 0.20150805-1
- Add license file, fix URL, explain patch.
* Mon Dec 11 2017 Gwyn Ciesla <limburgher@gmail.com> - 0.20150805-0
- Initial package.