99c992a
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
99c992a
%global with_python3 1
99c992a
%endif
99c992a
99c992a
%global modname sieve
99c992a
99c992a
Name:             python-sieve
99c992a
Version:          0.1.6
e7151b5
Release:          7%{?dist}
99c992a
Summary:          XML Comparison Utils
99c992a
99c992a
Group:            Development/Libraries
99c992a
License:          MIT
99c992a
URL:              http://pypi.python.org/pypi/sieve
99c992a
Source0:          http://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz
99c992a
99c992a
BuildArch:        noarch
99c992a
99c992a
99c992a
BuildRequires:    python2-devel
99c992a
BuildRequires:    python-six
99c992a
BuildRequires:    python-lxml
99c992a
BuildRequires:    python-nose
99c992a
99c992a
%if 0%{?with_python3}
99c992a
BuildRequires:    python3-devel
99c992a
BuildRequires:    python3-six
99c992a
BuildRequires:    python3-lxml
99c992a
BuildRequires:    python3-nose
99c992a
%endif
99c992a
99c992a
Requires:   python-six
99c992a
Requires:   python-lxml
99c992a
99c992a
99c992a
%description
99c992a
Ripped from FormEncode and strainer just to support Pythons 2 and 3.
99c992a
Intended for use in your webapp test suites.
99c992a
99c992a
Example usage::
99c992a
99c992a
    >>> from sieve.operators import eq_xml, in_xml 
99c992a
    >>> a = "<foo><bar>Value</bar></foo>" 
99c992a
    >>> b = """ 
99c992a
    ... <foo> 
99c992a
    ...     <bar>
99c992a
    ...         Value 
99c992a
    ...     </bar> 
99c992a
    ... </foo> 
99c992a
    ... """
99c992a
    >>> eq_xml(a, b)
99c992a
    True 
99c992a
    >>> c = "<html><body><foo><bar>Value</bar></foo></body>
99c992a
    >>> in_xml(a, c)  # 'needle' in a 'haystack'
99c992a
    True
99c992a
99c992a
99c992a
%if 0%{?with_python3}
99c992a
%package -n python3-sieve
99c992a
Summary:        XML Comparison Utils
99c992a
Group:          Development/Libraries
99c992a
e7151b5
Requires:   python3-six
e7151b5
Requires:   python3-lxml
e7151b5
99c992a
%description -n python3-sieve
99c992a
Ripped from FormEncode and strainer just to support Pythons 2 and 3.
99c992a
Intended for use in your webapp test suites.
99c992a
99c992a
Example usage::
99c992a
99c992a
    >>> from sieve.operators import eq_xml, in_xml 
99c992a
    >>> a = "<foo><bar>Value</bar></foo>" 
99c992a
    >>> b = """ 
99c992a
    ... <foo> 
99c992a
    ...     <bar>
99c992a
    ...         Value 
99c992a
    ...     </bar> 
99c992a
    ... </foo> 
99c992a
    ... """
99c992a
    >>> eq_xml(a, b)
99c992a
    True 
99c992a
    >>> c = "<html><body><foo><bar>Value</bar></foo></body>
99c992a
    >>> in_xml(a, c)  # 'needle' in a 'haystack'
99c992a
    True
99c992a
%endif
99c992a
99c992a
%prep
99c992a
%setup -q -n %{modname}-%{version}
99c992a
99c992a
rm -rf %{modname}.egg-info
99c992a
99c992a
%if 0%{?with_python3}
99c992a
rm -rf %{py3dir}
99c992a
cp -a . %{py3dir}
99c992a
%endif
99c992a
99c992a
99c992a
%build
99c992a
%{__python} setup.py build
99c992a
99c992a
%if 0%{?with_python3}
99c992a
pushd %{py3dir}
99c992a
%{__python3} setup.py build
99c992a
popd
99c992a
%endif
99c992a
99c992a
99c992a
%install
99c992a
%if 0%{?with_python3}
99c992a
pushd %{py3dir}
99c992a
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
99c992a
popd
99c992a
%endif
99c992a
99c992a
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
99c992a
99c992a
%check
99c992a
%{__python} setup.py test
99c992a
99c992a
%if 0%{?with_python3}
99c992a
pushd %{py3dir}
99c992a
%{__python3} setup.py test
99c992a
popd
99c992a
%endif
99c992a
99c992a
99c992a
%files
99c992a
%doc README.rst LICENSE.txt
99c992a
%{python_sitelib}/%{modname}
99c992a
%{python_sitelib}/%{modname}-%{version}*
99c992a
99c992a
%if 0%{?with_python3}
99c992a
%files -n python3-%{modname}
99c992a
%doc LICENSE.txt README.rst
99c992a
%{python3_sitelib}/%{modname}
99c992a
%{python3_sitelib}/%{modname}-%{version}-*
99c992a
99c992a
%endif
99c992a
99c992a
99c992a
%changelog
e7151b5
* Sat Nov 03 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-7
e7151b5
- Move python3 requirements into the correct section.
e7151b5
eb42457
* Tue Oct 30 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-6
eb42457
- Bump release to get around a koji hiccup again.
eb42457
65a4b8d
* Mon Oct 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-5
65a4b8d
- Bump release to get around a koji hiccup.
65a4b8d
99c992a
* Tue Sep 25 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-4
99c992a
- Added requirement on python3-six back in since that package has been split.
99c992a
99c992a
* Mon Sep 24 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-3
99c992a
- Removed upstream egg-info in prep section.
99c992a
99c992a
* Fri Jun 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-2
99c992a
- Fix to python-six dependencies.  (no python3-six)
99c992a
99c992a
* Fri Jun 22 2012 Ralph Bean <rbean@redhat.com> - 0.1.6-1
99c992a
- Initial package for Fedora