cfc0c9
%if 0%{?rhel} > 7
cfc0c9
# Disable python2 build by default
cfc0c9
%bcond_with python2
cfc0c9
%else
cfc0c9
%bcond_without python2
cfc0c9
%endif
cfc0c9
cfc0c9
%global modname flask
cfc0c9
%global srcname Flask
cfc0c9
cfc0c9
Name:           python-%{modname}
cfc0c9
Version:        0.12.2
1f4e88
Release:        4%{?dist}
cfc0c9
Epoch:          1
cfc0c9
Summary:        A micro-framework for Python based on Werkzeug, Jinja 2 and good intentions
cfc0c9
cfc0c9
License:        BSD
cfc0c9
URL:            http://flask.pocoo.org/
1f4e88
Source0:        https://github.com/pallets/flask/releases/download/%{version}/Flask-%{version}.tar.gz
cfc0c9
cfc0c9
# rhbz#1623180
cfc0c9
# Backported just this patch because 0.12.3+ have added other changes we cannot take.
cfc0c9
Patch0001:      0001-detect-UTF-encodings-when-loading-json.patch
cfc0c9
1f4e88
# rhbz#1585318
1f4e88
# Backport 0.12.4 changes, other than the theme changes which cause no end of problems since
1f4e88
# they depend on their own pallets_sphinx_theme module.
1f4e88
Patch0002:      0002-Fix-ValueError-for-some-invalid-Range-requests.patch
1f4e88
Patch0003:      0003-be-smarter-about-adding-.cli-to-reloader-command.patch
1f4e88
cfc0c9
BuildArch:      noarch
cfc0c9
cfc0c9
%global _description \
cfc0c9
Flask is called a “micro-framework” because the idea to keep the core\
cfc0c9
simple but extensible. There is no database abstraction layer, no form\
cfc0c9
validation or anything else where different libraries already exist\
cfc0c9
that can handle that. However Flask knows the concept of extensions\
cfc0c9
that can add this functionality into your application as if it was\
cfc0c9
implemented in Flask itself. There are currently extensions for object\
cfc0c9
relational mappers, form validation, upload handling, various open\
cfc0c9
authentication technologies and more.
cfc0c9
cfc0c9
%description %{_description}
cfc0c9
cfc0c9
%if %{with python2}
cfc0c9
%package -n python2-%{modname}
cfc0c9
Summary:        %{summary}
cfc0c9
%{?python_provide:%python_provide python2-%{modname}}
cfc0c9
BuildRequires:  python2-devel
cfc0c9
BuildRequires:  python2-setuptools
cfc0c9
BuildRequires:  python2-pytest
cfc0c9
%if 0%{?fedora} >= 26
cfc0c9
BuildRequires:  python2-werkzeug
cfc0c9
Requires:       python2-werkzeug
cfc0c9
BuildRequires:  python2-jinja2
cfc0c9
Requires:       python2-jinja2
cfc0c9
BuildRequires:  python2-click
cfc0c9
Requires:       python2-click
cfc0c9
BuildRequires:  python2-itsdangerous
cfc0c9
Requires:       python2-itsdangerous
cfc0c9
%else
cfc0c9
BuildRequires:  python-werkzeug
cfc0c9
Requires:       python-werkzeug
cfc0c9
BuildRequires:  python-jinja2
cfc0c9
Requires:       python-jinja2
cfc0c9
BuildRequires:  python-click
cfc0c9
Requires:       python-click
cfc0c9
BuildRequires:  python-itsdangerous
cfc0c9
Requires:       python-itsdangerous
cfc0c9
%endif
cfc0c9
%description -n python2-%{modname} %{_description}
cfc0c9
cfc0c9
Python 2 version.
cfc0c9
%endif # with python2
cfc0c9
cfc0c9
%package -n python%{python3_pkgversion}-%{modname}
cfc0c9
Summary:        %{summary}
cfc0c9
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
cfc0c9
BuildRequires:  python%{python3_pkgversion}-devel
cfc0c9
BuildRequires:  python%{python3_pkgversion}-setuptools
cfc0c9
BuildRequires:  python%{python3_pkgversion}-pytest
cfc0c9
BuildRequires:  python%{python3_pkgversion}-jinja2
cfc0c9
BuildRequires:  python%{python3_pkgversion}-werkzeug
cfc0c9
BuildRequires:  python%{python3_pkgversion}-itsdangerous
cfc0c9
BuildRequires:  python%{python3_pkgversion}-click
cfc0c9
Requires:       python%{python3_pkgversion}-jinja2
cfc0c9
Requires:       python%{python3_pkgversion}-werkzeug
cfc0c9
Requires:       python%{python3_pkgversion}-itsdangerous
cfc0c9
Requires:       python%{python3_pkgversion}-click
cfc0c9
cfc0c9
%description -n python%{python3_pkgversion}-%{modname} %{_description}
cfc0c9
cfc0c9
Python 3 version.
cfc0c9
cfc0c9
%package doc
cfc0c9
Summary:        Documentation for %{name}
cfc0c9
Obsoletes:      python%{python3_pkgversion}-%{modname}-doc < 1:0.11.1-3
cfc0c9
BuildRequires:  python3-sphinx
cfc0c9
cfc0c9
%description doc
cfc0c9
Documentation and examples for %{name}.
cfc0c9
cfc0c9
%prep
cfc0c9
%autosetup -p1 -n %{srcname}-%{version}
cfc0c9
rm -rf examples/flaskr/
cfc0c9
rm -rf examples/minitwit/
cfc0c9
cfc0c9
%build
cfc0c9
%if %{with python2}
cfc0c9
%py2_build
cfc0c9
%endif # with python2
cfc0c9
%py3_build
cfc0c9
PYTHONPATH=`pwd` sphinx-build-3 -b html docs/ docs/_build/html/
cfc0c9
rm -rf docs/_build/html/{.buildinfo,.doctrees}
cfc0c9
cfc0c9
%install
cfc0c9
%if %{with python2}
cfc0c9
%py2_install
cfc0c9
mv %{buildroot}%{_bindir}/%{modname}{,-%{python2_version}}
cfc0c9
ln -s %{modname}-%{python2_version} %{buildroot}%{_bindir}/%{modname}-2
cfc0c9
%endif # with python2
cfc0c9
cfc0c9
%py3_install
cfc0c9
mv %{buildroot}%{_bindir}/%{modname}{,-%{python3_version}}
cfc0c9
ln -s %{modname}-%{python3_version} %{buildroot}%{_bindir}/%{modname}-3
cfc0c9
cfc0c9
%if %{with python2}
cfc0c9
ln -sf %{modname}-2 %{buildroot}%{_bindir}/%{modname}
cfc0c9
%else
cfc0c9
ln -sf %{modname}-3 %{buildroot}%{_bindir}/%{modname}
cfc0c9
%endif # with python2
cfc0c9
cfc0c9
%check
cfc0c9
export LC_ALL=C.UTF-8
cfc0c9
%if %{with python2}
cfc0c9
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -v
cfc0c9
%endif # with python2
cfc0c9
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v || :
cfc0c9
cfc0c9
%if %{with python2}
cfc0c9
%files -n python2-%{modname}
cfc0c9
%license LICENSE
cfc0c9
%doc CHANGES README
cfc0c9
%{_bindir}/%{modname}-2
cfc0c9
%{_bindir}/%{modname}-%{python2_version}
cfc0c9
%{python2_sitelib}/%{srcname}-*.egg-info/
cfc0c9
%{python2_sitelib}/%{modname}/
cfc0c9
cfc0c9
%{_bindir}/%{modname}
cfc0c9
%endif # with python2
cfc0c9
cfc0c9
%files -n python%{python3_pkgversion}-%{modname}
cfc0c9
%license LICENSE
cfc0c9
%doc CHANGES README
cfc0c9
%{_bindir}/%{modname}-3
cfc0c9
%{_bindir}/%{modname}-%{python3_version}
cfc0c9
%{python3_sitelib}/%{srcname}-*.egg-info/
cfc0c9
%{python3_sitelib}/%{modname}/
cfc0c9
cfc0c9
%if %{without python2}
cfc0c9
%{_bindir}/%{modname}
cfc0c9
%endif # without python2
cfc0c9
cfc0c9
%files doc
cfc0c9
%license LICENSE
cfc0c9
%doc docs/_build/html examples
cfc0c9
cfc0c9
%changelog
1f4e88
* Thu Nov 07 2019 Brian C. Lane <bcl@redhat.com> - 0.12.2-4
1f4e88
- Add upstream changes from 0.12.4
1f4e88
  Resolves: rhbz#1585318
1f4e88
- Add TestJSON to the gating test from upstream
1f4e88
  Related: rhbz#1585318
1f4e88
cfc0c9
* Wed Sep 05 2018 Brian C. Lane <bcl@redhat.com> - 0.12.2-3
cfc0c9
- detect UTF encodings when loading json (CVE-2018-1000656)
cfc0c9
  Resolves: rhbz#1623180
cfc0c9
cfc0c9
* Wed Jun 20 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:0.12.2-2
cfc0c9
- Conditionalize the python2 subpackage
cfc0c9
cfc0c9
* Thu Feb 15 2018 itamar <itamar@ispbrasil.com.br> - 1:0.12.2-1
cfc0c9
- new version
cfc0c9
cfc0c9
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.11.1-8
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cfc0c9
cfc0c9
* Thu Jan 18 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1:0.11.1-7
cfc0c9
- Update Python 2 dependency declarations to new packaging standards
cfc0c9
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
cfc0c9
cfc0c9
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.11.1-6
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cfc0c9
cfc0c9
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.11.1-5
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cfc0c9
cfc0c9
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 1:0.11.1-4
cfc0c9
- Rebuild for Python 3.6
cfc0c9
- Have rpmbuild to not fail on python3 test failures
cfc0c9
cfc0c9
* Mon Aug 22 2016 Igor Gnatenko <ignatenko@redhat.com> - 1:0.11.1-3
cfc0c9
- Fix FTBFS
cfc0c9
- Ton of fixes in spec
cfc0c9
cfc0c9
* Tue Aug 16 2016 Ricky Elrod <relrod@redhat.com> - 1:0.11.1-2
cfc0c9
- Attempt a completely fresh build with new NVR.
cfc0c9
cfc0c9
* Tue Aug 16 2016 Ricky Elrod <relrod@redhat.com> - 1:0.11.1-1
cfc0c9
- Latest upstream release.
cfc0c9
cfc0c9
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.10.1-9
cfc0c9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
cfc0c9
cfc0c9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.10.1-8
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
cfc0c9
cfc0c9
* Wed Oct 14 2015 Robert Kuska <rkuska@redhat.com> - 1:0.10.1-7
cfc0c9
- Rebuilt for Python3.5 rebuild
cfc0c9
cfc0c9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.10.1-6
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
cfc0c9
cfc0c9
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.10.1-5
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cfc0c9
cfc0c9
* Tue May 13 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1:0.10.1-4
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
cfc0c9
- Minor fix to rhel macro logic
cfc0c9
cfc0c9
* Mon Jul 29 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 1:0.10.1-3
cfc0c9
- fix wrong requires on sphinx (RHBZ #989361)
cfc0c9
cfc0c9
* Sat Jul 20 2013 Ricky Elrod <codeblock@fedoraproject.org> - 1:0.10.1-2
cfc0c9
- Nuke a Python3 specific file owned by python3-setuptools.
cfc0c9
cfc0c9
* Sat Jun 15 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 1:0.10.1-1
cfc0c9
- upstream 0.10.1
cfc0c9
cfc0c9
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.9-6
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
cfc0c9
cfc0c9
* Fri Aug 17 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-5
cfc0c9
- Add epoch to subpackage Requires.
cfc0c9
cfc0c9
* Wed Aug 8 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-4
cfc0c9
- Fix changelog messup.
cfc0c9
cfc0c9
* Wed Aug 8 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-3
cfc0c9
- Unified spec for EL6 and Fedora
cfc0c9
cfc0c9
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cfc0c9
cfc0c9
* Mon Jul  2 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.9.0-1
cfc0c9
- upstream 0.9
cfc0c9
- spec cleanups
cfc0c9
cfc0c9
* Sun Jul  1 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.8.1-1
cfc0c9
- upstream 0.8.1 (minor bugfixes)
cfc0c9
cfc0c9
* Wed Jan 25 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.8.0-1
cfc0c9
- upstream 0.8
cfc0c9
cfc0c9
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-3
cfc0c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
cfc0c9
cfc0c9
* Wed Nov 16 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.7.2-2
cfc0c9
- don't own easy-install.pth
cfc0c9
cfc0c9
* Fri Jul 22 2011 Steve Milner <smilner@fedoraproject.org> - 0.7.2-1
cfc0c9
- update for upstream release
cfc0c9
cfc0c9
* Thu Feb 24 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.6.1-2
cfc0c9
- fix rpmlint spelling warning
cfc0c9
- BR python2-devel rather than python-devel
cfc0c9
- run test suite in check
cfc0c9
cfc0c9
* Tue Feb 22 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.6.1-1
cfc0c9
- Initial package