Blob Blame History Raw
%global srcname bigsuds
%global sum Library for F5 Networks iControl API

%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-%{srcname}
Version:        1.0.6
Release:        3%{?dist}
Summary:        %{sum}

License:        MIT
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://github.com/F5Networks/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz

Patch0:         python-bigsuds-1.0.6-Fix_deps_on_suds_and_mox.patch

BuildArch:      noarch
BuildRequires:  python2-devel
%if 0%{?el6}%{?el7}
BuildRequires:  python-suds
BuildRequires:  python-nose
BuildRequires:  python-six
%{!?el6:BuildRequires:  python-mox}
%else
BuildRequires:  python2-suds
BuildRequires:  python2-nose
BuildRequires:  python2-six
BuildRequires:  python2-mox
%endif
BuildRequires:  python2-mock
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-suds
BuildRequires:  python3-nose
BuildRequires:  python3-mock
# No python3-mox available, only python2 flavor
#BuildRequires:  python3-mox
BuildRequires:  python3-six
%endif

%description
%{sum}.

%package -n python2-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
%if 0%{?el6}%{?el7}
Requires:       python-suds
%else
Requires:       python2-suds
%endif

%description -n python2-%{srcname}
%{sum}.

%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{srcname}}
Requires:       python3-suds

%description -n python3-%{srcname}
%{sum}.
%endif


%prep
%autosetup -n %{srcname}-%{version} -p1

# Remove erroneous shebang
sed -i -e '/^#!\//, 1d' bigsuds.py


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif


%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif

%check
%{__python2} test_bigsuds.py
%if 0%{?with_python3}
%{__python3} test_bigsuds.py
%endif


%files -n python2-%{srcname}
%license LICENSE
%doc CHANGELOG README.md TERMS_OF_USE
%{python2_sitelib}/*

%if 0%{?with_python3}
%files -n python3-%{srcname}
%license LICENSE
%doc CHANGELOG README.md TERMS_OF_USE
%{python3_sitelib}/*
%endif


%changelog
* Mon Jul 09 2018 Xavier Bachelot <xavier@bachelot.org> - 1.0.6-3
- Fix Requires: on EL.

* Fri Jul 06 2018 Xavier Bachelot <xavier@bachelot.org> - 1.0.6-2
- Fix typo.

* Wed Dec 13 2017 Xavier Bachelot <xavier@bachelot.org> - 1.0.6-1
- Initial package.