Blame SPECS/python-string_utils.spec

87f4e4
%if 0%{?rhel} == 7
87f4e4
%bcond_with    python3
87f4e4
%bcond_without python2
87f4e4
%else
87f4e4
%bcond_with    python2
87f4e4
%bcond_without python3
87f4e4
%endif
87f4e4
87f4e4
%global library string_utils
87f4e4
87f4e4
Name:       python-%{library}
87f4e4
Version:    1.0.0
87f4e4
Release:    4%{?dist}
87f4e4
Summary:    A python module containing utility functions for strings
87f4e4
License:    MIT
87f4e4
URL:        https://github.com/daveoncode/python-string-utils
87f4e4
Source0:    https://github.com/daveoncode/python-string-utils/archive/v%{version}.tar.gz
87f4e4
BuildArch:  noarch
87f4e4
87f4e4
%if 0%{?with_python2}
87f4e4
%package -n python2-%{library}
87f4e4
Summary:    A python module containing utility functions for strings
87f4e4
%{?python_provide:%python_provide python2-%{library}}
87f4e4
87f4e4
BuildRequires: python2-devel
87f4e4
BuildRequires: python-setuptools
87f4e4
BuildRequires: git
87f4e4
87f4e4
Requires: python2
87f4e4
87f4e4
%description -n python2-%{library}
87f4e4
A python module containing utility functions for strings
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?with_python3}
87f4e4
%package -n python3-%{library}
87f4e4
Summary: A python module containing utility functions for strings
87f4e4
%if 0%{?rhel} < 8
87f4e4
%{?python_provide:%python_provide python%{python3_pkgversion}-%{library}}
87f4e4
%else
87f4e4
%{?python_provide:%python_provide python3-%{library}}
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?rhel}
87f4e4
%if 0%{?rhel} < 8
87f4e4
BuildRequires: python%{python3_pkgversion}-coverage
87f4e4
BuildRequires: python%{python3_pkgversion}-devel
87f4e4
BuildRequires: python%{python3_pkgversion}-pip
87f4e4
BuildRequires: python%{python3_pkgversion}-setuptools
87f4e4
BuildRequires: python%{python3_pkgversion}-wheel
87f4e4
%else
87f4e4
BuildRequires: python3-coverage
87f4e4
BuildRequires: python3-devel
87f4e4
BuildRequires: python3-pip
87f4e4
BuildRequires: python3-setuptools
87f4e4
BuildRequires: python3-wheel
87f4e4
%endif
87f4e4
%else
87f4e4
BuildRequires: python3-coverage
87f4e4
BuildRequires: python3-devel
87f4e4
BuildRequires: python3-pip
87f4e4
BuildRequires: python3-setuptools
87f4e4
BuildRequires: python3-sphinx_rtd_theme
87f4e4
BuildRequires: python3-wheel
87f4e4
%endif
87f4e4
BuildRequires: git
87f4e4
87f4e4
%description -n python3-%{library}
87f4e4
A python module containing utility functions for strings
87f4e4
%endif
87f4e4
87f4e4
#recommonmark not available for docs in EPEL
87f4e4
%if 0%{?fedora}
87f4e4
%package doc
87f4e4
Summary: Documentation for %{name}.
87f4e4
%if 0%{?with_python3}
87f4e4
BuildRequires: python3-sphinx
87f4e4
BuildRequires: python3-recommonmark
87f4e4
%else
87f4e4
BuildRequires: python2-sphinx
87f4e4
BuildRequires: python2-recommonmark
87f4e4
%endif
87f4e4
%description doc
87f4e4
%{summary}
87f4e4
%endif
87f4e4
87f4e4
%description
87f4e4
A python module containing utility functions for strings
87f4e4
87f4e4
%prep
87f4e4
%autosetup -n python-string-utils-%{version} -S git
87f4e4
87f4e4
# Let's handle dependencies ourseleves
87f4e4
87f4e4
%build
87f4e4
%if 0%{?with_python2}
87f4e4
%if 0%{?rhel} < 8
87f4e4
%py_build
87f4e4
%else
87f4e4
%py2_build
87f4e4
%endif
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?with_python3}
87f4e4
%py3_build
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?fedora}
87f4e4
sphinx-build docs/ html
87f4e4
%{__rm} -rf html/.buildinfo
87f4e4
%{__rm} -rf html/.doctrees
87f4e4
%endif
87f4e4
87f4e4
%install
87f4e4
%if 0%{?with_python2}
87f4e4
87f4e4
%if 0%{?rhel} < 8
87f4e4
%py_install
87f4e4
%else
87f4e4
%py2_install
87f4e4
%endif
87f4e4
87f4e4
mkdir -p %buildroot/%_defaultdocdir/python2-string_utils
87f4e4
install -p -m 644 %buildroot/usr/README/README.md %buildroot/%_defaultdocdir/python2-%{library}
87f4e4
%{__rm} -f %buildroot/usr/README/README.md
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?with_python3}
87f4e4
%py3_install
87f4e4
mkdir -p %buildroot/%_defaultdocdir/python3-string_utils
87f4e4
install -p -m 644 %buildroot/usr/README/README.md %buildroot/%_defaultdocdir/python3-%{library}
87f4e4
%{__rm} -f %buildroot/usr/README/README.md
87f4e4
%endif
87f4e4
87f4e4
%check
87f4e4
87f4e4
%if 0%{?with_python2}
87f4e4
coverage run -m unittest
87f4e4
%endif
87f4e4
%if 0%{?with_python3}
87f4e4
coverage run -m unittest
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?with_python2}
87f4e4
%files -n python2-%{library}
87f4e4
%license %attr(644,-,-) LICENSE
87f4e4
87f4e4
%if 0%{?rhel} < 8
87f4e4
%doc %{_defaultdocdir}/python2-%{library}/README.md
87f4e4
%else
87f4e4
%doc README.md
87f4e4
%endif
87f4e4
87f4e4
%{python2_sitelib}/%{library}/
87f4e4
%{python2_sitelib}/python_%{library}-*.egg-info
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?with_python3}
87f4e4
%files -n python3-%{library}
87f4e4
%license %attr(644,-,-) LICENSE
87f4e4
87f4e4
%if 0%{?rhel} < 8
87f4e4
%doc %{_defaultdocdir}/python3-%{library}/README.md
87f4e4
%else
87f4e4
%doc README.md
87f4e4
%endif
87f4e4
87f4e4
%{python3_sitelib}/%{library}/
87f4e4
%{python3_sitelib}/python_%{library}-*.egg-info
87f4e4
%endif
87f4e4
87f4e4
%if 0%{?fedora}
87f4e4
%files doc
87f4e4
%license %attr(644,-,-) LICENSE
87f4e4
%doc html
87f4e4
%endif
87f4e4
87f4e4
%changelog
87f4e4
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
87f4e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
87f4e4
87f4e4
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
87f4e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
87f4e4
87f4e4
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-2
87f4e4
- Rebuilt for Python 3.9
87f4e4
87f4e4
* Thu Apr 30 2020 Jason Montleon <jmontleo@redhat.com> - 1.0.0-1
87f4e4
- Update to 1.0.0. Drops Python 2 support.
87f4e4
87f4e4
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-11
87f4e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
87f4e4
87f4e4
* Thu Jan 23 2020 Yatin Karel <ykarel@redhat.com> - 0.6.0-10
87f4e4
- Fix condition for El8
87f4e4
87f4e4
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-8
87f4e4
- Rebuilt for Python 3.8.0rc1 (#1748018)
87f4e4
87f4e4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.6.0-7
87f4e4
- Rebuilt for Python 3.8
87f4e4
87f4e4
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-6
87f4e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
87f4e4
87f4e4
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-5
87f4e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
87f4e4
87f4e4
* Wed Dec 19 2018 Daniel Mellado <dmellado@redhat.com> 0.6.0-4
87f4e4
- Fix rpmlint permissions issues
87f4e4
- Fix docs
87f4e4
- Fix doctree removal
87f4e4
- Fix version mismatch in spec
87f4e4
87f4e4
* Tue Dec 4 2018 John Kim <jkim@redhat.com> 0.6.0-3
87f4e4
- Fixed URL, Source0
87f4e4
- Enable disable python3 for rhel
87f4e4
- Enable test
87f4e4
- Add doc
87f4e4
87f4e4
* Wed May 10 2017 Jason Montleon <jmontleo@redhat.com> 0.6.0-2
87f4e4
- Fix python_provide for EL7 python3
87f4e4
87f4e4
* Wed May 10 2017 Jason Montleon <jmontleo@redhat.com> 0.6.0-1
87f4e4
- Initial Build