diff --git a/.gitignore b/.gitignore index 376b084..86d7cd6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /prettytable-0.5.tar.gz /prettytable-0.6.tar.gz +/prettytable-0.6.1.tar.gz diff --git a/python-prettytable.spec b/python-prettytable.spec index a366216..8e3d7b6 100644 --- a/python-prettytable.spec +++ b/python-prettytable.spec @@ -1,19 +1,32 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -Name: python-prettytable -Version: 0.6 +%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%global with_python3 1 +%endif + +%global modname prettytable + + +Name: python-%{modname} +Version: 0.6.1 Release: 1%{?dist} Summary: Python library to display tabular data in tables Group: Development/Languages License: BSD -Source0: http://pypi.python.org/packages/source/P/PrettyTable/prettytable-0.6.tar.gz +Source0: http://pypi.python.org/packages/source/P/PrettyTable/%{modname}-%{version}.tar.gz URL: http://pypi.python.org/pypi/PrettyTable BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif + + %description PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. It was inspired by @@ -22,25 +35,80 @@ selection of which columns are to be printed, independent alignment of columns (left or right justified or centred) and printing of "sub-tables" by specifying a row range. +%if 0%{?with_python3} +%package -n python3-%{modname} +Summary: Python library to display tabular data in tables +Group: Development/Languages + +%description -n python3-%{modname} +PrettyTable is a simple Python library designed to make it quick and easy to +represent tabular data in visually appealing ASCII tables. It was inspired by +the ASCII tables used in the PostgreSQL shell psql. PrettyTable allows for +selection of which columns are to be printed, independent alignment of columns +(left or right justified or centred) and printing of "sub-tables" by specifying +a row range. +%endif + + %prep -%setup -q -n prettytable-%{version} +%setup -q -n %{modname}-%{version} + +%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 + +%check +%{__python} %{modname}_test.py + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} %{modname}_test.py +popd +%endif + %install -rm -rf $RPM_BUILD_ROOT +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd +%endif + %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %files -%{python_sitelib}/* +%doc README COPYING CHANGELOG +%{python_sitelib}/%{modname}.py* +%{python_sitelib}/%{modname}-%{version}* + +%if 0%{?with_python3} +%files -n python3-%{modname} +%doc README COPYING CHANGELOG +%{python3_sitelib}/%{modname}.py* +%{python3_sitelib}/__pycache__/%{modname}* +%{python3_sitelib}/%{modname}-%{version}* +%endif %changelog -* Tue Aug 7 2012 Pádraig Brady
- 0.6-1
+* Tue Aug 07 2012 Ralph Bean - 0.6-1
- Update to 0.6
* Sat Jul 21 2012 Fedora Release Engineering