%if 0%{?fedora} > 12 || 0%{?rhel} > 6
#%%global with_python3 1
# Manually turn this off. We should be good-to-go with python3 support here
# once python3-translationstring makes it into rawhide.
# There is nothing upstream blocking us on that.. it just requires some .spec
# work.
%global with_python3 0
%endif
%global modname colander
Name: python-colander
Version: 0.9.9
Release: 2%{?dist}
Summary: A simple schema-based serialization and deserialization library
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/colander
Source0: http://pypi.python.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-translationstring
BuildRequires: python-nose
BuildRequires: python-coverage
Requires: python-translationstring
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-translationstring
BuildRequires: python3-nose
BuildRequires: python3-coverage
Requires: python3-translationstring
%endif
%description
An extensible package which can be used to:
- deserialize and validate a data structure composed of strings, mappings,
and lists.
- serialize an arbitrary data structure to a data structure composed of
strings, mappings, and lists.
It runs on Python 2.6, 2.7 and 3.2.
Please see http://docs.pylonsproject.org/projects/colander/en/latest/ for
further documentation.
%if 0%{?with_python3}
%package -n python3-colander
Summary: A simple schema-based serialization and deserialization library
Group: Development/Libraries
%description -n python3-colander
An extensible package which can be used to:
- deserialize and validate a data structure composed of strings, mappings,
and lists.
- serialize an arbitrary data structure to a data structure composed of
strings, mappings, and lists.
It runs on Python 2.6, 2.7 and 3.2.
Please see http://docs.pylonsproject.org/projects/colander/en/latest/ for
further documentation.
%endif
%prep
%setup -q -n %{modname}-%{version}
# The presence of this file creates an rpmlint error. Remove it.
rm docs/.gitignore
rm -rf docs/.static
# Remove bundled egg-info in case it exists
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.txt LICENSE.txt COPYRIGHT.txt CONTRIBUTORS.txt CHANGES.txt docs
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*
%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.txt LICENSE.txt COPYRIGHT.txt CONTRIBUTORS.txt CHANGES.txt docs
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*
%endif
%changelog
* Fri Dec 07 2012 Ralph Bean <rbean@redhat.com> - 0.9.9-2
- Remove the hidden static folder in the docs directory at prep time.
* Fri Dec 07 2012 Ralph Bean <rbean@redhat.com> - 0.9.9-1
- Initial packaging for Fedora