Blob Blame History Raw
%global srcname cvss

%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_without python2
%bcond_with python3
%else
%bcond_with python2
%bcond_without python3
%endif

Name:           python-%{srcname}
Version:        2.1
Release:        1%{?dist}
Summary:        CVSS2/3 library with interactive calculator

License:        LGPLv3+
URL:            https://github.com/skontar/cvss
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

%global _description \
This Python package contains CVSS v2 and v3 computation utilities and\
interactive calculator.

%description %{_description}

# Python 2 Package
# (RHEL Only)
%if %{with python2}
%package -n python2-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires:  python2-devel
%if 0%{?rhel} && 0%{?rhel} <= 7
BuildRequires:  python-setuptools
%if 0%{?rhel} == 6
Requires:       python-ordereddict
%endif
%else
BuildRequires:  python2-setuptools
%endif

%description -n python2-%{srcname} %{_description}

Python 2 version.
%endif
# end with python2

# Python 3 Package
%if %{with python3}
%package -n python3-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%description -n python3-%{srcname} %{_description}

Python 3 version.
%endif
# end with python3

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

%build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
%py3_build
%endif

%install
%if %{with python2}
%py2_install
%endif
%if %{with python3}
%py3_install
%endif

# Tests are not ran (have to patch code and use nose/pytest)
#check

%if %{with python2}
%files -n python2-%{srcname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/
%endif

%if %{with python3}
%files -n python3-%{srcname}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%endif

%{_bindir}/cvss_calculator

%changelog
* Fri Feb 07 2020 Viliam Krizan <vkrizan@redhat.com> - 2.1-1
- New release 2.1 (#1793040)

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-2
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Fri Aug 30 2019 Viliam Krizan <vkrizan@redhat.com> - 2.0-1
- New release 2.0 with CVSSv3.1 support (rhbz#1747163)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10-3
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Mon Jun 03 2019 Viliam Krizan <vkrizan@redhat.com> - 1.10-1
- New release 1.10

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Wed Sep 19 2018 Viliam Krizan <vkrizan@redhat.com> - 1.9-2
- Removal of deprecated python2-cvss package for Fedora,
  as part of https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
  (RHBZ #1628566)

* Mon Aug 06 2018 Viliam Krizan <vkrizan@redhat.com> - 1.9-1
- New release 1.9
- The CVSS vector parser from an arbitrary text was added.

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8-2
- Rebuilt for Python 3.7

* Tue Jun 26 2018 Viliam Krizan <vkrizan@redhat.com> - 1.8-1
- New release 1.8 (RHBZ #1594561)
- Convenience improvements for testing and interactive calculator
- Improved handling of empty fields

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.7-5
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jan 12 2017 pjp <pjp@fedoraproject.org> - 1.7-1
- New release 1.7 (RHBZ #1412158)

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.6-2
- Rebuild for Python 3.6

* Fri Dec 09 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.6-1
- Update to 1.6 (RHBZ #1402174)

* Fri Nov 04 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.5-1
- Update to 1.5

* Thu Sep 08 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.4-2
- Fixes in packaging

* Wed Aug 31 2016 pjp <pjp@fedoraproject.org> - 1.4-1
- New release v1.4.
- License changed to LGPLv3+

* Fri Aug 26 2016 pjp <pjp@fedoraproject.org> - 1.3-2
- Separate sections for Fedora and EPEL builds

* Wed Aug 24 2016 pjp <pjp@fedoraproject.org> - 1.3-1
- Update to new release.

* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-4
- Updated Source0 URL BZ#1334611#c6.

* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-3
- Added BuildRequires and summary macro as per BZ#1334611#c4.

* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-2
- Separated Python v2 and v3 builds in respective packages as
  suggested in BZ#1334611#c1.

* Tue May 10 2016 pjp <pjp@fedoraproject.org> - 1.2-1
- Initial build of Python cvss package.