From 9d94ae88dcd1ced63bbe217639bf3dd6fdb5d77b Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 2 Jul 2012 13:44:28 -0400 Subject: [PATCH] New version 0.6.1 and python3 support. - New upstream version - Employing macros for modname and version to simplify future edits - Added support for python3 - Added %%check section - Removed unnecessary reference to RPM_BUILD_ROOT - Increased specificity of %%files section - Included README, COPYING, and CHANGELOG in docs --- .gitignore | 1 + python-prettytable.spec | 82 +++++++++++++++++++++++++++++++++++++---- sources | 2 +- 3 files changed, 77 insertions(+), 8 deletions(-) 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-1 +- New upstream version +- Added support for python3 +- Included README, COPYING, and CHANGELOG in docs + +* Tue Aug 07 2012 Pádraig Brady - 0.6-1 - Update to 0.6 * Sat Jul 21 2012 Fedora Release Engineering - 0.5-4 diff --git a/sources b/sources index ffd184c..69bb17f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0d3963ae68aaa929d1d12572b4a2200c prettytable-0.6.tar.gz +8f97da999f52e47e28ec4ffe7f25c4d8 prettytable-0.6.1.tar.gz