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

%global modname backlash
%global prerelease a2

Name:               python-backlash
Version:            0.0.1
Release:            0.3.%{prerelease}%{?dist}
Summary:            Standalone WebOb port of the Werkzeug Debugger

Group:              Development/Libraries
License:            MIT
URL:                http://pypi.python.org/pypi/backlash
Source0:            http://pypi.python.org/packages/source/b/%{modname}/%{modname}-%{version}%{prerelease}.tar.gz
Patch0:             %{name}-ubuntu-font.patch

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-setuptools
Requires:           python-webob

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-setuptools
Requires:           python3-webob
%endif


%description
backlash is a standalone version of the Werkzeug Debugger based on WebOb
adapted to support for Python3.

backlash has born as a future replacement for WebError in upcoming TurboGears2
versions.


%if 0%{?with_python3}
%package -n python3-backlash
Summary:            Standalone WebOb port of the Werkzeug Debugger with Python3 support meant to replace WebError in TurboGears2
Group:              Development/Libraries

%description -n python3-backlash
backlash is a standalone version of the Werkzeug Debugger based on WebOb
adapted to support for Python3.

backlash has born as a future replacement for WebError in upcoming
TurboGears2 versions.
%endif


%prep
%setup -q -n %{modname}-%{version}%{prerelease}
%patch0 -p1

# 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
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

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


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

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


%changelog
* Thu Apr 04 2013 Luke Macken <lmacken@redhat.com> 0.0.1-0.3.a2
- Build the python3 subpackage
- Fix pre-release version

* Wed Apr 03 2013 Luke Macken <lmacken@redhat.com> 0.0.1a2-2
- Remove the non-free ubuntu font
- Require python-webob

* Wed Apr 03 2013 Luke Macken <lmacken@redhat.com> 0.0.1a2-1
- Initial package for Fedora