d560f3
%global srcname cvss
Igor Gnatenko fb84e9
Igor Gnatenko fb84e9
%if 0%{?rhel} && 0%{?rhel} <= 7
1e688a
%bcond_without python2
Igor Gnatenko fb84e9
%bcond_with python3
Igor Gnatenko fb84e9
%else
1e688a
%bcond_with python2
Igor Gnatenko fb84e9
%bcond_without python3
Igor Gnatenko fb84e9
%endif
d560f3
d560f3
Name:           python-%{srcname}
25cdc1
Version:        2.1
25cdc1
Release:        1%{?dist}
Igor Gnatenko fb84e9
Summary:        CVSS2/3 library with interactive calculator
d560f3
746836
License:        LGPLv3+
d560f3
URL:            https://github.com/skontar/cvss
Igor Gnatenko fb84e9
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
d560f3
d560f3
BuildArch:      noarch
d560f3
Igor Gnatenko fb84e9
%global _description \
Igor Gnatenko fb84e9
This Python package contains CVSS v2 and v3 computation utilities and\
Igor Gnatenko fb84e9
interactive calculator.
d560f3
Igor Gnatenko fb84e9
%description %{_description}
d560f3
1e688a
# Python 2 Package
1e688a
# (RHEL Only)
1e688a
%if %{with python2}
d560f3
%package -n python2-%{srcname}
d560f3
Summary:        %{summary}
Igor Gnatenko fb84e9
%{?python_provide:%python_provide python2-%{srcname}}
Igor Gnatenko fb84e9
BuildRequires:  python2-devel
Igor Gnatenko fb84e9
%if 0%{?rhel} && 0%{?rhel} <= 7
Igor Gnatenko fb84e9
BuildRequires:  python-setuptools
Igor Gnatenko fb84e9
%if 0%{?rhel} == 6
Igor Gnatenko fb84e9
Requires:       python-ordereddict
Igor Gnatenko fb84e9
%endif
Igor Gnatenko fb84e9
%else
Igor Gnatenko fb84e9
BuildRequires:  python2-setuptools
Igor Gnatenko fb84e9
%endif
d560f3
Igor Gnatenko fb84e9
%description -n python2-%{srcname} %{_description}
d560f3
Igor Gnatenko fb84e9
Python 2 version.
25cdc1
%endif
25cdc1
# end with python2
Igor Gnatenko fb84e9
1e688a
# Python 3 Package
Igor Gnatenko fb84e9
%if %{with python3}
d560f3
%package -n python3-%{srcname}
Igor Gnatenko fb84e9
Summary:        %{summary}
d560f3
%{?python_provide:%python_provide python3-%{srcname}}
Igor Gnatenko fb84e9
BuildRequires:  python3-devel
Igor Gnatenko fb84e9
BuildRequires:  python3-setuptools
d560f3
Igor Gnatenko fb84e9
%description -n python3-%{srcname} %{_description}
45f018
Igor Gnatenko fb84e9
Python 3 version.
25cdc1
%endif
25cdc1
# end with python3
d560f3
d560f3
%prep
Igor Gnatenko fb84e9
%autosetup -n %{srcname}-%{version}
45f018
d560f3
%build
1e688a
%if %{with python2}
d560f3
%py2_build
1e688a
%endif
Igor Gnatenko fb84e9
%if %{with python3}
d560f3
%py3_build
45f018
%endif
d560f3
d560f3
%install
1e688a
%if %{with python2}
d560f3
%py2_install
1e688a
%endif
Igor Gnatenko fb84e9
%if %{with python3}
d560f3
%py3_install
45f018
%endif
45f018
Igor Gnatenko fb84e9
# Tests are not ran (have to patch code and use nose/pytest)
Igor Gnatenko fb84e9
#check
d560f3
1e688a
%if %{with python2}
d560f3
%files -n python2-%{srcname}
d560f3
%doc README.rst
45f018
%license LICENSE
Igor Gnatenko fb84e9
%{python2_sitelib}/%{srcname}-*.egg-info/
Igor Gnatenko fb84e9
%{python2_sitelib}/%{srcname}/
1e688a
%endif
d560f3
Igor Gnatenko fb84e9
%if %{with python3}
d560f3
%files -n python3-%{srcname}
d560f3
%doc README.rst
45f018
%license LICENSE
Igor Gnatenko fb84e9
%{python3_sitelib}/%{srcname}-*.egg-info/
Igor Gnatenko fb84e9
%{python3_sitelib}/%{srcname}/
45f018
%endif
d560f3
Igor Gnatenko fb84e9
%{_bindir}/cvss_calculator
d560f3
d560f3
%changelog
25cdc1
* Fri Feb 07 2020 Viliam Krizan <vkrizan@redhat.com> - 2.1-1
25cdc1
- New release 2.1 (#1793040)
25cdc1
b08f10
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
b08f10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
b08f10
29011a
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0-2
29011a
- Rebuilt for Python 3.8.0rc1 (#1748018)
29011a
3bc56b
* Fri Aug 30 2019 Viliam Krizan <vkrizan@redhat.com> - 2.0-1
3bc56b
- New release 2.0 with CVSSv3.1 support (rhbz#1747163)
3bc56b
eebf4f
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10-3
eebf4f
- Rebuilt for Python 3.8
eebf4f
2d1c80
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
2d1c80
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2d1c80
3d4483
* Mon Jun 03 2019 Viliam Krizan <vkrizan@redhat.com> - 1.10-1
3d4483
- New release 1.10
3d4483
484778
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-3
484778
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
484778
1e688a
* Wed Sep 19 2018 Viliam Krizan <vkrizan@redhat.com> - 1.9-2
1e688a
- Removal of deprecated python2-cvss package for Fedora,
1e688a
  as part of https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
1e688a
  (RHBZ #1628566)
1e688a
7dda4f
* Mon Aug 06 2018 Viliam Krizan <vkrizan@redhat.com> - 1.9-1
7dda4f
- New release 1.9
7dda4f
- The CVSS vector parser from an arbitrary text was added.
7dda4f
dab2ff
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
dab2ff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
dab2ff
b1331e
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8-2
b1331e
- Rebuilt for Python 3.7
b1331e
b3df0f
* Tue Jun 26 2018 Viliam Krizan <vkrizan@redhat.com> - 1.8-1
b3df0f
- New release 1.8 (RHBZ #1594561)
b3df0f
- Convenience improvements for testing and interactive calculator
b3df0f
- Improved handling of empty fields
b3df0f
5d752d
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.7-5
5d752d
- Rebuilt for Python 3.7
5d752d
b67268
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-4
b67268
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b67268
5c35a3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-3
5c35a3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5c35a3
010202
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-2
010202
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
010202
d24597
* Thu Jan 12 2017 pjp <pjp@fedoraproject.org> - 1.7-1
d24597
- New release 1.7 (RHBZ #1412158)
d24597
be4c9d
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.6-2
be4c9d
- Rebuild for Python 3.6
be4c9d
000c27
* Fri Dec 09 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.6-1
000c27
- Update to 1.6 (RHBZ #1402174)
000c27
Igor Gnatenko 7730ab
* Fri Nov 04 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.5-1
Igor Gnatenko 7730ab
- Update to 1.5
Igor Gnatenko 7730ab
Igor Gnatenko fb84e9
* Thu Sep 08 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.4-2
Igor Gnatenko fb84e9
- Fixes in packaging
Igor Gnatenko fb84e9
746836
* Wed Aug 31 2016 pjp <pjp@fedoraproject.org> - 1.4-1
746836
- New release v1.4.
746836
- License changed to LGPLv3+
746836
45f018
* Fri Aug 26 2016 pjp <pjp@fedoraproject.org> - 1.3-2
45f018
- Separate sections for Fedora and EPEL builds
45f018
d560f3
* Wed Aug 24 2016 pjp <pjp@fedoraproject.org> - 1.3-1
d560f3
- Update to new release.
d560f3
d560f3
* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-4
d560f3
- Updated Source0 URL BZ#1334611#c6.
d560f3
d560f3
* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-3
d560f3
- Added BuildRequires and summary macro as per BZ#1334611#c4.
d560f3
d560f3
* Wed Aug 17 2016 pjp <pjp@fedoraproject.org> - 1.2-2
d560f3
- Separated Python v2 and v3 builds in respective packages as
d560f3
  suggested in BZ#1334611#c1.
d560f3
d560f3
* Tue May 10 2016 pjp <pjp@fedoraproject.org> - 1.2-1
d560f3
- Initial build of Python cvss package.