From 3874ff87205762f61242dd2fb2335969479ce903 Mon Sep 17 00:00:00 2001 From: rdobuilder Date: Nov 03 2021 10:14:32 +0000 Subject: Update to 7.0.1 Related-to: https://review.rdoproject.org/r/q/Id27d227e3853b1314439a7df678c09155d3ad2ed --- diff --git a/.python-pysaml2.metadata b/.python-pysaml2.metadata new file mode 100644 index 0000000..720e958 --- /dev/null +++ b/.python-pysaml2.metadata @@ -0,0 +1 @@ +e4418da1e0dc86b92518b8894919a18c2ecdd791 SOURCES/pysaml2-7.0.1.tar.gz diff --git a/SOURCES/.gitignore b/SOURCES/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/SOURCES/.gitignore diff --git a/SOURCES/0001-Use-importlib.resources-in-python-3.7.patch b/SOURCES/0001-Use-importlib.resources-in-python-3.7.patch new file mode 100644 index 0000000..43ed86e --- /dev/null +++ b/SOURCES/0001-Use-importlib.resources-in-python-3.7.patch @@ -0,0 +1,83 @@ +From e1392feda59ed0fdcf10934d57f833c64e99c19a Mon Sep 17 00:00:00 2001 +From: Alfredo Moralejo +Date: Thu, 30 Sep 2021 09:39:36 +0200 +Subject: [PATCH] Use importlib.resources in python >= 3.7 + +importlib.resources was added to python standard library since python 3.7 +[1]. This patch is implementing conditional to use it instead of the +importlib_resources backport when using python 3.7 or newer. + +[1] https://docs.python.org/3/whatsnew/3.7.html +--- + setup.cfg | 2 +- + src/saml2/sigver.py | 7 ++++++- + src/saml2/xml/schema/__init__.py | 7 ++++++- + 3 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/setup.cfg b/setup.cfg +index e04c5520..41ccdd7f 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -53,7 +53,7 @@ install_requires = + pytz + requests >= 1.0.0 + six +- importlib_resources ++ importlib_resources;python_version<'3.7' + xmlschema >= 1.2.1 + + +diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py +index 973d6245..c9c66b13 100644 +--- a/src/saml2/sigver.py ++++ b/src/saml2/sigver.py +@@ -9,12 +9,12 @@ import logging + import os + import re + import six ++import sys + from uuid import uuid4 as gen_random_key + from time import mktime + from tempfile import NamedTemporaryFile + from subprocess import Popen + from subprocess import PIPE +-from importlib_resources import path as _resource_path + + from OpenSSL import crypto + +@@ -59,6 +59,11 @@ from saml2.xmlenc import EncryptedData + from saml2.xml.schema import node_to_schema + from saml2.xml.schema import XMLSchemaError + ++# importlib.resources was introduced in python 3.7 ++if sys.version_info[:2] >= (3, 7): ++ from importlib.resources import path as _resource_path ++else: ++ from importlib_resources import path as _resource_path + + logger = logging.getLogger(__name__) + +diff --git a/src/saml2/xml/schema/__init__.py b/src/saml2/xml/schema/__init__.py +index 56e08b1c..ce38b807 100644 +--- a/src/saml2/xml/schema/__init__.py ++++ b/src/saml2/xml/schema/__init__.py +@@ -1,10 +1,15 @@ +-from importlib_resources import path as _resource_path ++import sys + + from xmlschema import XMLSchema as _XMLSchema + from xmlschema.exceptions import XMLSchemaException as XMLSchemaError + + import saml2.data.schemas as _data_schemas + ++# importlib.resources was introduced in python 3.7 ++if sys.version_info[:2] >= (3, 7): ++ from importlib.resources import path as _resource_path ++else: ++ from importlib_resources import path as _resource_path + + def _create_xml_schema_validator(source, **kwargs): + kwargs = { +-- +2.26.3 + diff --git a/SPECS/python-pysaml2.spec b/SPECS/python-pysaml2.spec new file mode 100644 index 0000000..a087697 --- /dev/null +++ b/SPECS/python-pysaml2.spec @@ -0,0 +1,218 @@ +%global srcname pysaml2 + +Name: python-%{srcname} +Version: 7.0.1 +Release: 2%{?dist} +Summary: Python implementation of SAML Version 2 +License: ASL 2.0 +URL: https://github.com/IdentityPython/%{srcname} + +%global gittag v%{version} + + + +Source0: https://github.com/IdentityPython/%{srcname}/archive/%{gittag}/%{srcname}-%{version}.tar.gz + +Patch0: 0001-Use-importlib.resources-in-python-3.7.patch + +BuildArch: noarch + +BuildRequires: python3-sphinx +BuildRequires: python3-defusedxml + +%description +PySAML2 is a pure python implementation of SAML2. It contains all +necessary pieces for building a SAML2 service provider or an identity +provider. The distribution contains examples of both. Originally +written to work in a WSGI environment there are extensions that allow +you to use it with other frameworks. + + + +%package -n python3-%{srcname} +Summary: Python implementation of SAML Version 2 +Conflicts: python2-%{srcname} < 4.5.0-6 +%{?python_provide:%python_provide python3-%{srcname}} + +Requires: python3-requests >= 1.0.0 +Requires: python3-future +Requires: python3-cryptography +Requires: python3-pytz +Requires: python3-pyOpenSSL +Requires: python3-dateutil +Requires: python3-defusedxml +Requires: python3-six + +BuildRequires: git-core +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description -n python3-%{srcname} +PySAML2 is a pure python implementation of SAML2. It contains all +necessary pieces for building a SAML2 service provider or an identity +provider. The distribution contains examples of both. Originally +written to work in a WSGI environment there are extensions that allow +you to use it with other frameworks. + + +%package doc +Summary: Documentation for Python implementation of SAML Version 2 + +%description doc +Documentation for Python implementation of SAML Version 2. + +%prep +%autosetup -n %{srcname}-%{version} -S git +sed -i '/argparse/d' setup.py + +# Avoid non-executable-script rpmlint while maintaining timestamps +find src -name \*.py | +while read source; do + if head -n1 "$source" | grep -F '/usr/bin/env'; then + touch --ref="$source" "$source".ts + sed -i '/\/usr\/bin\/env python/{d;q}' "$source" + touch --ref="$source".ts "$source" + rm "$source".ts + fi +done +# special case for parse_xsd generated file which have lines like: +#!!!! 'NoneType' object has no attribute 'py_class' +source="src/saml2/schema/wsdl.py" +touch --ref="$source" "$source".ts +sed -i '1,3{d;q}' "$source" +touch --ref="$source".ts "$source" +rm "$source".ts + +%build + + %py3_build + +# drop alabaster Sphinx theme, not packaged in Fedora yet +#sed -i '/alabaster/d' docs/conf.py +# generate html docs +export PYTHONPATH=./src +sphinx-build-3 docs html +# remove the sphinx-build leftovers +rm -rf html/.{doctrees,buildinfo} + +%install + +%py3_install + + + +%files -n python3-%{srcname} +%doc README.rst +%license LICENSE +%{_bindir}/parse_xsd2.py +%{_bindir}/make_metadata.py +%{_bindir}/mdexport.py +%{_bindir}/merge_metadata.py +%{python3_sitelib}/saml2 +%{python3_sitelib}/*.egg-info + +%files doc +%license LICENSE +%doc html + +%changelog +* Thu Oct 21 2021 Alfredo Moralejo - 7.0.1-2 +- Use importlib.resources in python >= 3.7 (rhbz#2008668) + +* Fri Sep 24 2021 Joel Capitao - 7.0.1-1 +- Update to 7.0.1 (rhbz#1290944) + +* Fri Jul 23 2021 Fedora Release Engineering - 6.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 6.1.0-3 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 6.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Jul 30 2020 Yatin Karel - 6.1.0-1 +- Update to 6.1.0 (rhbz#1290944) + +* Wed Jul 29 2020 Fedora Release Engineering - 4.5.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 4.5.0-11 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 4.5.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 03 2019 Miro Hrončok - 4.5.0-9 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 4.5.0-8 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 4.5.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Feb 11 2019 Miro Hrončok - 4.5.0-6 +- Subpackage python2-pysaml2 has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Sat Feb 02 2019 Fedora Release Engineering - 4.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 4.5.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 4.5.0-3 +- Rebuilt for Python 3.7 + +* Wed Jun 6 2018 - 4.5.0-2 +- Resolves: rhbz#1582254 - re-enable python2 support + +* Fri May 18 2018 - 4.5.0-1 +- upgrade to current upstream +- enforce Python packaging standards + +* Fri Feb 09 2018 Iryna Shcherbina - 3.0.2-10 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 3.0.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 3.0.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Mar 16 2017 Jason Joyce - 3.0.2-7 +- security fix for entity expansion issue - CVE-2016-10149 + +* Sat Feb 11 2017 Fedora Release Engineering - 3.0.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 3.0.2-5 +- Rebuild for Python 3.6 + +* Sun Nov 13 2016 Peter Robinson 3.0.2-4 +- fix pycrypto dependency + +* Tue Jul 19 2016 Fedora Release Engineering - 3.0.2-3 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 3.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sat Dec 05 2015 Alan Pevec 3.0.2-1 +- Update to 3.0.2 + +* Wed Jul 15 2015 Alan Pevec - 3.0.0-1 +- update to upstream release 3.0.0 + +* Thu Jun 18 2015 Alan Pevec - 3.0.0-0.3.git40603ae +- include unreleased fix for https://github.com/rohe/pysaml2/issues/202 +- review feedback +- fix rpmlint errors + +* Tue Mar 31 2015 Alan Pevec - 2.4.0-1 +- Update to 2.4.0 + +* Mon Feb 16 2015 Dan Prince - 2.3.0-1 +- Initial package.