From 96009edb8d6c8023e431d219215690cd9f74068c0422af6f3d9a8845f33e7dc4 Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 18 Sep 2017 17:29:17 +0000 Subject: [PATCH] - Initial version - Include fix_unicode_issues.patch Upstream fix, should be in next release. https://github.com/andrewleech/PyWebDAV3/commit/68c5fb9428e8d08f2bad4a1988a8d2d0baf357bc - Include fix_python2_urllib.patch Upstream fix, should be in next release. https://github.com/andrewleech/PyWebDAV3/commit/62e67e5523b6f8a3d47e1406d045c9e2abb9e8ba https://github.com/andrewleech/PyWebDAV3/commit/eb4017d8894242ab4453cc1c2d432ebd299c13a0 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyWebDAV3?expand=0&rev=1 --- .gitattributes | 23 +++++++++ .gitignore | 1 + PyWebDAV3-0.9.11.tar.gz | 3 ++ fix_python2_urllib.patch | 75 +++++++++++++++++++++++++++++ python-PyWebDAV3.changes | 11 +++++ python-PyWebDAV3.spec | 101 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 214 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 PyWebDAV3-0.9.11.tar.gz create mode 100644 fix_python2_urllib.patch create mode 100644 python-PyWebDAV3.changes create mode 100644 python-PyWebDAV3.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/PyWebDAV3-0.9.11.tar.gz b/PyWebDAV3-0.9.11.tar.gz new file mode 100644 index 0000000..238e65c --- /dev/null +++ b/PyWebDAV3-0.9.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c4f752708902280f9ef489760938f52468262ec078c944a2c77f923cc23f506 +size 53940 diff --git a/fix_python2_urllib.patch b/fix_python2_urllib.patch new file mode 100644 index 0000000..77ce1d4 --- /dev/null +++ b/fix_python2_urllib.patch @@ -0,0 +1,75 @@ +From 62e67e5523b6f8a3d47e1406d045c9e2abb9e8ba Mon Sep 17 00:00:00 2001 +From: Andrew Leech +Date: Tue, 16 Aug 2016 20:00:17 +1000 +Subject: [PATCH] Fix python 2 import error + +--- + pywebdav/lib/propfind.py | 1 - + pywebdav/lib/davcopy.py | 1 - + pywebdav/lib/davmove.py | 1 - + pywebdav/lib/locks.py | 1 - + pywebdav/lib/utils.py | 3 --- + 5 files changed, 7 deletions(-) + +diff --git a/pywebdav/lib/davcopy.py b/pywebdav/lib/davcopy.py +index 9c7b71d..3ee6c6a 100644 +--- a/pywebdav/lib/davcopy.py ++++ b/pywebdav/lib/davcopy.py +@@ -5,7 +5,6 @@ + import sys + import string + from six.moves import urllib +-import urllib.parse + from io import StringIO + + from . import utils +diff --git a/pywebdav/lib/davmove.py b/pywebdav/lib/davmove.py +index dce71f0..155208e 100644 +--- a/pywebdav/lib/davmove.py ++++ b/pywebdav/lib/davmove.py +@@ -1,6 +1,5 @@ + from __future__ import absolute_import + from six.moves import urllib +-import urllib.parse + + from . import utils + from .constants import COLLECTION, OBJECT, DAV_PROPS +diff --git a/pywebdav/lib/locks.py b/pywebdav/lib/locks.py +index 01b8544..05b9969 100644 +--- a/pywebdav/lib/locks.py ++++ b/pywebdav/lib/locks.py +@@ -1,7 +1,6 @@ + from __future__ import absolute_import + import time + from six.moves import urllib +-import urllib.parse + import random + + import logging +diff --git a/pywebdav/lib/utils.py b/pywebdav/lib/utils.py +index 6fb1897..bbc6098 100755 +--- a/pywebdav/lib/utils.py ++++ b/pywebdav/lib/utils.py +@@ -3,10 +3,7 @@ + import re + + from xml.dom import minidom +- + from six.moves import urllib +-import urllib.parse +- + from .constants import RT_ALLPROP, RT_PROPNAME, RT_PROP + from six.moves.BaseHTTPServer import BaseHTTPRequestHandler + +diff --git a/pywebdav/lib/propfind.py b/pywebdav/lib/propfind.py +index e87754c..5596af0 100644 +--- a/pywebdav/lib/propfind.py ++++ b/pywebdav/lib/propfind.py +@@ -4,7 +4,6 @@ + + import logging + from six.moves import urllib +-import urllib.parse + + from . import utils + from .constants import RT_ALLPROP, RT_PROPNAME, RT_PROP diff --git a/python-PyWebDAV3.changes b/python-PyWebDAV3.changes new file mode 100644 index 0000000..88fcad5 --- /dev/null +++ b/python-PyWebDAV3.changes @@ -0,0 +1,11 @@ +------------------------------------------------------------------- +Mon Sep 18 17:01:39 UTC 2017 - toddrme2178@gmail.com + +- Initial version +- Include fix_unicode_issues.patch + Upstream fix, should be in next release. + https://github.com/andrewleech/PyWebDAV3/commit/68c5fb9428e8d08f2bad4a1988a8d2d0baf357bc +- Include fix_python2_urllib.patch + Upstream fix, should be in next release. + https://github.com/andrewleech/PyWebDAV3/commit/62e67e5523b6f8a3d47e1406d045c9e2abb9e8ba + https://github.com/andrewleech/PyWebDAV3/commit/eb4017d8894242ab4453cc1c2d432ebd299c13a0 diff --git a/python-PyWebDAV3.spec b/python-PyWebDAV3.spec new file mode 100644 index 0000000..9d2091f --- /dev/null +++ b/python-PyWebDAV3.spec @@ -0,0 +1,101 @@ +# +# spec file for package python-PyWebDAV3 +# +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define oldpython python +# Test files missing +%bcond_with test +Name: python-PyWebDAV3 +Version: 0.9.11 +Release: 0 +Summary: WebDAV library including a standalone server +License: LGPL-2.0 +Group: Development/Languages/Python +Url: https://github.com/andrewleech/PyWebDAV3 +Source: https://files.pythonhosted.org/packages/source/P/PyWebDAV3/PyWebDAV3-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix_python2_urllib.patch https://github.com/andrewleech/PyWebDAV3/commit/62e67e5523b6f8a3d47e1406d045c9e2abb9e8ba and https://github.com/andrewleech/PyWebDAV3/commit/eb4017d8894242ab4453cc1c2d432ebd299c13a0 +Patch1: fix_python2_urllib.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +%if %{with test} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module six} +%endif +Requires: python-six +BuildArch: noarch +%ifpython2 +Obsoletes: %{oldpython}-PyWebDAV < %{version} +Provides: %{oldpython}-PyWebDAV = %{version} +%endif +Requires(post): update-alternatives +Requires(postun): update-alternatives + +%python_subpackages + +%description +WebDAV library for python. + +Consists of a server that is ready to run +Serve and the DAV package that provides WebDAV server functionality. + +Currently supports + + * WebDAV level 1 + * Level 2 (LOCK, UNLOCK) + * Experimental iterator support + +%prep +%setup -q -n PyWebDAV3-%{version} +%patch1 -p1 + +%build +%python_build + +%install +%python_install + +%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/pywebdav/server/server.py +sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" %{buildroot}%{$python_sitelib}/pywebdav/server/server.py +%fdupes %{buildroot}%{$python_sitelib} +$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/pywebdav/server/ +$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/pywebdav/server/ +%fdupes %{buildroot}%{$python_sitelib}/pywebdav/server/ +} + +%python_clone -a %{buildroot}%{_bindir}/davserver + +%if %{with test} +%check +%python_expand py.test-%{$python_bin_suffix} +%endif + +%post +%python_install_alternative davserver + +%postun +%python_uninstall_alternative davserver + +%files %{python_files} +%defattr(-,root,root,-) +%doc README doc/Changes doc/LICENSE doc/TODO +%python_alternative %{_bindir}/davserver +%{python_sitelib}/* + +%changelog