%define scl rh-python36 %{?scl:%scl_package %{name}} %{!?scl:%global pkg_name %{name}} %define name pyrad %define version 2.3 %define unmangled_version 2.3 %define unmangled_version 2.3 %define release 1 Summary: RADIUS tools %{?scl:Requires: %{scl}-runtime} %{?scl:BuildRequires: %{scl}-runtime} Name: %{?scl_prefix}%{pkg_name} Version: %{version} Release: %{release} Source0: pyrad-%{unmangled_version}.tar.gz License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Wichert Akkerman Packager: Martin Juhl Url: https://github.com/wichert/pyrad %description .. image:: https://travis-ci.org/wichert/pyrad.svg?branch=master :target: https://travis-ci.org/wichert/pyrad .. image:: https://img.shields.io/pypi/v/pyrad.svg :target: https://pypi.python.org/pypi/pyrad .. image:: https://img.shields.io/pypi/dm/pyrad.svg :target: https://pypi.python.org/pypi/pyrad Introduction ============ pyrad is an implementation of a RADIUS client/server as described in RFC2865. It takes care of all the details like building RADIUS packets, sending them and decoding responses. Here is an example of doing a authentication request:: from __future__ import print_function from pyrad.client import Client from pyrad.dictionary import Dictionary import pyrad.packet srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi", dict=Dictionary("dictionary")) # create request req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest, User_Name="wichert", NAS_Identifier="localhost") req["User-Password"] = req.PwCrypt("password") # send request reply = srv.SendPacket(req) if reply.code == pyrad.packet.AccessAccept: print("access accepted") else: print("access denied") print("Attributes returned by server:") for i in reply.keys(): print("%s: %s" % (i, reply[i])) Requirements & Installation =========================== pyrad requires Python 2.6 or later, or Python 3.2 or later Installing is simple; pyrad uses the standard distutils system for installing Python modules:: python setup.py install Author, Copyright, Availability =============================== pyrad was written by Wichert Akkerman and is licensed under a BSD license. Copyright and license information can be found in the LICENSE.txt file. The current version and documentation can be found on pypi: http://pypi.python.org/pypi/pyrad Bugs and wishes can be submitted in the pyrad issue tracker on github: https://github.com/wichert/pyrad/issues %prep %{?scl:scl enable %{scl} - << \EOF} set -ex %setup -n pyrad-%{unmangled_version} -n pyrad-%{unmangled_version} %{?scl:EOF} %build %{?scl:scl enable %{scl} - << \EOF} set -ex python3 setup.py build %{?scl:EOF} %install %{?scl:scl enable %{scl} - << \EOF} set -ex python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES %{?scl:EOF} %clean %{?scl:scl enable %{scl} - << \EOF} set -ex rm -rf $RPM_BUILD_ROOT %{?scl:EOF} %files -f INSTALLED_FILES %defattr(-,root,root)