%global srcname junos-eznc %global sum Junos 'EZ' automation for non-programmers %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{srcname} Version: 2.0.1 Release: 1%{?dist} Summary: %{sum} License: ASL 2.0 #URL: https://pypi.python.org/pypi/%{srcname} URL: http://www.github.com/Juniper/py-junos-eznc Source0: https://files.pythonhosted.org/packages/source/j/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: libxml2-devel BuildRequires: libxslt-devel BuildRequires: libyaml-devel BuildRequires: python2-devel BuildRequires: python-jinja2 >= 2.7.1 BuildRequires: python-lxml >= 3.2.4 BuildRequires: python-ncclient >= 0.4.6 BuildRequires: python-netaddr BuildRequires: python-paramiko >= 1.15.2 BuildRequires: pyserial BuildRequires: PyYAML >= 3.10 BuildRequires: python-scp >= 0.7.0 BuildRequires: python-six %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-jinja2 >= 2.7.1 BuildRequires: python3-lxml >= 3.2.4 # No python3 build : https://bugzilla.redhat.com/show_bug.cgi?id=1418622 #BuildRequires: python3-ncclient >= 0.4.6 BuildRequires: python3-netaddr BuildRequires: python3-paramiko >= 1.15.2 BuildRequires: python3-pyserial BuildRequires: python3-PyYAML >= 3.10 BuildRequires: python3-scp >= 0.7.0 BuildRequires: python3-six %endif %description Junos PyEZ is a Python library to remotely manage/automate Junos devices. The user is NOT required: (a) to be a "Software Programmerâ„¢", (b) have sophisticated knowledge of Junos, or (b) have a complex understanding of the Junos XML API. %package -n python2-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Junos PyEZ is a Python library to remotely manage/automate Junos devices. The user is NOT required: (a) to be a "Software Programmerâ„¢", (b) have sophisticated knowledge of Junos, or (b) have a complex understanding of the Junos XML API. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} Junos PyEZ is a Python library to remotely manage/automate Junos devices. The user is NOT required: (a) to be a "Software Programmerâ„¢", (b) have sophisticated knowledge of Junos, or (b) have a complex understanding of the Junos XML API. %endif %prep %autosetup -n %{srcname}-%{version} %build %py2_build %if 0%{?with_python3} %py3_build %endif %install # Must do the python2 install first because the scripts in /usr/bin are # overwritten with every setup.py install, and in general we want the # python3 version to be the default. %py2_install %if 0%{?with_python3} %py3_install %endif %check %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif # Note that there is no %%files section for the unversioned python module if we are building for several python runtimes %files -n python2-%{srcname} #license LICENSE #doc README.md %{python2_sitelib}/* %if 0%{?with_python3} %files -n python3-%{srcname} #license LICENSE #doc README.md %{python3_sitelib}/* %endif %changelog * Wed Feb 01 2017 Xavier Bachelot - 2.0.1-1 - Initial build.