From e06d2052bcf32c7e88805bcb2ff94eed250cffbd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2019 08:16:33 +0000 Subject: import pyxattr-0.5.3-18.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a4bf0a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pyxattr-0.5.3.tar.gz diff --git a/.pyxattr.metadata b/.pyxattr.metadata new file mode 100644 index 0000000..b95efdf --- /dev/null +++ b/.pyxattr.metadata @@ -0,0 +1 @@ +b403951d3b987b0fa1203377fcab8165aaa29ac0 SOURCES/pyxattr-0.5.3.tar.gz diff --git a/SOURCES/0001-use-Py_ssize_t.patch b/SOURCES/0001-use-Py_ssize_t.patch new file mode 100644 index 0000000..085aadc --- /dev/null +++ b/SOURCES/0001-use-Py_ssize_t.patch @@ -0,0 +1,127 @@ +From 50f7c251523f6be3be3426aa6499e5495a18b442 Mon Sep 17 00:00:00 2001 +From: Mark Hamzy +Date: Wed, 6 Aug 2014 14:06:45 -0500 +Subject: [PATCH] use Py_ssize_t + +>Starting with Python 2.5 the type of the length argument can be controlled by +>defining the macro PY_SSIZE_T_CLEAN before including Python.h. If the macro is +>defined, length is a Py_ssize_t rather than an int. + +dmalcolm@redhat.com says: +"and IIRC that *does* in fact affect "et#" and the other hash-suffixed codes +i.e. PyArg_ParseTupleAndKeywords was expecting bufsize to be a Py_ssize_t, not an int." + +So, changing size_t to Py_ssize_t and ints used as sizes to Py_ssize_t. + +--- + xattr.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/xattr.c b/xattr.c +index cc1fa44..2529e90 100644 +--- a/xattr.c ++++ b/xattr.c +@@ -193,7 +193,7 @@ static int merge_ns(const char *ns, const char *name, + return 0; + } + +-static ssize_t _list_obj(target_t *tgt, char *list, size_t size) { ++static Py_ssize_t _list_obj(target_t *tgt, char *list, Py_ssize_t size) { + if(tgt->type == T_FD) + return flistxattr(tgt->fd, list, size); + else if (tgt->type == T_LINK) +@@ -202,8 +202,8 @@ static ssize_t _list_obj(target_t *tgt, char *list, size_t size) { + return listxattr(tgt->name, list, size); + } + +-static ssize_t _get_obj(target_t *tgt, const char *name, void *value, +- size_t size) { ++static Py_ssize_t _get_obj(target_t *tgt, const char *name, void *value, ++ Py_ssize_t size) { + if(tgt->type == T_FD) + return fgetxattr(tgt->fd, name, value, size); + else if (tgt->type == T_LINK) +@@ -213,7 +213,7 @@ static ssize_t _get_obj(target_t *tgt, const char *name, void *value, + } + + static int _set_obj(target_t *tgt, const char *name, +- const void *value, size_t size, int flags) { ++ const void *value, Py_ssize_t size, int flags) { + if(tgt->type == T_FD) + return fsetxattr(tgt->fd, name, value, size, flags); + else if (tgt->type == T_LINK) +@@ -242,7 +242,7 @@ static int _remove_obj(target_t *tgt, const char *name) { + + */ + const char *matches_ns(const char *ns, const char *name) { +- size_t ns_size; ++ Py_ssize_t ns_size; + if (ns == NULL || *ns == '\0') + return name; + ns_size = strlen(ns); +@@ -275,7 +275,7 @@ pygetxattr(PyObject *self, PyObject *args) + int nofollow = 0; + char *attrname = NULL; + char *buf; +- ssize_t nalloc, nret; ++ Py_ssize_t nalloc, nret; + PyObject *res; + + /* Parse the arguments */ +@@ -352,7 +352,7 @@ xattr_get(PyObject *self, PyObject *args, PyObject *keywds) + const char *fullname; + char *buf; + const char *ns = NULL; +- ssize_t nalloc, nret; ++ Py_ssize_t nalloc, nret; + PyObject *res; + static char *kwlist[] = {"item", "name", "nofollow", "namespace", NULL}; + +@@ -451,7 +451,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) + const char *ns = NULL; + char *buf_list, *buf_val; + const char *s; +- ssize_t nalloc, nlist, nval; ++ Py_ssize_t nalloc, nlist, nval; + PyObject *mylist; + target_t tgt; + static char *kwlist[] = {"item", "nofollow", "namespace", NULL}; +@@ -604,7 +604,7 @@ pysetxattr(PyObject *self, PyObject *args) + int nofollow = 0; + char *attrname = NULL; + char *buf = NULL; +- int bufsize; ++ Py_ssize_t bufsize; + int nret; + int flags = 0; + target_t tgt; +@@ -670,7 +670,7 @@ xattr_set(PyObject *self, PyObject *args, PyObject *keywds) + int nofollow = 0; + char *attrname = NULL; + char *buf = NULL; +- int bufsize; ++ Py_ssize_t bufsize; + int nret; + int flags = 0; + target_t tgt; +@@ -856,7 +856,7 @@ pylistxattr(PyObject *self, PyObject *args) + { + char *buf; + int nofollow=0; +- ssize_t nalloc, nret; ++ Py_ssize_t nalloc, nret; + PyObject *myarg; + PyObject *mylist; + Py_ssize_t nattrs; +@@ -956,7 +956,7 @@ xattr_list(PyObject *self, PyObject *args, PyObject *keywds) + { + char *buf; + int nofollow = 0; +- ssize_t nalloc, nret; ++ Py_ssize_t nalloc, nret; + PyObject *myarg; + PyObject *res; + const char *ns = NULL; +-- +2.0.0 + diff --git a/SOURCES/0002-add-workaround-for-undefined-ENOATTR.patch b/SOURCES/0002-add-workaround-for-undefined-ENOATTR.patch new file mode 100644 index 0000000..75d27fc --- /dev/null +++ b/SOURCES/0002-add-workaround-for-undefined-ENOATTR.patch @@ -0,0 +1,31 @@ +From 3efd44125a6f64fba786d08254e9d1bb6f08abde Mon Sep 17 00:00:00 2001 +From: Milind Changire +Date: Sat, 4 Aug 2018 17:51:25 +0530 +Subject: [PATCH 2/2] add workaround for undefined ENOATTR + +define ENOATTR as ENODATA +fixes bz#1610029 + +Signed-off-by: Milind Changire +--- + xattr.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xattr.c b/xattr.c +index 2529e90..ac248cd 100644 +--- a/xattr.c ++++ b/xattr.c +@@ -97,6 +97,10 @@ typedef int Py_ssize_t; + multi-operations */ + #define ESTIMATE_ATTR_SIZE 256 + ++#if !defined(ENOATTR) ++#define ENOATTR ENODATA ++#endif ++ + typedef enum {T_FD, T_PATH, T_LINK} target_e; + + typedef struct { +-- +2.17.1 + diff --git a/SPECS/pyxattr.spec b/SPECS/pyxattr.spec new file mode 100644 index 0000000..0dbfa0e --- /dev/null +++ b/SPECS/pyxattr.spec @@ -0,0 +1,260 @@ +%global with_python3 1 + +%if 0%{?rhel} > 7 +# Disable python2 build by default +%global with_python2 0 +%else +%global with_python2 1 +%endif + +Name: pyxattr +Summary: Extended attributes library wrapper for Python +Version: 0.5.3 +Release: 18%{?dist} +License: LGPLv2+ +Group: Development/Libraries +URL: http://pyxattr.k1024.org/ +Source: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +Patch0: 0001-use-Py_ssize_t.patch +Patch1: 0002-add-workaround-for-undefined-ENOATTR.patch +BuildRequires: libattr-devel +%if %{?with_python2} +BuildRequires: python2-devel, python2-setuptools +%endif +%if %{?with_python3} +BuildRequires: python3-devel, python3-setuptools +%endif # with_python3 + +%global _description\ +Python extension module wrapper for libattr. It allows to query, list,\ +add and remove extended attributes from files and directories. + +%description %_description + +%if %{?with_python2} +%package -n python2-%{name} +Summary: %summary +%{?python_provide:%python_provide python2-%{name}} +# Remove before F30 +Provides: pyxattr = %{version}-%{release} +Provides: pyxattr%{?_isa} = %{version}-%{release} +Obsoletes: pyxattr < %{version}-%{release} + +%description -n python2-%{name} %_description +%endif + +%if %{?with_python3} +%package -n python3-%{name} +Summary: Extended attributes library wrapper for Python 3 + +%description -n python3-%{name} +Python extension module wrapper for libattr. It allows to query, list, +add and remove extended attributes from files and directories. + +Python 3 version. +%endif # with_python3 + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + +%build +%if %{?with_python2} +CFLAGS="%{optflags}" %{__python2} setup.py build +%endif + +%if 0%{?with_python3} +CFLAGS="%{optflags}" %{__python3} setup.py build +%endif # with_python3 + +%install +%if %{?with_python2} +%{__python2} setup.py install --root="%{buildroot}" --prefix="%{_prefix}" +%endif + +%if 0%{?with_python3} +%{__python3} setup.py install --root="%{buildroot}" --prefix="%{_prefix}" +%endif # with_python3 + +%check +# selinux in koji produces unexpected xattrs for tests +export TEST_IGNORE_XATTRS=security.selinux + +%if %{?with_python2} +%{__python2} setup.py test +%endif + +%if 0%{?with_python3} +%{__python3} setup.py test +%endif # with_python3 + +%if %{?with_python2} +%files -n python2-%{name} +%defattr(0644,root,root,0755) +%{python2_sitearch}/xattr.so +%{python2_sitearch}/*egg-info +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc NEWS README +%endif + +%if %{?with_python3} +%files -n python3-%{name} +%defattr(0644,root,root,0755) +%{python3_sitearch}/xattr.cpython-??m* +%{python3_sitearch}/*egg-info +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc NEWS README +%endif # with_python3 + +%changelog +* Sat Aug 04 2018 Milind Changire - 0.5.3-18 +- fixes bz#1610029 + +* Tue Jun 26 2018 Lumír Balhar - 0.5.3-17 +- Python 2 subpackage disable by default + +* Fri Feb 09 2018 Fedora Release Engineering - 0.5.3-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jan 31 2018 Iryna Shcherbina - 0.5.3-15 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Tue Dec 26 2017 Zbigniew Jędrzejewski-Szmek - 0.5.3-14 +- Also add Provides for the old name without %%_isa + +* Sun Aug 13 2017 Zbigniew Jędrzejewski-Szmek - 0.5.3-13 +- Python 2 binary package renamed to python2-pyxattr + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Thu Aug 03 2017 Fedora Release Engineering - 0.5.3-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.5.3-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.5.3-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Dec 09 2016 Charalampos Stratakis - 0.5.3-9 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 0.5.3-8 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 0.5.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Oct 14 2015 Robert Kuska - 0.5.3-6 +- Rebuilt for Python3.5 rebuild +- Change pattern for listed so file to reflect new naming in py35 + +* Thu Jun 18 2015 Fedora Release Engineering - 0.5.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 0.5.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Aug 7 2014 Marcin Zajaczkowski - 0.5.3-3 +- add Mark Hamzy's patch to fix issue with PPC builds (bug 1127310) + +* Mon Aug 4 2014 Tom Callaway - 0.5.3-2 +- fix license handling + +* Sat Jun 28 2014 Miro Hrončok - 0.5.3-1 +- Updated to 0.5.3 +- Updated the website +- Updated download URL to PyPI +- Removed useless Require of python >= 2.2 +- Use %%{pythonX_sitearch} macros +- Removed BuildRoot definition, %%clean section and rm -rf at the beginning of %%install +- Introduced Python 3 subpackage +- Introduced %%check and run the test suite + +* Sun Jun 08 2014 Fedora Release Engineering - 0.5.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 0.5.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 0.5.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 0.5.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jun 26 2012 Marcin Zajaczkowski - 0.5.1-1 +- updated to 0.5.1 +- fix bugs found with cpychecker (bug 809974) + +* Mon Feb 27 2012 Marcin Zajaczkowski - 0.5.0-5 +- remove prodive/obsolete of python-xattr (bug 781838) +- fix problem with mixed use of tabs and spaces + +* Sat Jan 14 2012 Fedora Release Engineering - 0.5.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 0.5.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jul 22 2010 David Malcolm - 0.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Sun Dec 27 2009 Marcin Zajaczkowski - 0.5.0-1 +- updated to 0.5.0 +- added support for unicode filenames (bug 479417) + +* Sun Jul 26 2009 Fedora Release Engineering - 0.4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 0.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sat Dec 6 2008 Marcin Zajaczkowski - 0.4.0-2 +- added python-setuptools in BuildRequires which is needed in build process +since version 0.4.0 (thanks to Kevin Fenzi) + +* Fri Dec 5 2008 Marcin Zajaczkowski - 0.4.0-1 +- updated to 0.4.0 +- License Tag adjusted to current licensing LGPLv2+ +- modified Python Eggs support due to its usage in source distribution + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.2.2-4 +- Rebuild for Python 2.6 + +* Tue Feb 19 2008 Fedora Release Engineering - 0.2.2-3 +- Autorebuild for GCC 4.3 + +* Tue Jan 15 2008 Marcin Zajaczkowski - 0.2.2-2 +- added compatibility with Python Eggs forced in F9 + +* Mon Aug 27 2007 Marcin Zajaczkowski - 0.2.2-1 +- upgraded to 0.2.2 + +* Sun Aug 26 2007 Kevin Fenzi - 0.2.1-5 + - Updated License tag + +* Wed Apr 25 2007 Marcin Zajaczkowski - 0.2.1-4 + - added Provides/Obsoletes tags + +* Sat Apr 21 2007 Marcin Zajaczkowski - 0.2.1-3 + - removed redundant after name change "exclude" tag + - comments cleanup + +* Wed Apr 18 2007 Marcin Zajaczkowski - 0.2.1-2 + - applied suggestions from Kevin Fenzi + - name changed from python-xattr to pyxattr + - corrected path to the source file + +* Thu Apr 5 2007 Marcin Zajaczkowski - 0.2.1-1 + - updated to 0.2.1 + - added python-devel in BuildRequires + - added more doc files + - added Provides section + - modified to Fedora Extras requirements + +* Sun Sep 11 2005 Dag Wieers - 0.2-1 - +/ +- Initial package. (using DAR)