Blob Blame History Raw
%global mod_name WTForms
%global with_python3 1

Name:           python-wtforms
Version:        2.0
Release:        3%{?dist}
Summary:        Forms validation and rendering library for python

Group:          Development/Libraries
License:        BSD
URL:            http://wtforms.simplecodes.com/
Source0:        http://pypi.python.org/packages/source/W/%{mod_name}/%{mod_name}-%{version}.zip

BuildArch:      noarch
BuildRequires:  python-devel
BuildRequires:  python-setuptools
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%endif

%description
With wtforms, your form field HTML can be generated for you. 
This allows you to maintain separation of code and presentation, 
and keep those messy parameters out of your python code.

%if 0%{?with_python3}
%package -n python3-wtforms
Summary:        Forms validation and rendering library for python

%description -n python3-wtforms
With wtforms, your form field HTML can be generated for you. 
This allows you to maintain separation of code and presentation, 
and keep those messy parameters out of your python code.
%endif


%prep
%setup -q -n %{mod_name}-%{version}
sed -i "s|\r||g" docs/html/_sources/index.txt
sed -i "s|\r||g" docs/conf.py
sed -i "s|\r||g" docs/Makefile
sed -i "s|\r||g" docs/index.rst
sed -i "s|\r||g" docs/html/_static/jquery.js
rm -f docs/html/.buildinfo

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

%build
%{__python2} setup.py build

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

%install
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}

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

%find_lang wtforms

%files -f wtforms.lang
%doc docs/ LICENSE.txt PKG-INFO
%{python_sitelib}/*.egg-info
%{python_sitelib}/wtforms/

%if 0%{?with_python3}
%files -n python3-wtforms -f wtforms.lang
%doc docs/ LICENSE.txt PKG-INFO
%{python3_sitelib}/*.egg-info/
%{python3_sitelib}/wtforms/
%endif

%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sat May 24 2014 Praveen Kumar <kumarpraveen.nitdgp@gmail.com> 2.0-1
- Upgrade to upstream version
- Add python3 support

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

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

* Thu Aug 09 2012 Tim Flink <tflink@fedoraproject.org> - 1.0.2-1
- Upgraded to upstream 1.0.2

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Jul 21 2011 Praveen Kumar <kumarpraveen.nitdgp@gmail.com> - 0.6.3-1
- Initial RPM release