diff --git a/python-paho-mqtt.spec b/python-paho-mqtt.spec index 376094b..54f7628 100644 --- a/python-paho-mqtt.spec +++ b/python-paho-mqtt.spec @@ -1,16 +1,10 @@ -%if 0%{?fedora} > 12 -%global with_python3 1 -%else -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif - %global scrname paho-mqtt +%global sum A Python MQTT version 3.1/3.1.1 client class Name: python-paho-mqtt Version: 1.1 -Release: 3%{?dist} -Summary: A Python MQTT version 3.1/3.1.1 client class +Release: 4%{?dist} +Summary: %{sum} License: EPL URL: http://eclipse.org/paho/ @@ -18,12 +12,7 @@ Source0: https://pypi.python.org/packages/source/p/%{scrname}/%{scrname}- Buildarch: noarch BuildRequires: python2-devel -BuildRequires: python-setuptools - -%if 0%{?with_python3} BuildRequires: python3-devel -BuildRequires: python3-setuptools -%endif %description This library provides a client class which enable applications to connect to @@ -36,14 +25,26 @@ as an extremely lightweight publish/subscribe messaging transport, it is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. -%if 0%{?with_python3} -%package -n python3-paho-mqtt -Summary: A Python MQTT version 3.1/3.1.1 client class +%package -n python2-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +This library provides a client class which enable applications to connect to +an MQTT broker to publish messages, and to subscribe to topics and receive +published messages. It also provides some helper functions to make publishing +one off messages to an MQTT server very straightforward. + +The MQTT protocol is a machine-to-machine (M2M) connectivity protocol. Designed +as an extremely lightweight publish/subscribe messaging transport, it is useful +for connections with remote locations where a small code footprint is required +and/or network bandwidth is at a premium. -Requires: python3 -BuildArch: noarch +%package -n python3-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-paho-mqtt +%description -n python3-%{srcname} This library provides a client class which enable applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages. It also provides some helper functions to make publishing @@ -53,47 +54,34 @@ The MQTT protocol is a machine-to-machine (M2M) connectivity protocol. Designed as an extremely lightweight publish/subscribe messaging transport, it is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. -%endif %prep -%setup -q -n %{scrname}-%{version} - sed -i "s|\r||g" CONTRIBUTING.md -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif +%autosetup -n %{srcname}-%{version} %build -%{__python2} setup.py build -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif # with_python3 +%py2_build +%py3_build %install -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -popd -%endif # with_python3 -%{__python2} setup.py install --skip-build --root %{buildroot} - -%files -%doc CONTRIBUTING.md LICENSE.txt README.rst *.html +%py2_install +%py3_install + +%files -n python2-%{srcname} +%doc CONTRIBUTING.md README.rst *.html +%license LICENSE.txt %{python2_sitelib}/paho/ %{python2_sitelib}/paho*.egg-info -%if 0%{?with_python3} -%files -n python3-paho-mqtt -%doc CONTRIBUTING.md LICENSE.txt README.rst *.html +%files -n python3-%{srcname} +%doc CONTRIBUTING.md README.rst *.html +%license LICENSE.txt %{python3_sitelib}/paho/ %{python3_sitelib}/paho*.egg-info -%endif # with_python3 %changelog +* Sat Nov 14 2015 Fabian Affolter - 1.1-4 +- Cleanup + * Tue Nov 10 2015 Fedora Release Engineering - 1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5