diff --git a/python-cvss.spec b/python-cvss.spec index 6e2372a..e5c535c 100644 --- a/python-cvss.spec +++ b/python-cvss.spec @@ -3,7 +3,7 @@ Name: python-%{srcname} Version: 1.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: %{summary} License: GPLv3+ @@ -12,15 +12,21 @@ Source0: https://github.com/skontar/cvss/archive/v%{version}/%{srcname}-% 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}} @@ -36,39 +42,66 @@ Summary: %{summary} %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 -sed -i '/^#!.*bin/ d' $RPM_BUILD_ROOT/%{python2_sitelib}/cvss/cvss_calculator.py +%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} -%license LICENSE %doc README.rst +%license LICENSE %{python2_sitelib}/cvss* - %files -n python3-%{srcname} -%license LICENSE %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.