Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname sieve

Name:             python-sieve
Version:          0.1.9
Release:          6%{?dist}
Summary:          XML Comparison Utils

Group:            Development/Libraries
License:          MIT
URL:              http://pypi.python.org/pypi/sieve
Source0:          http://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:        noarch


BuildRequires:    python2-devel
BuildRequires:    python-six
BuildRequires:    python-lxml
BuildRequires:    python-markupsafe
BuildRequires:    python-nose

%if 0%{?with_python3}
BuildRequires:    python3-devel
BuildRequires:    python3-six
BuildRequires:    python3-lxml
BuildRequires:    python3-markupsafe
BuildRequires:    python3-nose
%endif

Requires:   python-six
Requires:   python-lxml
Requires:   python-markupsafe

Provides:   python2-sieve

%description
Ripped from FormEncode and strainer just to support Pythons 2 and 3.
Intended for use in your webapp test suites.

Example usage::

    >>> from sieve.operators import eq_xml, in_xml 
    >>> a = "<foo><bar>Value</bar></foo>" 
    >>> b = """ 
    ... <foo> 
    ...     <bar>
    ...         Value 
    ...     </bar> 
    ... </foo> 
    ... """
    >>> eq_xml(a, b)
    True 
    >>> c = "<html><body><foo><bar>Value</bar></foo></body></html"
    >>> in_xml(a, c)  # 'needle' in a 'haystack'
    True


%if 0%{?with_python3}
%package -n python3-sieve
Summary:        XML Comparison Utils
Group:          Development/Libraries

Requires:   python3-six
Requires:   python3-lxml
Requires:   python3-markupsafe

%description -n python3-sieve
Ripped from FormEncode and strainer just to support Pythons 2 and 3.
Intended for use in your webapp test suites.

Example usage::

    >>> from sieve.operators import eq_xml, in_xml 
    >>> a = "<foo><bar>Value</bar></foo>" 
    >>> b = """ 
    ... <foo> 
    ...     <bar>
    ...         Value 
    ...     </bar> 
    ... </foo> 
    ... """
    >>> eq_xml(a, b)
    True 
    >>> c = "<html><body><foo><bar>Value</bar></foo></body></html"
    >>> in_xml(a, c)  # 'needle' in a 'haystack'
    True
%endif

%prep
%setup -q -n %{modname}-%{version}

rm -rf %{modname}.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif


%build
%{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif


%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif

%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%check
%{__python} setup.py test

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif


%files
%doc README.rst LICENSE.txt
%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}*

%if 0%{?with_python3}
%files -n python3-%{modname}
%doc LICENSE.txt README.rst
%{python3_sitelib}/%{modname}
%{python3_sitelib}/%{modname}-%{version}-*

%endif


%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.9-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.1.9-4
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.9-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan  7 2016 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1.9-1
- Update to upstream 0.1.9 to fix tracebacks with some xml fragments

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-14
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Nov 13 2014 Ralph Bean <rbean@redhat.com> - 0.1.6-12
- Fixed with_python3 conditional.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.1.6-10
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Nov 03 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-7
- Move python3 requirements into the correct section.

* Tue Oct 30 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-6
- Bump release to get around a koji hiccup again.

* Mon Oct 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-5
- Bump release to get around a koji hiccup.

* Tue Sep 25 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-4
- Added requirement on python3-six back in since that package has been split.

* Mon Sep 24 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-3
- Removed upstream egg-info in prep section.

* Fri Jun 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-2
- Fix to python-six dependencies.  (no python3-six)

* Fri Jun 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-1
- Initial package for Fedora