Dan Prince b51143f
# Created by pyp2rpm-1.1.1
dfc0a38
%global sname pysaml2
dfc0a38
dfc0a38
%if 0%{?fedora}
dfc0a38
%global with_python3 1
dfc0a38
%endif
Dan Prince b51143f
Dan Prince af329c7
Name:           python-pysaml2
Alan Pevec 9cd82bc
Version:        3.0.2
9ead7cf
Release:        4%{?dist}
Alan Pevec 083e919
Summary:        Python implementation of SAML Version 2
Alan Pevec c5cb62c
License:        ASL 2.0
Dan Prince b51143f
URL:            https://github.com/rohe/pysaml2
dfc0a38
Source0:        https://pypi.python.org/packages/source/p/%{sname}/%{sname}-%{version}.tar.gz
Alan Pevec 083e919
Dan Prince b51143f
BuildArch:      noarch
Alan Pevec c5cb62c
dfc0a38
dfc0a38
%description
dfc0a38
PySAML2 implementation of SAML Version 2 to be used in a WSGI environment.
dfc0a38
dfc0a38
dfc0a38
%package -n python2-%{sname}
dfc0a38
Summary:        Python implementation of SAML Version 2
dfc0a38
Alan Pevec 43444cf
BuildRequires:  python2-devel
Alan Pevec 43444cf
BuildRequires:  python-setuptools
Alan Pevec 083e919
#mongodict - not in Fedora
Dan Prince b51143f
BuildRequires:  python-pyasn1
Alan Pevec 083e919
#pymongo==3.0.1 - 2.5.2 in Fedora
Alan Pevec 083e919
BuildRequires:  python-pymongo
Alan Pevec 083e919
BuildRequires:  python-memcached >= 1.51
Dan Prince b51143f
BuildRequires:  pytest
Dan Prince b51143f
BuildRequires:  python-mako
Alan Pevec 083e919
BuildRequires:  python-webob
Alan Pevec c5cb62c
Alan Pevec 083e919
BuildRequires:  python-decorator
Alan Pevec 083e919
BuildRequires:  python-requests >= 1.0.0
Alan Pevec 083e919
BuildRequires:  python-paste
Alan Pevec 083e919
BuildRequires:  python-zope-interface
Alan Pevec 083e919
BuildRequires:  python-repoze-who
Alan Pevec 083e919
BuildRequires:  pycrypto >= 2.5
Alan Pevec 083e919
BuildRequires:  pytz
Alan Pevec 083e919
BuildRequires:  pyOpenSSL
Alan Pevec 083e919
BuildRequires:  python-dateutil
Alan Pevec 083e919
BuildRequires:  python-six
Alan Pevec 083e919
Dan Prince b51143f
Requires:       python-decorator
Dan Prince b51143f
Requires:       python-requests >= 1.0.0
Dan Prince b51143f
Requires:       python-paste
Dan Prince b51143f
Requires:       python-zope-interface
Dan Prince b51143f
Requires:       python-repoze-who
Alan Pevec 083e919
Requires:       pycrypto >= 2.5
Dan Prince b51143f
Requires:       pytz
Dan Prince b51143f
Requires:       pyOpenSSL
Dan Prince b51143f
Requires:       python-dateutil
Alan Pevec 083e919
Requires:       python-six
Dan Prince b51143f
dfc0a38
dfc0a38
%{?python_provide:%python_provide python2-%{sname}}
dfc0a38
dfc0a38
%description -n python2-%{sname}
dfc0a38
PySAML2 implementation of SAML Version 2 to be used in a WSGI environment.
dfc0a38
dfc0a38
%if 0%{?with_python3}
dfc0a38
%package -n python3-%{sname}
dfc0a38
Summary:        Python implementation of SAML Version 2
dfc0a38
dfc0a38
BuildRequires:  python3-devel
dfc0a38
BuildRequires:  python3-setuptools
dfc0a38
#mongodict - not in Fedora
dfc0a38
BuildRequires:  python3-pyasn1
dfc0a38
#pymongo==3.0.1 - 2.5.2 in Fedora
dfc0a38
BuildRequires:  python3-pymongo
dfc0a38
BuildRequires:  python3-memcached >= 1.51
dfc0a38
BuildRequires:  python3-pytest
dfc0a38
BuildRequires:  python3-mako
dfc0a38
BuildRequires:  python3-webob
dfc0a38
dfc0a38
BuildRequires:  python3-decorator
dfc0a38
BuildRequires:  python3-requests >= 1.0.0
dfc0a38
BuildRequires:  python3-paste
dfc0a38
BuildRequires:  python3-zope-interface
dfc0a38
BuildRequires:  python3-repoze-who
dfc0a38
BuildRequires:  python3-crypto >= 2.5
dfc0a38
BuildRequires:  python3-pytz
dfc0a38
BuildRequires:  python3-pyOpenSSL
dfc0a38
BuildRequires:  python3-dateutil
dfc0a38
BuildRequires:  python3-six
dfc0a38
dfc0a38
Requires:       python3-decorator
dfc0a38
Requires:       python3-requests >= 1.0.0
dfc0a38
Requires:       python3-paste
dfc0a38
Requires:       python3-zope-interface
dfc0a38
Requires:       python3-repoze-who
9ead7cf
Requires:       python3-crypto >= 2.5
dfc0a38
Requires:       python3-pytz
dfc0a38
Requires:       python3-pyOpenSSL
dfc0a38
Requires:       python3-dateutil
dfc0a38
Requires:       python3-six
dfc0a38
dfc0a38
dfc0a38
%{?python_provide:%python_provide python3-%{sname}}
dfc0a38
dfc0a38
%description -n python3-%{sname}
Alan Pevec 083e919
PySAML2 implementation of SAML Version 2 to be used in a WSGI environment.
dfc0a38
%endif
Alan Pevec 083e919
Alan Pevec 083e919
%package doc
Alan Pevec 083e919
Summary:        Documentation for Python implementation of SAML Version 2
Alan Pevec 083e919
Alan Pevec 083e919
BuildRequires:  python-sphinx
Alan Pevec 083e919
Alan Pevec 083e919
%description doc
Alan Pevec 083e919
Documentation for Python implementation of SAML Version 2.
Alan Pevec 083e919
Dan Prince b51143f
Dan Prince b51143f
%prep
dfc0a38
%setup -qn %{sname}-%{version}
Alan Pevec 083e919
sed -i '/argparse/d' setup.py
Dan Prince b51143f
Alan Pevec c5cb62c
# Avoid non-executable-script rpmlint while maintaining timestamps
Alan Pevec c5cb62c
find src -name \*.py |
Alan Pevec c5cb62c
while read source; do
Alan Pevec c5cb62c
  if head -n1 "$source" | grep -F '/usr/bin/env'; then
Alan Pevec c5cb62c
    touch --ref="$source" "$source".ts
Alan Pevec c5cb62c
    sed -i '/\/usr\/bin\/env python/{d;q}' "$source"
Alan Pevec c5cb62c
    touch --ref="$source".ts "$source"
Alan Pevec c5cb62c
    rm "$source".ts
Alan Pevec c5cb62c
  fi
Alan Pevec c5cb62c
done
Alan Pevec c5cb62c
# special case for parse_xsd generated file which have lines like:
Alan Pevec c5cb62c
#!!!! 'NoneType' object has no attribute 'py_class'
Alan Pevec c5cb62c
source="src/saml2/schema/wsdl.py"
Alan Pevec c5cb62c
touch --ref="$source" "$source".ts
Alan Pevec c5cb62c
sed -i '1,3{d;q}' "$source"
Alan Pevec c5cb62c
touch --ref="$source".ts "$source"
Alan Pevec c5cb62c
rm "$source".ts
Alan Pevec c5cb62c
Dan Prince b51143f
%build
dfc0a38
%py2_build
dfc0a38
dfc0a38
%if 0%{?with_python3}
dfc0a38
%py3_build
dfc0a38
%endif
Dan Prince b51143f
Alan Pevec 083e919
# drop alabaster Sphinx theme, not packaged in Fedora yet
Alan Pevec 083e919
sed -i '/alabaster/d' doc/conf.py
Alan Pevec 083e919
# generate html docs
Alan Pevec 083e919
sphinx-build doc html
Alan Pevec 083e919
# remove the sphinx-build leftovers
Alan Pevec 083e919
rm -rf html/.{doctrees,buildinfo}
Dan Prince b51143f
Dan Prince b51143f
%install
dfc0a38
%if 0%{?with_python3}
dfc0a38
%py3_install
dfc0a38
for bin in parse_xsd2 make_metadata mdexport merge_metadata; do
dfc0a38
    mv %{buildroot}%{_bindir}/$bin.py %{buildroot}%{_bindir}/$bin-%{python3_version}.py
dfc0a38
    ln -s ./$bin-%{python3_version}.py %{buildroot}%{_bindir}/$bin-3.py
dfc0a38
done
dfc0a38
%endif
dfc0a38
dfc0a38
%py2_install
dfc0a38
for bin in parse_xsd2 make_metadata mdexport merge_metadata; do
dfc0a38
    mv %{buildroot}%{_bindir}/$bin.py %{buildroot}%{_bindir}/$bin-%{python2_version}.py
dfc0a38
    ln -s ./$bin-%{python2_version}.py %{buildroot}%{_bindir}/$bin-2.py
dfc0a38
    ln -s ./$bin-%{python2_version}.py %{buildroot}%{_bindir}/$bin.py             
dfc0a38
done
dfc0a38
Dan Prince b51143f
Alan Pevec 083e919
# some testdeps are missing in Fedora
Alan Pevec 083e919
#%check
Alan Pevec 083e919
#%{__python2} setup.py test
Dan Prince b51143f
dfc0a38
%files -n python2-%{sname}
Alan Pevec c5cb62c
%doc README.rst
Alan Pevec 083e919
%license LICENSE.txt
Dan Prince b51143f
%{_bindir}/parse_xsd2.py
Dan Prince b51143f
%{_bindir}/make_metadata.py
Dan Prince b51143f
%{_bindir}/mdexport.py
Dan Prince b51143f
%{_bindir}/merge_metadata.py
dfc0a38
%{_bindir}/parse_xsd2-2*.py
dfc0a38
%{_bindir}/make_metadata-2*.py
dfc0a38
%{_bindir}/mdexport-2*.py
dfc0a38
%{_bindir}/merge_metadata-2*.py
Dan Prince b51143f
%{python2_sitelib}/saml2
Alan Pevec 083e919
%{python2_sitelib}/*.egg-info
Alan Pevec 083e919
dfc0a38
%if 0%{?with_python3}
dfc0a38
%files -n python3-%{sname}
dfc0a38
%doc README.rst
dfc0a38
%license LICENSE.txt
dfc0a38
%{_bindir}/parse_xsd2-3*.py
dfc0a38
%{_bindir}/make_metadata-3*.py
dfc0a38
%{_bindir}/mdexport-3*.py
dfc0a38
%{_bindir}/merge_metadata-3*.py
dfc0a38
%{python3_sitelib}/saml2
dfc0a38
%{python3_sitelib}/*.egg-info
dfc0a38
%endif
dfc0a38
dfc0a38
Alan Pevec 083e919
%files doc
Alan Pevec 083e919
%license LICENSE.txt
Alan Pevec 083e919
%doc html
Dan Prince b51143f
Dan Prince b51143f
%changelog
9ead7cf
* Sun Nov 13 2016 Peter Robinson <pbrobinson@fedoraproject.org> 3.0.2-4
9ead7cf
- fix pycrypto dependency
9ead7cf
9db9457
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.2-3
9db9457
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9db9457
61c6278
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
61c6278
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
61c6278
Alan Pevec 9cd82bc
* Sat Dec 05 2015 Alan Pevec <alan.pevec@redhat.com> 3.0.2-1
Alan Pevec 9cd82bc
- Update to 3.0.2
Alan Pevec 9cd82bc
Alan Pevec 2f7999a
* Wed Jul 15 2015 Alan Pevec <apevec@redhat.com> - 3.0.0-1
Alan Pevec 2f7999a
- update to upstream release 3.0.0
Alan Pevec 2f7999a
Alan Pevec 228cda9
* Thu Jun 18 2015 Alan Pevec <apevec@redhat.com> - 3.0.0-0.3.git40603ae
Alan Pevec 083e919
- include unreleased fix for https://github.com/rohe/pysaml2/issues/202
Alan Pevec 43444cf
- review feedback
Alan Pevec c5cb62c
- fix rpmlint errors
Alan Pevec 083e919
Alan Pevec 083e919
* Tue Mar 31 2015 Alan Pevec <apevec@redhat.com> - 2.4.0-1
Alan Pevec 083e919
- Update to 2.4.0
Alan Pevec 083e919
Dan Prince b51143f
* Mon Feb 16 2015 Dan Prince - 2.3.0-1
Dan Prince b51143f
- Initial package.