%global srcname pyrad
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif
%global commit 1ca2da3e3af07a4cfb8bad1964d4687351888681
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: python-pyrad
Version: 2.0
Release: 14.git%{shortcommit}%{?dist}
Summary: Python RADIUS client
License: BSD
URL: https://github.com/wichert/pyrad
Source0: %{url}/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz
BuildArch: noarch
# docs
BuildRequires: python2-sphinx
%global _description \
pyrad is an implementation of a RADIUS client as described in RFC2865. It takes\
care of all the details like building RADIUS packets, sending them and decoding\
responses.
%description %{_description}
%package -n python2-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires: python2-devel
%if 0%{?rhel} && 0%{?rhel} <= 7
BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: python-netaddr
BuildRequires: python-six
Requires: python-netaddr
Requires: python-six
%else
BuildRequires: python2-setuptools
BuildRequires: python2-nose
BuildRequires: python2-netaddr
BuildRequires: python2-six
Requires: python2-netaddr
Requires: python2-six
%endif
Requires: python2-twisted
%description -n python2-%{srcname} %{_description}
Python 2 version.
%if %{with python3}
%package -n python3-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-netaddr
BuildRequires: python3-six
Requires: python3-netaddr
Requires: python3-six
Requires: python3-twisted
%description -n python3-%{srcname} %{_description}
Python 3 version.
%endif
%prep
%autosetup -n %{srcname}-%{commit}
# Fedora-specific - to avoid picking up dependencies from these files
chmod 644 example/acct.py example/auth.py example/server.py
%build
%py2_build
%if %{with python3}
%py3_build
%endif
sphinx-build -b html docs/ docs/_build/html/ -d docs/_build/doctrees/
%install
%py2_install
%if %{with python3}
%py3_install
%endif
rm -f docs/_build/html/.buildinfo
%check
%{__python2} setup.py test
%if %{with python3}
%{__python3} setup.py test
%endif
%files -n python2-%{srcname}
%license LICENSE.txt
%doc CHANGES.txt README.rst example/ docs/_build/html/
%{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/
%if %{with python3}
%files -n python3-%{srcname}
%license LICENSE.txt
%doc CHANGES.txt README.rst example/ docs/_build/html/
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%endif
%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.0-14.git1ca2da3
- Rebuilt for Python 3.7
* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0-13.git1ca2da3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-12.git1ca2da3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-11.git1ca2da3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-10.git1ca2da3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.0-9.git1ca2da3
- Rebuild for Python 3.6
* Wed Aug 31 2016 Peter Lemenkov <lemenkov@gmail.com> - 2.0-8.git1ca2da3
- Rebase to the latest git commit
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Sep 05 2013 Peter Lemenkov <lemenkov@gmail.com> - 2.0-3
- Better random number generator
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Jul 11 2013 Christopher Meng <rpm@cicku.me> - 2.0-1
- Update to 2.0 version.
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Sep 6 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.1-5
- Cleaned up spec-file
- Added %%check section
- Dropped support for fedora > 9
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sat Apr 11 2009 Peter Lemenkov <lemenkov@gmail.com> - 1.1-2
- Fixed rpmling warning
- Changed 'files' section
- Added missing requires python-twisted-core
* Sat Apr 11 2009 Peter Lemenkov <lemenkov@gmail.com> - 1.1-1
- Initial build