3ea00b
%global upstream_name itsdangerous
3ea00b
3ea00b
%if 0%{?fedora}
3ea00b
%bcond_without python3
3ea00b
%else
3ea00b
%bcond_with python3
3ea00b
%endif
3ea00b
3ea00b
Name:           python-%{upstream_name}
3ea00b
Version:        0.23
3ea00b
Release:        2%{?dist}
3ea00b
Summary:        Python library for passing trusted data to untrusted environments
3ea00b
License:        BSD
3ea00b
URL:            http://pythonhosted.org/itsdangerous/
3ea00b
Source0:        http://pypi.python.org/packages/source/i/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
3ea00b
BuildArch:      noarch
3ea00b
BuildRequires:  python2-devel
3ea00b
BuildRequires:  python-setuptools
3ea00b
%if %{with python3}
3ea00b
BuildRequires:  python3-devel
3ea00b
BuildRequires:  python3-setuptools
3ea00b
%endif
3ea00b
3ea00b
%description
3ea00b
Itsdangerous is a Python library for passing data through untrusted 
3ea00b
environments (for example, HTTP cookies) while ensuring the data is not 
3ea00b
tampered with.
3ea00b
3ea00b
Internally itsdangerous uses HMAC and SHA1 for signing by default and bases the 
3ea00b
implementation on the Django signing module. It also however supports JSON Web 
3ea00b
Signatures (JWS).
3ea00b
3ea00b
%if %{with python3}
3ea00b
%package -n python3-%{upstream_name}
3ea00b
Summary:        Python 3 library for passing trusted data to untrusted environments
3ea00b
3ea00b
%description -n python3-%{upstream_name}
3ea00b
Itsdangerous is a Python 3 library for passing data through untrusted 
3ea00b
environments (for example, HTTP cookies) while ensuring the data is not 
3ea00b
tampered with.
3ea00b
3ea00b
Internally itsdangerous uses HMAC and SHA1 for signing by default and bases the 
3ea00b
implementation on the Django signing module. It also however supports JSON Web 
3ea00b
Signatures (JWS).
3ea00b
%endif
3ea00b
3ea00b
%prep
3ea00b
%setup -q -n %{upstream_name}-%{version}
3ea00b
rm -r *.egg-info
3ea00b
3ea00b
%if %{with python3}
3ea00b
rm -rf %{py3dir}
3ea00b
cp -a . %{py3dir}
3ea00b
%endif
3ea00b
3ea00b
%build
3ea00b
%{__python} setup.py build
3ea00b
3ea00b
%if %{with python3}
3ea00b
pushd %{py3dir}
3ea00b
%{__python3} setup.py build
3ea00b
popd
3ea00b
%endif
3ea00b
3ea00b
%install
3ea00b
%if %{with python3}
3ea00b
pushd %{py3dir}
3ea00b
%{__python3} setup.py install --skip-build --root %{buildroot}
3ea00b
popd
3ea00b
%endif
3ea00b
3ea00b
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
3ea00b
3ea00b
%check
3ea00b
PYTHONPATH=%{buildroot}%{python_sitelib} %{__python} tests.py
3ea00b
3ea00b
%if %{with python3}
3ea00b
pushd %{py3dir}
3ea00b
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} tests.py
3ea00b
popd
3ea00b
%endif
3ea00b
3ea00b
%files
3ea00b
%doc LICENSE CHANGES README
3ea00b
%{python_sitelib}/%{upstream_name}.py*
3ea00b
%{python_sitelib}/%{upstream_name}*.egg-info
3ea00b
3ea00b
%if %{with python3}
3ea00b
%files -n python3-%{upstream_name}
3ea00b
%doc LICENSE CHANGES README
3ea00b
%{python3_sitelib}/%{upstream_name}.py
3ea00b
%{python3_sitelib}/%{upstream_name}*.egg-info
3ea00b
%{python3_sitelib}/__pycache__/%{upstream_name}*
3ea00b
%endif
3ea00b
3ea00b
%changelog
3ea00b
* Wed Apr 30 2014 Lokesh Mandvekar <lsm5@redhat.com> - 0.23-2
3ea00b
- Rebuilt for RHEL-7
3ea00b
3ea00b
* Thu Aug 15 2013 Dan Callaghan <dcallagh@redhat.com> - 0.23-1
3ea00b
- new upstream release 0.23 (no code changes, only packaging fixes)
3ea00b
3ea00b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-2
3ea00b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
3ea00b
3ea00b
* Tue Jul 09 2013 Dan Callaghan <dcallagh@redhat.com> - 0.22-1
3ea00b
- new upstream release 0.22
3ea00b
3ea00b
* Tue Jun 18 2013 Dan Callaghan <dcallagh@redhat.com> - 0.21-3
3ea00b
- disable Python 3 subpackage on Fedora 17
3ea00b
3ea00b
* Mon Jun 17 2013 Dan Callaghan <dcallagh@redhat.com> - 0.21-2
3ea00b
- $RPM_BUILD_ROOT -> %%{buildroot}
3ea00b
3ea00b
* Fri Jun 14 2013 Dan Callaghan <dcallagh@redhat.com> - 0.21-1
3ea00b
- updated to upstream release 0.21
3ea00b
- added Python 3 subpackage
3ea00b
3ea00b
* Wed Nov 16 2011 Dan Callaghan <dcallagh@redhat.com> - 0.11-1
3ea00b
- initial version