SPECS/python-prettytable/python-prettytable.spec
30b63cfb
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 
f4d17450
 Name:           python-prettytable
 Version:        0.7.2
30b63cfb
 Release:        4%{?dist}
f4d17450
 Summary:        Library for displaying tabular data in a visually appealing ASCII format
 License:        BSD-2-Clause
 Group:          Development/Languages/Python
 Url:            http://code.google.com/p/prettytable/
 Source0:        prettytable-%{version}.tar.gz
3cc43c92
 %define sha1 prettytable=b7d0bf0feee0d23108a044ffae44aff5c5935250
f4d17450
 
30b63cfb
 BuildRequires:  python2
 BuildRequires:  python2-libs
 BuildRequires:  python-setuptools
f4d17450
 
30b63cfb
 Requires:       python2
 Requires:       python2-libs
f4d17450
 
 BuildArch:      noarch
 
 %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
 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.
 
30b63cfb
 
 %package -n     python3-prettytable
 Summary:        python-prettytable
 
 BuildRequires:  python3
 BuildRequires:  python3-devel
 BuildRequires:  python3-libs
 
 Requires:       python3
 Requires:       python3-libs
 
 %description -n python3-prettytable
 Python 3 version.
 
f4d17450
 %prep
 %setup -n prettytable-%{version}
30b63cfb
 rm -rf ../p3dir
 cp -a . ../p3dir
f4d17450
 
 %build
30b63cfb
 python2 setup.py build
 pushd ../p3dir
 python3 setup.py build
 popd
f4d17450
 
 %install
30b63cfb
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 pushd ../p3dir
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 popd
f4d17450
 
d5255775
 %check
30b63cfb
 python2 prettytable_test.py
 pushd ../p3dir
 python3 prettytable_test.py
 popd
d5255775
 
f4d17450
 %files
30b63cfb
 %defattr(-,root,root)
 %{python2_sitelib}/*
 
 %files -n python3-prettytable
f4d17450
 %defattr(-,root,root,-)
30b63cfb
 %{python3_sitelib}/*
 
f4d17450
 
 %changelog
30b63cfb
 *   Tue May 16 2017 Kumar Kaushik <kaushikk@vmware.com> 0.7.2-4
 -   Adding python3 support.
 *   Mon Oct 04 2016 ChangLee <changlee@vmware.com> 0.7.2-3
 -   Modified %check
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.7.2-2
 -   GA - Bump release of all rpms
 *   Wed Mar 04 2015 Mahmoud Bassiouny <mbassiouny@vmware.com>
 -   Initial packaging for Photon