aa03494
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
aa03494
%global with_python3 1
aa03494
%endif
aa03494
aa03494
# Setting with_python3 manually to false until python3-prettytable becomes
aa03494
# available.  https://bugzilla.redhat.com/show_bug.cgi?id=837087
aa03494
%global with_python3 0
aa03494
aa03494
aa03494
%global modname cliff
aa03494
aa03494
Name:             python-cliff
aa03494
Version:          1.0
aa03494
Release:          2%{?dist}
aa03494
Summary:          Command Line Interface Formulation Framework
aa03494
aa03494
Group:            Development/Libraries
aa03494
License:          ASL 2.0
aa03494
URL:              http://pypi.python.org/pypi/cliff
aa03494
Source0:          http://pypi.python.org/packages/source/c/cliff/cliff-%{version}.tar.gz
aa03494
aa03494
BuildArch:        noarch
aa03494
aa03494
BuildRequires:    python2-devel
aa03494
BuildRequires:    python-setuptools
aa03494
BuildRequires:    python-prettytable
aa03494
BuildRequires:    python-cmd2
aa03494
BuildRequires:    python-tablib
aa03494
Requires:         python-setuptools
aa03494
Requires:         python-prettytable
aa03494
Requires:         python-cmd2
aa03494
Requires:         python-tablib
aa03494
aa03494
aa03494
%if 0%{?with_python3}
aa03494
BuildRequires:    python3-devel
aa03494
BuildRequires:    python3-setuptools
aa03494
BuildRequires:    python3-prettytable
aa03494
BuildRequires:    python3-cmd2
aa03494
BuildRequires:    python3-tablib
aa03494
Requires:         python3-setuptools
aa03494
Requires:         python3-prettytable
aa03494
Requires:         python3-cmd2
aa03494
Requires:         python3-tablib
aa03494
%endif
aa03494
aa03494
%description
aa03494
cliff is a framework for building command line programs. It uses setuptools
aa03494
entry points to provide subcommands, output formatters, and other
aa03494
extensions.
aa03494
aa03494
Documentation for cliff is hosted on readthedocs.org at
aa03494
http://readthedocs.org/docs/cliff/en/latest/
aa03494
aa03494
%if 0%{?with_python3}
aa03494
%package -n python3-cliff
aa03494
Summary:        Command Line Interface Formulation Framework
aa03494
Group:          Development/Libraries
aa03494
aa03494
%description -n python3-cliff
aa03494
cliff is a framework for building command line programs. It uses setuptools
aa03494
entry points to provide subcommands, output formatters, and other
aa03494
extensions.
aa03494
aa03494
Documentation for cliff is hosted on readthedocs.org at
aa03494
http://readthedocs.org/docs/cliff/en/latest/
aa03494
%endif
aa03494
aa03494
%prep
aa03494
%setup -q -n %{modname}-%{version}
aa03494
aa03494
%if 0%{?with_python3}
aa03494
rm -rf %{py3dir}
aa03494
cp -a . %{py3dir}
aa03494
%endif
aa03494
aa03494
aa03494
%build
aa03494
%{__python} setup.py build
aa03494
aa03494
%if 0%{?with_python3}
aa03494
pushd %{py3dir}
aa03494
%{__python3} setup.py build
aa03494
popd
aa03494
%endif
aa03494
aa03494
aa03494
aa03494
%install
aa03494
%if 0%{?with_python3}
aa03494
pushd %{py3dir}
aa03494
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
aa03494
popd
aa03494
%endif
aa03494
aa03494
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
aa03494
aa03494
%check
aa03494
%{__python} setup.py test
aa03494
aa03494
%if 0%{?with_python3}
aa03494
pushd %{py3dir}
aa03494
%{__python3} setup.py test
aa03494
popd
aa03494
%endif
aa03494
aa03494
aa03494
%files
aa03494
%doc docs/
aa03494
%{python_sitelib}/%{modname}
aa03494
%{python_sitelib}/%{modname}-%{version}*
aa03494
aa03494
%if 0%{?with_python3}
aa03494
%files -n python3-%{modname}
aa03494
%doc docs/
aa03494
%{python3_sitelib}/%{modname}
aa03494
%{python3_sitelib}/%{modname}-%{version}-*
aa03494
aa03494
%endif
aa03494
aa03494
aa03494
%changelog
aa03494
* Thu Jul 05 2012 Ralph Bean <rbean@redhat.com> - 1.0-2
aa03494
- Manually disable python3 support until python3-prettytable is available.
aa03494
aa03494
* Thu Jun 28 2012 Ralph Bean <rbean@redhat.com> - 1.0-1
aa03494
- initial package for Fedora