66ee97
%if 0%{?fedora} > 12
66ee97
%global with_python3 1
66ee97
%else
66ee97
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
66ee97
%endif
66ee97
66ee97
%global srcname Flask
66ee97
%global srcversion 0.10.1
66ee97
66ee97
Name:           python-flask
66ee97
Version:        0.10.1
66ee97
Release:        4%{?dist}
66ee97
Epoch:          1
66ee97
Summary:        A micro-framework for Python based on Werkzeug, Jinja 2 and good intentions
66ee97
66ee97
Group:          Development/Libraries
66ee97
License:        BSD
66ee97
URL:            http://flask.pocoo.org/
66ee97
Source0:        http://pypi.python.org/packages/source/F/Flask/%{srcname}-%{srcversion}.tar.gz
66ee97
66ee97
BuildArch:      noarch
66ee97
BuildRequires:  python2-devel python-setuptools python-werkzeug python-sphinx
66ee97
Requires:       python-werkzeug
66ee97
66ee97
%if 0%{?rhel} < 7
66ee97
BuildRequires:  python-jinja2
66ee97
BuildRequires:  python-itsdangerous
66ee97
Requires:       python-jinja2
66ee97
Requires:       python-itsdangerous
66ee97
%else
66ee97
BuildRequires:  python-jinja2
66ee97
BuildRequires:  python-itsdangerous
66ee97
Requires:       python-jinja2
66ee97
Requires:       python-itsdangerous
66ee97
%endif
66ee97
66ee97
%description
66ee97
Flask is called a “micro-framework” because the idea to keep the core
66ee97
simple but extensible. There is no database abstraction layer, no form
66ee97
validation or anything else where different libraries already exist
66ee97
that can handle that. However Flask knows the concept of extensions
66ee97
that can add this functionality into your application as if it was
66ee97
implemented in Flask itself. There are currently extensions for object
66ee97
relational mappers, form validation, upload handling, various open
66ee97
authentication technologies and more.
66ee97
66ee97
66ee97
%package doc
66ee97
Summary:        Documentation for %{name}
66ee97
Group:          Documentation
66ee97
Requires:       %{name} = %{epoch}:%{version}-%{release}
66ee97
66ee97
%description doc
66ee97
Documentation and examples for %{name}.
66ee97
66ee97
%if 0%{?with_python3}
66ee97
%package -n python3-flask
66ee97
Summary:        A micro-framework for Python based on Werkzeug, Jinja 2 and good intentions
66ee97
BuildRequires:  python3-devel
66ee97
BuildRequires:  python3-setuptools
66ee97
BuildRequires:  python3-jinja2
66ee97
BuildRequires:  python3-werkzeug
66ee97
#BuildRequires:  python3-sphinx
66ee97
BuildRequires:  python3-itsdangerous
66ee97
Requires:       python3-jinja2
66ee97
Requires:       python3-werkzeug
66ee97
Requires:       python3-itsdangerous
66ee97
66ee97
%description -n python3-flask
66ee97
Flask is called a “micro-framework” because the idea to keep the core
66ee97
simple but extensible. There is no database abstraction layer, no form
66ee97
validation or anything else where different libraries already exist
66ee97
that can handle that. However Flask knows the concept of extensions
66ee97
that can add this functionality into your application as if it was
66ee97
implemented in Flask itself. There are currently extensions for object
66ee97
relational mappers, form validation, upload handling, various open
66ee97
authentication technologies and more.
66ee97
66ee97
66ee97
%package -n python3-flask-doc
66ee97
Summary:        Documentation for python3-flask
66ee97
Group:          Documentation
66ee97
Requires:       python3-flask = %{epoch}:%{version}-%{release}
66ee97
66ee97
%description -n python3-flask-doc
66ee97
Documentation and examples for python3-flask.
66ee97
%endif
66ee97
66ee97
66ee97
%prep
66ee97
%setup -q -n %{srcname}-%{srcversion}
66ee97
%{__sed} -i "/platforms/ a\    requires=['Jinja2 (>=2.4)']," setup.py
66ee97
66ee97
%if 0%{?with_python3}
66ee97
rm -rf %{py3dir}
66ee97
cp -a . %{py3dir}
66ee97
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
66ee97
%endif
66ee97
66ee97
66ee97
%build
66ee97
%{__python} setup.py build
66ee97
66ee97
%if 0%{?with_python3}
66ee97
pushd %{py3dir}
66ee97
%{__python3} setup.py build
66ee97
popd
66ee97
%endif
66ee97
66ee97
66ee97
%install
66ee97
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
66ee97
66ee97
# Need to install flask in the setuptools "develop" mode to build docs
66ee97
# The BuildRequires on Werkzeug, Jinja2 and Sphinx is due to this as well.
66ee97
export PYTHONPATH=%{buildroot}%{python_sitelib}
66ee97
%{__python} setup.py develop --install-dir %{buildroot}%{python_sitelib}
66ee97
make -C docs html
66ee97
66ee97
rm -rf %{buildroot}%{python_sitelib}/site.py
66ee97
rm -rf %{buildroot}%{python_sitelib}/site.py[co]
66ee97
rm -rf %{buildroot}%{python_sitelib}/easy-install.pth
66ee97
rm -rf docs/_build/html/.buildinfo
66ee97
rm -rf examples/minitwit/*.pyc
66ee97
rm -rf examples/flaskr/*.pyc
66ee97
rm -rf examples/jqueryexample/*.pyc
66ee97
66ee97
%if 0%{?with_python3}
66ee97
pushd %{py3dir}
66ee97
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
66ee97
66ee97
# Need to install flask in the setuptools "develop" mode to build docs
66ee97
# The BuildRequires on Werkzeug, Jinja2 and Sphinx is due to this as well.
66ee97
export PYTHONPATH=%{buildroot}%{python3_sitelib}
66ee97
%{__python3} setup.py develop --install-dir %{buildroot}%{python3_sitelib}
66ee97
#make -C docs html
66ee97
66ee97
rm -rf %{buildroot}%{python3_sitelib}/site.py
66ee97
rm -rf %{buildroot}%{python3_sitelib}/site.py[co]
66ee97
rm -rf %{buildroot}%{python3_sitelib}/easy-install.pth
66ee97
rm -rf %{buildroot}%{python3_sitelib}/__pycache__/site.cpython-33.pyc
66ee97
rm -rf docs/_build/html/.buildinfo
66ee97
rm -rf examples/minitwit/*.pyc
66ee97
rm -rf examples/flaskr/*.pyc
66ee97
rm -rf examples/jqueryexample/*.pyc
66ee97
popd
66ee97
%endif
66ee97
66ee97
66ee97
%check
66ee97
#{__python} setup.py test
66ee97
66ee97
#if 0%{?with_python3}
66ee97
#pushd %{py3dir}
66ee97
#{__python3} setup.py test
66ee97
#popd
66ee97
#endif
66ee97
66ee97
66ee97
%files
66ee97
%doc AUTHORS LICENSE PKG-INFO CHANGES README
66ee97
%{python_sitelib}/*.egg-info
66ee97
%{python_sitelib}/*.egg-link
66ee97
%{python_sitelib}/flask
66ee97
66ee97
%files doc
66ee97
%doc docs/_build/html examples
66ee97
66ee97
%if 0%{?with_python3}
66ee97
%files -n python3-flask
66ee97
%doc AUTHORS LICENSE PKG-INFO CHANGES README
66ee97
%{python3_sitelib}/*.egg-info
66ee97
%{python3_sitelib}/*.egg-link
66ee97
%{python3_sitelib}/flask
66ee97
66ee97
%files -n python3-flask-doc
66ee97
%doc docs/_build/html examples
66ee97
%endif
66ee97
66ee97
66ee97
%changelog
66ee97
* Tue Apr 29 2014 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.10.1-4
66ee97
- Rebuilt for RHEL 7
66ee97
- tests disabled
66ee97
66ee97
* Mon Jul 29 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 1:0.10.1-3
66ee97
- fix wrong requires on sphinx (RHBZ #989361)
66ee97
66ee97
* Sat Jul 20 2013 Ricky Elrod <codeblock@fedoraproject.org> - 1:0.10.1-2
66ee97
- Nuke a Python3 specific file owned by python3-setuptools.
66ee97
66ee97
* Sat Jun 15 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 1:0.10.1-1
66ee97
- upstream 0.10.1
66ee97
66ee97
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.9-6
66ee97
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
66ee97
66ee97
* Fri Aug 17 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-5
66ee97
- Add epoch to subpackage Requires.
66ee97
66ee97
* Wed Aug 8 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-4
66ee97
- Fix changelog messup.
66ee97
66ee97
* Wed Aug 8 2012 Ricky Elrod <codeblock@fedoraproject.org> - 0.9-3
66ee97
- Unified spec for EL6 and Fedora
66ee97
66ee97
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
66ee97
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
66ee97
66ee97
* Mon Jul  2 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.9.0-1
66ee97
- upstream 0.9
66ee97
- spec cleanups
66ee97
66ee97
* Sun Jul  1 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.8.1-1
66ee97
- upstream 0.8.1 (minor bugfixes)
66ee97
66ee97
* Wed Jan 25 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 0.8.0-1
66ee97
- upstream 0.8
66ee97
66ee97
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-3
66ee97
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
66ee97
66ee97
* Wed Nov 16 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.7.2-2
66ee97
- don't own easy-install.pth
66ee97
66ee97
* Fri Jul 22 2011 Steve Milner <smilner@fedoraproject.org> - 0.7.2-1
66ee97
- update for upstream release
66ee97
66ee97
* Thu Feb 24 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.6.1-2
66ee97
- fix rpmlint spelling warning
66ee97
- BR python2-devel rather than python-devel
66ee97
- run test suite in check
66ee97
66ee97
* Tue Feb 22 2011 Dan Young <dyoung@mesd.k12.or.us> - 0.6.1-1
66ee97
- Initial package