diff --git a/python-flask-login.spec b/python-flask-login.spec index 689b130..decfba7 100644 --- a/python-flask-login.spec +++ b/python-flask-login.spec @@ -1,18 +1,21 @@ %global pypi_name Flask-Login +%global with_python3 1 + Name: python-flask-login Version: 0.2.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: User session management for Flask -Group: Development/Languages License: MIT -URL: https://pypi.python.org/pypi/%{pypi_name} +URL: https://github.com/maxcountryman/flask-login Source0: https://pypi.python.org/packages/source/F/%{pypi_name}/%{pypi_name}-%{version}.tar.gz - BuildArch: noarch BuildRequires: python2-devel -BuildRequires: python-setuptools + +%if %{?with_python3} +BuildRequires: python3-devel +%endif # if with_python3 Requires: python-flask @@ -21,21 +24,73 @@ Flask-Login provides user session management for Flask. It handles the common tasks of logging in, logging out, and remembering your users' sessions over extended periods of time. +%if 0%{?with_python3} +%package -n python3-flask-login +Summary: User session management for Flask + +Requires: python3-flask + +%description -n python3-flask-login +Flask-Login provides user session management for Flask. It handles the common +tasks of logging in, logging out, and remembering your users' sessions over +extended periods of time. +%endif # with_python3 + + %prep %setup -q -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' + +%endif # with_python3 + + %build -%{__python} setup.py build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + %install -%{__python} setup.py install --skip-build --root %{buildroot} +# Must do the subpackages' install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif # with_python3 + +%{__python2} setup.py install --skip-build --root %{buildroot} + + %files -%doc LICENSE README.markdown -%{python_sitelib}/* +%doc README.markdown +%license LICENSE +%{python2_sitelib}/* +%if 0%{?with_python3} + +%files -n python3-flask-login +%doc README.markdown +%license LICENSE +%{python3_sitelib}/* +%endif # with_python3 + %changelog +* Sat Jan 03 2015 Miroslav Suchy - 0.2.11-3 +- add python3- subpackage + * Sat Jun 07 2014 Fedora Release Engineering - 0.2.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild