Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 7
%global with_python3 0
%else
%global with_python3 1
%endif

%global modname tw2.forms

Name:           python-tw2-forms
Version:        2.2.3
Release:        7%{?dist}
Summary:        Forms for ToscaWidgets2

Group:          Development/Languages
License:        MIT
URL:            http://toscawidgets.org
Source0:        http://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz
BuildArch:      noarch

# For building, generally
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  python-webob1.0 >= 0.9.7
%else
BuildRequires:  python-webob >= 0.9.7
%endif
BuildRequires:  python-tw2-core >= 2.1.4
BuildRequires:  python-paste-deploy

# Specifically for the test suite
BuildRequires:  python-nose
BuildRequires:  python-coverage
BuildRequires:  python-formencode
BuildRequires:  python-webtest
BuildRequires:  python-sieve >= 0.1.9

# Templating languages for the test suite
BuildRequires:  python-mako
BuildRequires:  python-genshi
BuildRequires:  python-chameleon
BuildRequires:  python-kajiki
BuildRequires:  python-jinja2

%if 0%{?with_python3}
# For building, generally
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-webob >= 0.9.7
BuildRequires:  python3-tw2-core >= 2.1.4
BuildRequires:  python3-paste-deploy

# Specifically for the test suite
BuildRequires:  python3-nose
BuildRequires:  python3-coverage
BuildRequires:  python3-formencode
BuildRequires:  python3-webtest
BuildRequires:  python3-sieve >= 0.1.9

# Templating languages for the test suite
BuildRequires:  python3-mako
BuildRequires:  python3-genshi
BuildRequires:  python3-chameleon
BuildRequires:  python3-kajiki
BuildRequires:  python3-jinja2
%endif

# Runtime requirements

%global _description\
ToscaWidgets is a web widget toolkit for Python to aid in the creation,\
packaging and distribution of common view elements normally used in the web.\
\
tw2.forms contains the basic form widgets.

%description %_description

%package -n python2-tw2-forms
Summary: %summary
Requires:       python-tw2-core >= 2.1.4
Provides:       python2-tw2-forms
%{?python_provide:%python_provide python2-tw2-forms}

%description -n python2-tw2-forms %_description

%if 0%{?with_python3}
%package -n python3-tw2-forms
Summary: Forms for ToscaWidgets2
Requires: python3-tw2-core >= 2.1.4

%description -n python3-tw2-forms
ToscaWidgets is a web widget toolkit for Python to aid in the creation,
packaging and distribution of common view elements normally used in the web.

This package contains the basic form widgets build for python3.
%endif


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

%if 0%{?rhel} && 0%{?rhel} <= 6

# Make sure that epel/rhel picks up the correct version of webob
awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.0\"]; import pkg_resources"}1' setup.py > setup.py.tmp
mv setup.py.tmp setup.py

sed -i 's|Jinja2|jinja2|g' setup.py

# Remove all the fancy nosetests configuration for older python
rm setup.cfg

%endif

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


%build
%{__python2} setup.py build

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


%install
%{__python2} setup.py install --skip-build \
    --install-data=%{_datadir} --root %{buildroot}

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


%check
PYTHONPATH=$(pwd) %{__python2} setup.py test

#%if 0%{?with_python3}
#pushd %{py3dir}
#PYTHONPATH=$(pwd) %{__python3} setup.py test
#popd
#%endif # with_python3


%files -n python2-tw2-forms
%{!?_licensedir:%global license %%doc}
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/tw2/forms
%{python2_sitelib}/%{modname}-%{version}*

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

%changelog
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.3-7
- Python 2 binary package renamed to python2-tw2-forms
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

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

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

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

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

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

* Thu Jan  7 2016 Toshio Kuratomi <toshio@fedoraproject.org> - 2.2.3-1
- Update to upstream 2.2.3
- Add a python3 subpackage

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

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

* Mon Apr 28 2014 Ralph Bean <rbean@redhat.com> - 2.1.4.1-7
- Try to fix deps busted by releng.

* Mon Apr 28 2014 Ralph Bean <rbean@redhat.com> - 2.1.4.1-6
- Backported patch to fix buttons.

* Tue Aug 06 2013 Ralph Bean <rbean@redhat.com> - 2.1.4.1-5
- Temporarily disable test suite until the 2.2 release.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
- Disable tests for epel7.

* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 2.1.4.1-3
- Rename Jinja2 to jinja2 for el6.

* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 2.1.4.1-2
- Renamed README from .txt to .rst.

* Fri Feb 22 2013 Ralph Bean <rbean@redhat.com> - 2.1.4.1-1
- Latest upstream.

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

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

* Thu Jun 07 2012 Ralph Bean <rbean@redhat.com> - 2.0.2-3
- More explicit directory ownership.

* Mon Apr 30 2012 Ralph Bean <rbean@redhat.com> - 2.0.2-2
- Removed clean section
- Removed defattr in files section
- Removed unnecessary references to buildroot

* Wed Apr 11 2012 Ralph Bean <rbean@redhat.com> - 2.0.2-1
- Update for latest tw2.forms release.
- Fixes rpmlint errors.  Execution bit in templates, wat?
- Added dist macro to release field.
- Added awk line to make sure pkg_resources picks up the right WebOb on el6

* Thu Apr 05 2012 Ralph Bean <rbean@redhat.com> - 2.0.1-1
- Update for latest tw2.forms release.

* Thu Jun 16 2011 Luke Macken <lmacken@redhat.com> - 2.0-0.1.b4
- Initial package