# needed for epel6 %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif # enable python3 on fedora %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif %global srcname pyzabbix %global commit 7b62b40d38bd0eb65ec1711961d44620d2880599 Name: python-pyzabbix Version: 0.7.2 Release: 1%{?dist} Summary: PyZabbix is a Python module for working with the Zabbix API # license is in README.markdown License: LGPLv2+ URL: https://github.com/lukecyca/pyzabbix Source0: https://github.com/lukecyca/pyzabbix/archive/%{commit}/%{srcname}-%{commit}.tar.gz#/%{srcname}-%{commit}.tar.gz BuildArch: noarch Requires: python-requests BuildRequires: python-devel BuildRequires: python-httpretty BuildRequires: python-nose BuildRequires: python-requests %if %{with python3} Requires: python3-requests BuildRequires: python3-devel BuildRequires: python3-httpretty BuildRequires: python3-requests %if 0%{?fedora} >= 22 BuildRequires: python3-nose %endif %endif %description %{summary}. %if %{with python3} %package -n python3-pyzabbix Summary: PyZabbix is a Python module for working with the Zabbix API License: LGPLv2 %description -n python3-pyzabbix %{summary}. %endif %prep %setup -q -n %{srcname}-%{commit} rm -rf *.egg-info %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %check %{__python2} setup.py nosetests %if %{with python3} %if 0%{?fedora} >= 22 %{__python3} setup.py nosetests %endif %endif %files %doc README.markdown examples/ %{python2_sitelib}/%{srcname} %{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info %if %{with python3} %files -n python3-pyzabbix %doc README.markdown examples/ %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info %endif %changelog * Thu Feb 12 2015 Piotr Popieluch - 0.7.2-1 - Initial package