Chris Lalancette 89eb77f
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Chris Lalancette 89eb77f
7afe4f5
%if 0%{?fedora} > 12 || 0%{?rhel} > 7
9d94ae8
%global with_python3 1
9d94ae8
%endif
9d94ae8
9d94ae8
%global modname prettytable
9d94ae8
9d94ae8
9d94ae8
Name:		python-%{modname}
ca85a8a
Version:	0.7.2
ca85a8a
Release:	1%{?dist}
Chris Lalancette 89eb77f
Summary:	Python library to display tabular data in tables
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
Group:		Development/Languages
Chris Lalancette 89eb77f
License:	BSD
9d94ae8
Source0:    http://pypi.python.org/packages/source/P/PrettyTable/%{modname}-%{version}.tar.gz
Chris Lalancette 89eb77f
URL:		http://pypi.python.org/pypi/PrettyTable
Chris Lalancette 89eb77f
ca85a8a
Patch0:         disable-encoding-check.patch
ca85a8a
Chris Lalancette 89eb77f
BuildArch:	noarch
Chris Lalancette 89eb77f
BuildRequires:	python-devel
Chris Lalancette 49506fa
BuildRequires:  python-setuptools
Chris Lalancette 89eb77f
9d94ae8
%if 0%{?with_python3}
9d94ae8
BuildRequires:  python3-devel
9d94ae8
BuildRequires:  python3-setuptools
9d94ae8
%endif
9d94ae8
9d94ae8
Chris Lalancette 89eb77f
%description
Chris Lalancette 89eb77f
PrettyTable is a simple Python library designed to make it quick and easy to
Chris Lalancette 89eb77f
represent tabular data in visually appealing ASCII tables. It was inspired by
Chris Lalancette 89eb77f
the ASCII tables used in the PostgreSQL shell psql. PrettyTable allows for
Chris Lalancette 89eb77f
selection of which columns are to be printed, independent alignment of columns
Chris Lalancette 89eb77f
(left or right justified or centred) and printing of "sub-tables" by specifying
Chris Lalancette 89eb77f
a row range.
Chris Lalancette 89eb77f
9d94ae8
%if 0%{?with_python3}
9d94ae8
%package -n python3-%{modname}
9d94ae8
Summary:	Python library to display tabular data in tables
9d94ae8
Group:		Development/Languages
9d94ae8
9d94ae8
%description -n python3-%{modname}
9d94ae8
PrettyTable is a simple Python library designed to make it quick and easy to
9d94ae8
represent tabular data in visually appealing ASCII tables. It was inspired by
9d94ae8
the ASCII tables used in the PostgreSQL shell psql. PrettyTable allows for
9d94ae8
selection of which columns are to be printed, independent alignment of columns
9d94ae8
(left or right justified or centred) and printing of "sub-tables" by specifying
9d94ae8
a row range.
9d94ae8
%endif
9d94ae8
9d94ae8
Chris Lalancette 89eb77f
%prep
9d94ae8
%setup -q -n %{modname}-%{version}
9d94ae8
ca85a8a
%patch0 -p1
ca85a8a
9d94ae8
%if 0%{?with_python3}
9d94ae8
rm -rf %{py3dir}
9d94ae8
cp -a . %{py3dir}
9d94ae8
%endif
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
%build
Chris Lalancette 89eb77f
%{__python} setup.py build
Chris Lalancette 89eb77f
9d94ae8
%if 0%{?with_python3}
9d94ae8
pushd %{py3dir}
9d94ae8
%{__python3} setup.py build
9d94ae8
popd
9d94ae8
%endif
9d94ae8
9d94ae8
%check
9d94ae8
%{__python} %{modname}_test.py
9d94ae8
9d94ae8
%if 0%{?with_python3}
9d94ae8
pushd %{py3dir}
9d94ae8
%{__python3} %{modname}_test.py
9d94ae8
popd
9d94ae8
%endif
9d94ae8
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
%install
9d94ae8
%if 0%{?with_python3}
9d94ae8
pushd %{py3dir}
9d94ae8
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
9d94ae8
popd
9d94ae8
%endif
9d94ae8
Chris Lalancette 89eb77f
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
%files
9d94ae8
%doc README COPYING CHANGELOG
9d94ae8
%{python_sitelib}/%{modname}.py*
9d94ae8
%{python_sitelib}/%{modname}-%{version}*
9d94ae8
9d94ae8
%if 0%{?with_python3}
9d94ae8
%files -n python3-%{modname}
9d94ae8
%doc README COPYING CHANGELOG
9d94ae8
%{python3_sitelib}/%{modname}.py*
9d94ae8
%{python3_sitelib}/__pycache__/%{modname}*
9d94ae8
%{python3_sitelib}/%{modname}-%{version}*
9d94ae8
%endif
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
Chris Lalancette 89eb77f
%changelog
ca85a8a
* Tue Jan 07 2014 Pádraig Brady <pbrady@redhat.com> - 0.7.2-1
ca85a8a
- Latest upstream
ca85a8a
0b5f34b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
0b5f34b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
0b5f34b
22bad32
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-2
22bad32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
22bad32
9d94ae8
* Tue Aug 07 2012 Ralph Bean <rbean@redhat.com> - 0.6.1-1
9d94ae8
- New upstream version
9d94ae8
- Added support for python3
9d94ae8
- Included README, COPYING, and CHANGELOG in docs
9d94ae8
9d94ae8
* Tue Aug 07 2012 Pádraig Brady <P@draigBrady.com> - 0.6-1
7e95481
- Update to 0.6
7e95481
126c8b4
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
126c8b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
126c8b4
c82355e
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
c82355e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
c82355e
Chris Lalancette 49506fa
* Tue Jul 05 2011 Chris Lalancette <clalance@redhat.com> - 0.5-2
Chris Lalancette 49506fa
- BuildRequire python-setuptools
Chris Lalancette 49506fa
Chris Lalancette 89eb77f
* Wed Jun 29 2011 Chris Lalancette <clalance@redhat.com> - 0.5-1
Chris Lalancette 89eb77f
- Initial package.