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

%global modname gearbox
%global prerelease a

Name:               python-gearbox
Version:            0.0.1
Release:            0.1.%{prerelease}%{?dist}
Summary:            Command line toolkit born as a PasteScript replacement for TurboGears2

Group:              Development/Libraries
License:            MIT
URL:                http://pypi.python.org/pypi/gearbox
Source0:            http://pypi.python.org/packages/source/g/%{modname}/%{modname}-%{version}%{prerelease}.tar.gz

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-setuptools

Requires:           python-prettytable
Requires:           python-cliff
Requires:           python-tempita
Requires:           python-paste-deploy

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

Requires:           python3-prettytable
Requires:           python3-cliff
Requires:           python3-tempita
Requires:           python3-paste-deploy

%endif

%description
gearbox is a paster command replacement for TurboGears2. It has been
created during the process of providing Python3 support to the TurboGears2
web framework, while still being backward compatible with the existing
TurboGears projects.


%if 0%{?with_python3}
%package -n python3-gearbox
Summary:            Command line toolkit born as a PasteScript replacement for TurboGears2
Group:              Development/Libraries

%description -n python3-gearbox
gearbox is a paster command replacement for TurboGears2. It has been
created during the process of providing Python3 support to the TurboGears2
web framework, while still being backward compatible with the existing
TurboGears projects.
%endif


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

# 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}


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

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

%changelog
* Wed Apr 03 2013 Luke Macken <lmacken@redhat.com> 0.0.1-0.1.a
- Initial package for Fedora