4b307d1
%global pypi_name Flask-Login
22cc840
%global with_python3 1
22cc840
4b307d1
Name:           python-flask-login
8bd033b
Version:        0.2.11
22cc840
Release:        3%{?dist}
4b307d1
Summary:        User session management for Flask
4b307d1
4b307d1
License:        MIT
22cc840
URL:            https://github.com/maxcountryman/flask-login
4b307d1
Source0:        https://pypi.python.org/packages/source/F/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
4b307d1
BuildArch:      noarch
4b307d1
4b307d1
BuildRequires:  python2-devel
22cc840
22cc840
%if %{?with_python3}
22cc840
BuildRequires:  python3-devel
22cc840
%endif # if with_python3
4b307d1
4b307d1
Requires:       python-flask
4b307d1
4b307d1
%description
4b307d1
Flask-Login provides user session management for Flask. It handles the common
4b307d1
tasks of logging in, logging out, and remembering your users' sessions over
4b307d1
extended periods of time.
4b307d1
22cc840
%if 0%{?with_python3}
22cc840
%package -n     python3-flask-login
22cc840
Summary:        User session management for Flask
22cc840
22cc840
Requires:       python3-flask
22cc840
22cc840
%description -n python3-flask-login
22cc840
Flask-Login provides user session management for Flask. It handles the common
22cc840
tasks of logging in, logging out, and remembering your users' sessions over
22cc840
extended periods of time.
22cc840
%endif # with_python3
22cc840
22cc840
4b307d1
%prep
4b307d1
%setup -q -n %{pypi_name}-%{version}
4b307d1
rm -rf %{pypi_name}.egg-info
4b307d1
22cc840
22cc840
%if 0%{?with_python3}
22cc840
rm -rf %{py3dir}
22cc840
cp -a . %{py3dir}
22cc840
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
22cc840
22cc840
%endif # with_python3
22cc840
22cc840
4b307d1
%build
22cc840
%{__python2} setup.py build
22cc840
22cc840
%if 0%{?with_python3}
22cc840
pushd %{py3dir}
22cc840
%{__python3} setup.py build
22cc840
popd
22cc840
%endif # with_python3
22cc840
4b307d1
4b307d1
%install
22cc840
# Must do the subpackages' install first because the scripts in /usr/bin are
22cc840
# overwritten with every setup.py install (and we want the python2 version
22cc840
# to be the default for now).
22cc840
%if 0%{?with_python3}
22cc840
pushd %{py3dir}
22cc840
%{__python3} setup.py install --skip-build --root %{buildroot}
22cc840
popd
22cc840
%endif # with_python3
22cc840
22cc840
%{__python2} setup.py install --skip-build --root %{buildroot}
22cc840
22cc840
4b307d1
4b307d1
%files
22cc840
%doc README.markdown
22cc840
%license LICENSE
22cc840
%{python2_sitelib}/*
22cc840
%if 0%{?with_python3}
22cc840
22cc840
%files -n python3-flask-login
22cc840
%doc README.markdown
22cc840
%license LICENSE
22cc840
%{python3_sitelib}/*
22cc840
%endif # with_python3
22cc840
4b307d1
4b307d1
%changelog
22cc840
* Sat Jan 03 2015 Miroslav Suchy <msuchy@redhat.com> - 0.2.11-3
22cc840
- add python3- subpackage
22cc840
de24195
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.11-2
de24195
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
de24195
8bd033b
* Fri May 30 2014 Richard Marko <rmarko@fedoraproject.org> - 0.2.11-1
8bd033b
- Update to 0.2.11
8bd033b
c2746db
* Mon Aug 26 2013 Richard Marko <rmarko@fedoraproject.org> - 0.2.7-1
c2746db
- Update to 0.2.7
c2746db
85d2458
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-4
85d2458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
85d2458
e1bee82
* Sun Jul 07 2013 Richard Marko <rmarko@fedoraproject.org> - 0.2.4-3
4b307d1
- Removed upstream egg
4b307d1
e1bee82
* Thu Jul 04 2013 Richard Marko <rmarko@fedoraproject.org> - 0.2.4-2
4b307d1
- Added python-setuptools to BuildRequires
4b307d1
- Fixed Summary
4b307d1
4b307d1
* Tue Jul 02 2013 Richard Marko <rmarko@fedoraproject.org> - 0.2.4-1
4b307d1
- Initial packaging attempt