Blob Blame History Raw
%global srcname cvss

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

Name:           python-%{srcname}
Version:        1.7
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}

%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.

%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

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

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

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

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

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

%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
* 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.