Blame SPECS/python-semantic_version.spec

87147c
%global pypi_name semantic_version
87147c
%if 0%{?rhel} && 0%{?rhel} <= 7
87147c
%bcond_with python3
87147c
%else
87147c
%bcond_without python3
87147c
%endif
87147c
87147c
%if 0%{?rhel} > 7
87147c
# Disable python2 build by default
87147c
%bcond_with python2
87147c
%else
87147c
%bcond_without python2
87147c
%endif
87147c
87147c
Name:           python-%{pypi_name}
87147c
Version:        2.6.0
87147c
Release:        5%{?dist}
87147c
Summary:        Library implementing the 'SemVer' scheme
87147c
87147c
License:        BSD
87147c
URL:            https://github.com/rbarrois/python-semanticversion
87147c
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
87147c
BuildArch:      noarch
87147c
87147c
Patch1:         0001-Fix-django-tests.patch
87147c
87147c
%global _description \
87147c
This small python library provides a few tools to handle semantic versioning\
87147c
in Python.
87147c
87147c
%description %{_description}
87147c
87147c
%if %{with python2}
87147c
%package -n     python2-%{pypi_name}
87147c
Summary:        %{summary}
87147c
BuildRequires:  python2-devel
87147c
%if 0%{?rhel} && 0%{?rhel} <= 7
87147c
BuildRequires:  python-setuptools
87147c
%else
87147c
BuildRequires:  python2-setuptools
87147c
%endif
87147c
#BuildRequires:  python2-django
87147c
%{?python_provide:%python_provide python2-%{pypi_name}}
87147c
Provides:       python-semantic-version
87147c
87147c
%description -n python2-%{pypi_name} %{_description}
87147c
87147c
Python 2 version.
87147c
%endif # with python2
87147c
87147c
%if 0%{?with_python3}
87147c
%package -n     python3-%{pypi_name}
87147c
Summary:        %{summary}
87147c
BuildRequires:  python3-devel
87147c
BuildRequires:  python3-setuptools
87147c
#BuildRequires:  python3-django
87147c
%{?python_provide:%python_provide python3-%{pypi_name}}
87147c
87147c
%description -n python3-%{pypi_name} %{_description}
87147c
87147c
Python 3 version
87147c
%endif
87147c
87147c
%package doc
87147c
Summary:        Documentation for python-%{pypi_name}
87147c
BuildRequires:  python3-sphinx
87147c
87147c
%description doc
87147c
%{summary}.
87147c
87147c
%prep
87147c
%autosetup -p1 -n python-semanticversion-%{version}
87147c
# Remove bundled egg-info
87147c
rm -rf %{pypi_name}.egg-info
87147c
# documentation builds due to broken symlink
87147c
# https://github.com/rbarrois/python-semanticversion/issues/20
87147c
rm docs/credits.rst
87147c
87147c
%build
87147c
%if %{with python2}
87147c
%py2_build
87147c
%endif # with python2
87147c
%if %{with python3}
87147c
%py3_build
87147c
%endif
87147c
# generate html docs
87147c
sphinx-build-3 docs html
87147c
# remove the sphinx-build leftovers
87147c
rm -rf html/.{doctrees,buildinfo}
87147c
87147c
%install
87147c
%if %{with python2}
87147c
%py2_install
87147c
%endif # with python2
87147c
%if %{with python3}
87147c
%py3_install
87147c
%endif
87147c
87147c
%check
87147c
%if %{with python2}
87147c
%{__python2} setup.py test
87147c
%endif # with python2
87147c
%if %{with python3}
87147c
%{__python3} setup.py test
87147c
%endif
87147c
87147c
%if %{with python2}
87147c
%files -n python2-%{pypi_name}
87147c
%license LICENSE
87147c
%doc README.rst ChangeLog
87147c
%{python2_sitelib}/%{pypi_name}/
87147c
%{python2_sitelib}/%{pypi_name}-*.egg-info/
87147c
%endif # with python2
87147c
87147c
%if %{with python3}
87147c
%files -n python3-%{pypi_name}
87147c
%license LICENSE
87147c
%doc README.rst ChangeLog
87147c
%{python3_sitelib}/%{pypi_name}/
87147c
%{python3_sitelib}/%{pypi_name}-*.egg-info/
87147c
%endif
87147c
87147c
%files doc
87147c
%license LICENSE
87147c
%doc html
87147c
87147c
%changelog
87147c
* Wed Jul 18 2018 Brian C. Lane <bcl@redhat.com> - 2.6.0-5
87147c
- Enable tests
87147c
- Fix django test, it should be skipped when django is not installed
87147c
87147c
* Wed Jul 18 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.6.0-4
87147c
- Conditionalize the python2 subpackage
87147c
- Use python3-sphinx for docs
87147c
- Remove django dependency
87147c
87147c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-3
87147c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
87147c
87147c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-2
87147c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
87147c
87147c
* Sat Jan 28 2017 Igor Gnatenko <ignatenko@redhat.com> - 2.6.0-1
87147c
- Update to 2.6.0
87147c
- Make package to comply guidelines
87147c
87147c
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-3
87147c
- Rebuild for Python 3.6
87147c
87147c
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.0-2
87147c
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
87147c
87147c
* Wed Feb 24 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 2.5.0-1
87147c
- Upstream 2.5.0
87147c
- Add python3 subpackage
87147c
87147c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-2
87147c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
87147c
87147c
* Fri Jul 03 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.4.2-1
87147c
- Upstream 2.4.2
87147c
87147c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-2
87147c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
87147c
87147c
* Wed Apr 01 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.4.1-1
87147c
- Upstream 2.4.1
87147c
87147c
* Mon Mar 30 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.3.1-1
87147c
- Initial package.