%global srcname bluez %{!?py3dir: %global py3dir %{_builddir}/python3-%{name}-%{version}-%{release}} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?_licensedir:%global license %%doc} %define python2_package python2 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define python2_package python %endif %else %if 0%{?fedora} <= 25 %define python2_package python %endif %endif %endif %define python3_package python%{python3_pkgversion} Name: pybluez Version: 0.22 Release: 8%{?dist} Summary: Python API for the BlueZ bluetooth stack Group: Development/Languages License: GPLv2 URL: https://github.com/karulis/pybluez/wiki Source0: https://github.com/karulis/pybluez/archive/%{version}.tar.gz BuildRequires: %{srcname}-libs-devel BuildRequires: %{python2_package}-devel BuildRequires: %{python3_package}-devel BuildRequires: %{python2_package}-setuptools BuildRequires: %{python3_package}-setuptools Requires: %{python2_package}-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: %{python3_package}-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} %description PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications. %package -n %{python2_package}-%{srcname} Summary: A Python interface to %{srcname} for Python 2 Requires: %{python2_package} %{?python_provide:%python_provide %{python2_package}-%{srcname}} %if "%{python2_package}" != "python2" #%{?python_provide:%python_provide python2-%{srcname}} Provides: python2-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python2-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %if "%{python2_package}" != "python" #%{?python_provide:%python_provide python-%{srcname}} Provides: python-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python2_package}-%{srcname} PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications. %package -n %{python3_package}-%{srcname} Summary: A Python interface to %{srcname} for Python 3 Requires: %{python3_package} %{?python_provide:%python_provide %{python3_package}-%{srcname}} %if "%{python3_package}" != "python3" #%{?python_provide:%python_provide python3-%{srcname}} Provides: python3-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python3-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python3_package}-%{srcname} PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications. %prep %setup -q # copy the whole directory for the python3 build rm -rf "%{py3dir}" cp -a . "%{py3dir}" %build CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py build pushd "%{py3dir}" %{__python3} setup.py build popd %install # This file shouldn't be executable - it's going into %doc chmod a-x "examples/bluezchat/bluezchat.py" %{__python} setup.py install -O1 --skip-build --root "%{buildroot}" pushd "%{py3dir}" %{__python3} setup.py install -O1 --skip-build --root "%{buildroot}" popd %files %license COPYING %doc README CHANGELOG examples %files -n %{python2_package}-%{srcname} %license COPYING %doc README CHANGELOG examples %{python_sitearch}/* %files -n %{python3_package}-%{srcname} %license COPYING %doc README CHANGELOG examples %{python3_sitearch}/* %changelog * Thu Oct 26 2017 Tomasz Tomasik - 0.22-8 - Backport changes from pybluez-0.22-6.el7.centos.src.rpm (Mon May 01 2017 Tomasz Tomasik - 0.22-6) - Add a few changes to the SPEC file - Update requirements - Create subpackage: python2-bluez - Add support for EL7 - Rebuilt for EL7 * Thu Aug 03 2017 Fedora Release Engineering - 0.22-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.22-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 11 2017 Fedora Release Engineering - 0.22-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro HronĨok - 0.22-4 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 0.22-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Feb 04 2016 Fedora Release Engineering - 0.22-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Thu Jan 14 2016 Peter Robinson 0.22-1 - Update to 0.22 * Tue Nov 10 2015 Fedora Release Engineering - 0.21-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Tue Nov 10 2015 Fedora Release Engineering - 0.21-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Sun Jul 5 2015 Peter Robinson 0.21-1 - Update to 0.21 - Update SPEC, URL and Source, use %%license - Build python3 bindings too * Thu Jun 18 2015 Fedora Release Engineering - 0.18-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sun Aug 17 2014 Fedora Release Engineering - 0.18-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.18-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sun Aug 04 2013 Fedora Release Engineering - 0.18-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu Feb 14 2013 Fedora Release Engineering - 0.18-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Jul 21 2012 Fedora Release Engineering - 0.18-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sat Jan 14 2012 Fedora Release Engineering - 0.18-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Feb 08 2011 Fedora Release Engineering - 0.18-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Wed Jul 21 2010 David Malcolm - 0.18-2 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Wed Apr 14 2010 Will Woods - 0.18-1 - Bugfix update from upstream (includes btmodule patch) * Wed Oct 08 2009 Paulo Roma - 0.16-2 - Applied btmodule patch. * Tue Jul 28 2009 Will Woods - 0.16-1 - New (bugfix) release from upstream * Sun Jul 26 2009 Fedora Release Engineering - 0.15-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 0.15-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.15-3 - Rebuild for Python 2.6 * Thu Sep 11 2008 - Bastien Nocera - 0.15-2 - Rebuild * Wed Jun 4 2008 Will Woods - 0.15-1 - New upstream version * Wed Feb 20 2008 Fedora Release Engineering - 0.9.1-4 - Autorebuild for GCC 4.3 * Fri Dec 29 2006 - Will Woods - 0.9.1-3 - Clean up spec file some more after further comments in bug #218678 * Fri Dec 15 2006 - Will Woods - 0.9.1-2 - Clean up spec file according to comments in bug #218678 * Wed Dec 6 2006 - Will Woods - 0.9.1-1 - Initial packaging attempt.