2eb900
%global with_python3 1
2eb900
2eb900
%if 0%{?rhel} > 7
2eb900
# Disable python2 build by default
2eb900
%global with_python2 0
2eb900
%else
2eb900
%global with_python2 1
2eb900
%endif
2eb900
2eb900
Name:		pyxattr
2eb900
Summary:	Extended attributes library wrapper for Python
2eb900
Version:	0.5.3
2eb900
Release:	18%{?dist}
2eb900
License:	LGPLv2+
2eb900
Group:		Development/Libraries
2eb900
URL:		http://pyxattr.k1024.org/
2eb900
Source:		https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
2eb900
Patch0:		0001-use-Py_ssize_t.patch
2eb900
Patch1:         0002-add-workaround-for-undefined-ENOATTR.patch
2eb900
BuildRequires:	libattr-devel
2eb900
%if %{?with_python2}
2eb900
BuildRequires:	python2-devel, python2-setuptools
2eb900
%endif
2eb900
%if %{?with_python3}
2eb900
BuildRequires:	python3-devel, python3-setuptools
2eb900
%endif # with_python3
2eb900
2eb900
%global _description\
2eb900
Python extension module wrapper for libattr. It allows to query, list,\
2eb900
add and remove extended attributes from files and directories.
2eb900
2eb900
%description %_description
2eb900
2eb900
%if %{?with_python2}
2eb900
%package -n python2-%{name}
2eb900
Summary: %summary
2eb900
%{?python_provide:%python_provide python2-%{name}}
2eb900
# Remove before F30
2eb900
Provides: pyxattr = %{version}-%{release}
2eb900
Provides: pyxattr%{?_isa} = %{version}-%{release}
2eb900
Obsoletes: pyxattr < %{version}-%{release}
2eb900
2eb900
%description -n python2-%{name} %_description
2eb900
%endif
2eb900
2eb900
%if %{?with_python3}
2eb900
%package -n python3-%{name}
2eb900
Summary:	Extended attributes library wrapper for Python 3
2eb900
2eb900
%description -n python3-%{name}
2eb900
Python extension module wrapper for libattr. It allows to query, list,
2eb900
add and remove extended attributes from files and directories.
2eb900
2eb900
Python 3 version.
2eb900
%endif # with_python3
2eb900
2eb900
%prep
2eb900
%setup -q
2eb900
%patch0 -p1
2eb900
%patch1 -p1
2eb900
2eb900
%build
2eb900
%if %{?with_python2}
2eb900
CFLAGS="%{optflags}" %{__python2} setup.py build
2eb900
%endif
2eb900
2eb900
%if 0%{?with_python3}
2eb900
CFLAGS="%{optflags}" %{__python3} setup.py build
2eb900
%endif # with_python3
2eb900
2eb900
%install
2eb900
%if %{?with_python2}
2eb900
%{__python2} setup.py install --root="%{buildroot}" --prefix="%{_prefix}"
2eb900
%endif
2eb900
2eb900
%if 0%{?with_python3}
2eb900
%{__python3} setup.py install --root="%{buildroot}" --prefix="%{_prefix}"
2eb900
%endif # with_python3
2eb900
2eb900
%check
2eb900
# selinux in koji produces unexpected xattrs for tests
2eb900
export TEST_IGNORE_XATTRS=security.selinux
2eb900
2eb900
%if %{?with_python2}
2eb900
%{__python2} setup.py test
2eb900
%endif
2eb900
2eb900
%if 0%{?with_python3}
2eb900
%{__python3} setup.py test
2eb900
%endif # with_python3
2eb900
2eb900
%if %{?with_python2}
2eb900
%files -n python2-%{name}
2eb900
%defattr(0644,root,root,0755)
2eb900
%{python2_sitearch}/xattr.so
2eb900
%{python2_sitearch}/*egg-info
2eb900
%{!?_licensedir:%global license %%doc}
2eb900
%license COPYING
2eb900
%doc NEWS README
2eb900
%endif
2eb900
2eb900
%if %{?with_python3}
2eb900
%files -n python3-%{name}
2eb900
%defattr(0644,root,root,0755)
2eb900
%{python3_sitearch}/xattr.cpython-??m*
2eb900
%{python3_sitearch}/*egg-info
2eb900
%{!?_licensedir:%global license %%doc}
2eb900
%license COPYING
2eb900
%doc NEWS README
2eb900
%endif # with_python3
2eb900
2eb900
%changelog
2eb900
* Sat Aug 04 2018 Milind Changire <mchangir@redhat.com> - 0.5.3-18
2eb900
- fixes bz#1610029
2eb900
2eb900
* Tue Jun 26 2018 LumĆ­r Balhar <lbalhar@redhat.com> - 0.5.3-17
2eb900
- Python 2 subpackage disable by default
2eb900
2eb900
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-16
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2eb900
2eb900
* Wed Jan 31 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.5.3-15
2eb900
- Update Python 2 dependency declarations to new packaging standards
2eb900
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
2eb900
2eb900
* Tue Dec 26 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.5.3-14
2eb900
- Also add Provides for the old name without %%_isa
2eb900
2eb900
* Sun Aug 13 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.5.3-13
2eb900
- Python 2 binary package renamed to python2-pyxattr
2eb900
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
2eb900
2eb900
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-12
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
2eb900
2eb900
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-11
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2eb900
2eb900
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-10
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2eb900
2eb900
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.5.3-9
2eb900
- Rebuild for Python 3.6
2eb900
2eb900
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-8
2eb900
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
2eb900
2eb900
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-7
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2eb900
2eb900
* Wed Oct 14 2015 Robert Kuska <rkuska@redhat.com> - 0.5.3-6
2eb900
- Rebuilt for Python3.5 rebuild
2eb900
- Change pattern for listed so file to reflect new naming in py35
2eb900
2eb900
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-5
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2eb900
2eb900
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-4
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
2eb900
2eb900
* Thu Aug  7 2014 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.3-3
2eb900
- add Mark Hamzy's patch to fix issue with PPC builds (bug 1127310)
2eb900
2eb900
* Mon Aug  4 2014 Tom Callaway <spot@fedoraproject.org> - 0.5.3-2
2eb900
- fix license handling
2eb900
2eb900
* Sat Jun 28 2014 Miro HronĨok <mhroncok@redhat.com> - 0.5.3-1
2eb900
- Updated to 0.5.3
2eb900
- Updated the website
2eb900
- Updated download URL to PyPI
2eb900
- Removed useless Require of python >= 2.2
2eb900
- Use %%{pythonX_sitearch} macros
2eb900
- Removed BuildRoot definition, %%clean section and rm -rf at the beginning of %%install
2eb900
- Introduced Python 3 subpackage
2eb900
- Introduced %%check and run the test suite
2eb900
2eb900
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-5
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2eb900
2eb900
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-4
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2eb900
2eb900
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-3
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2eb900
2eb900
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2eb900
2eb900
* Tue Jun 26 2012 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.1-1
2eb900
- updated to 0.5.1
2eb900
- fix bugs found with cpychecker (bug 809974)
2eb900
2eb900
* Mon Feb 27 2012 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.0-5
2eb900
- remove prodive/obsolete of python-xattr (bug 781838)
2eb900
- fix problem with mixed use of tabs and spaces
2eb900
2eb900
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2eb900
2eb900
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2eb900
2eb900
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.0-2
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
2eb900
2eb900
* Sun Dec 27 2009 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.0-1
2eb900
- updated to 0.5.0
2eb900
- added support for unicode filenames (bug 479417)
2eb900
2eb900
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-4
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
2eb900
2eb900
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-3
2eb900
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
2eb900
2eb900
* Sat Dec 6 2008 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.4.0-2
2eb900
- added python-setuptools in BuildRequires which is needed in build process
2eb900
since version 0.4.0 (thanks to Kevin Fenzi)
2eb900
2eb900
* Fri Dec 5 2008 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.4.0-1
2eb900
- updated to 0.4.0
2eb900
- License Tag adjusted to current licensing LGPLv2+
2eb900
- modified Python Eggs support due to its usage in source distribution 
2eb900
2eb900
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.2.2-4
2eb900
- Rebuild for Python 2.6
2eb900
2eb900
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.2.2-3
2eb900
- Autorebuild for GCC 4.3
2eb900
2eb900
* Tue Jan 15 2008 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.2-2
2eb900
- added compatibility with Python Eggs forced in F9 
2eb900
2eb900
* Mon Aug 27 2007 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.2-1
2eb900
- upgraded to 0.2.2
2eb900
2eb900
* Sun Aug 26 2007 Kevin Fenzi <kevin@tummy.com> - 0.2.1-5
2eb900
 - Updated License tag
2eb900
2eb900
* Wed Apr 25 2007 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.1-4
2eb900
 - added Provides/Obsoletes tags
2eb900
2eb900
* Sat Apr 21 2007 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.1-3
2eb900
 - removed redundant after name change "exclude" tag
2eb900
 - comments cleanup
2eb900
2eb900
* Wed Apr 18 2007 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.1-2
2eb900
 - applied suggestions from Kevin Fenzi
2eb900
 - name changed from python-xattr to pyxattr
2eb900
 - corrected path to the source file
2eb900
2eb900
* Thu Apr 5 2007 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.2.1-1
2eb900
 - updated to 0.2.1
2eb900
 - added python-devel in BuildRequires
2eb900
 - added more doc files
2eb900
 - added Provides section
2eb900
 - modified to Fedora Extras requirements
2eb900
2eb900
* Sun Sep 11 2005 Dag Wieers <dag@wieers.com> - 0.2-1 - +/
2eb900
- Initial package. (using DAR)