%global srcname cvss %global summary CVSS2/3 library with interactive calculator Name: python-%{srcname} Version: 1.3 Release: 2%{?dist} Summary: %{summary} License: GPLv3+ URL: https://github.com/skontar/cvss Source0: https://github.com/skontar/cvss/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if 0%{?fedora} >= 23 BuildRequires: python3-devel BuildRequires: python2-setuptools BuildRequires: python3-setuptools %else BuildRequires: python-setuptools %endif %description This Python package contains CVSS v2 and v3 computation utilities and interactive calculator compatible with both Python v2 and v3. %if 0%{?fedora} >= 23 %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{name}} %description -n python2-%{srcname} This Python package contains CVSS v2 and v3 computation utilities and interactive calculator compatible with Python v2. %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} This python package contains CVSS v2 and v3 computation utilities and interactive calculator compatible with Python v3. %endif %prep %setup -q -n %{srcname}-%{version} %build %if 0%{?fedora} >= 23 %py2_build %py3_build %else %{__python} setup.py build %endif %install %if 0%{?fedora} >= 23 %py2_install %py3_install %else %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT rm $RPM_BUILD_ROOT%{python2_sitelib}/cvss/cvss3.py* rm $RPM_BUILD_ROOT%{python2_sitelib}/cvss/constants3.py* %endif %check %if 0%{?fedora} >= 23 %{__python2} setup.py test %{__python3} setup.py test %else %{__python} setup.py test %endif %if 0%{?fedora} >= 23 %files -n python2-%{srcname} %doc README.rst %license LICENSE %{python2_sitelib}/cvss* %files -n python3-%{srcname} %doc README.rst %license LICENSE %{python3_sitelib}/cvss* %{_bindir}/cvss_calculator %else %files %doc README.rst %license LICENSE %{python2_sitelib}/cvss* %{_bindir}/cvss_calculator %endif %changelog * Fri Aug 26 2016 pjp - 1.3-2 - Separate sections for Fedora and EPEL builds * Wed Aug 24 2016 pjp - 1.3-1 - Update to new release. * Wed Aug 17 2016 pjp - 1.2-4 - Updated Source0 URL BZ#1334611#c6. * Wed Aug 17 2016 pjp - 1.2-3 - Added BuildRequires and summary macro as per BZ#1334611#c4. * Wed Aug 17 2016 pjp - 1.2-2 - Separated Python v2 and v3 builds in respective packages as suggested in BZ#1334611#c1. * Tue May 10 2016 pjp - 1.2-1 - Initial build of Python cvss package.