[packages/python-texttable] up to 1.2.1; enable python3 package

glen glen at pld-linux.org
Tue Feb 27 18:07:31 CET 2018


commit 2c1587b973fc0f1fa2eea95ebcc657f936876370
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Feb 27 19:06:47 2018 +0200

    up to 1.2.1; enable python3 package

 python-texttable.spec      | 55 +++++++++++++++++++++++-----------------------
 remove-main-from-lib.patch | 37 -------------------------------
 2 files changed, 27 insertions(+), 65 deletions(-)
---
diff --git a/python-texttable.spec b/python-texttable.spec
index 928cf9f..efb4df1 100644
--- a/python-texttable.spec
+++ b/python-texttable.spec
@@ -1,24 +1,28 @@
 #
 # Conditional build:
 %bcond_without	python2 # CPython 2.x module
-# python3 not currently supported upstream
-%bcond_with	python3 # CPython 3.x module
+%bcond_without	python3 # CPython 3.x module
 
-%define 	module	texttable
+%define		module		texttable
+%define		egg_name	texttable
+%define		pypi_name	texttable
 Summary:	Python module to generate a formatted text table, using ASCII characters
-Name:		python-%{module}
-Version:	0.8.4
+Name:		python-%{pypi_name}
+Version:	1.2.1
 Release:	1
 License:	LGPL v2+
-Group:		Development/Libraries
-Source0:	https://pypi.python.org/packages/source/t/texttable/texttable-%{version}.tar.gz
-# Source0-md5:	6335edbe1bb4edacce7c2f76195f6212
-Patch0:		remove-main-from-lib.patch
+Group:		Libraries/Python
+Source0:	https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
+# Source0-md5:	7761da214368903c2409c13f1280cffe
 URL:		https://pypi.python.org/pypi/texttable/
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires:	python-modules
+BuildRequires:	python-setuptools
+%endif
 %if %{with python3}
-BuildRequires:	python-2to3
+BuildRequires:	python3-modules
 BuildRequires:	python3-setuptools
 %endif
 BuildArch:	noarch
@@ -30,21 +34,14 @@ characters
 
 %package -n python3-%{module}
 Summary:	Python module to generate a formatted text table, using ASCII characters
-Group:		Development/Languages
+Group:		Libraries/Python
 
 %description -n python3-%{module}
 Python module to generate a formatted text table, using ASCII
 characters
 
 %prep
-%setup -q -n %{module}-%{version}
-%patch0 -p1
-
-%if %{with python3}
-rm -rf py3
-cp -a . py3
-2to3 --write --nobackups py3
-%endif
+%setup -q -n %{pypi_name}-%{version}
 
 %build
 %if %{with python2}
@@ -52,7 +49,6 @@ cp -a . py3
 %endif
 
 %if %{with python3}
-cd py3
 %py3_build
 %endif
 
@@ -60,26 +56,29 @@ cd py3
 rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %py_install
+%py_postclean
 %endif
 
 %if %{with python3}
-cd py3
 %py3_install
 %endif
 
+%clean
+rm -rf $RPM_BUILD_ROOT
+
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc PKG-INFO
-%{py_sitescriptdir}/texttable*
+%doc README.md
+%{py_sitescriptdir}/%{module}.py[co]
+%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
 
 %if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
-%doc PKG-INFO
-%{py3_sitescriptdir}/texttable*
+%doc README.md
+%{py3_sitescriptdir}/%{module}.py
+%{py3_sitescriptdir}/__pycache__/%{module}.*.pyc
+%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
diff --git a/remove-main-from-lib.patch b/remove-main-from-lib.patch
deleted file mode 100644
index 386fee4..0000000
--- a/remove-main-from-lib.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- texttable-0.8.4/texttable.py~	2016-03-20 20:00:05.000000000 +0200
-+++ texttable-0.8.4/texttable.py	2016-03-20 20:00:31.668166988 +0200
-@@ -1,5 +1,3 @@
--#!/usr/bin/env python
--#
- # texttable - module for creating simple ASCII tables
- # Copyright (C) 2003-2011 Gerome Fournier <jef(at)foutaise.org>
- #
-@@ -578,28 +578,3 @@
-             else:
-                 cell.extend([""] * (max_cell_lines - len(cell)))
-         return line_wrapped
--
--
--if __name__ == '__main__':
--    table = Texttable()
--    table.set_cols_align(["l", "r", "c"])
--    table.set_cols_valign(["t", "m", "b"])
--    table.add_rows([["Name", "Age", "Nickname"],
--                    ["Mr\nXavier\nHuon", 32, "Xav'"],
--                    ["Mr\nBaptiste\nClement", 1, "Baby"]])
--    print(table.draw() + "\n")
--
--    table = Texttable()
--    table.set_deco(Texttable.HEADER)
--    table.set_cols_dtype(['t',  # text 
--                          'f',  # float (decimal)
--                          'e',  # float (exponent)
--                          'i',  # integer
--                          'a']) # automatic
--    table.set_cols_align(["l", "r", "r", "r", "l"])
--    table.add_rows([["text",    "float", "exp", "int", "auto"],
--                    ["abcd",    "67",    654,   89,    128.001],
--                    ["efghijk", 67.5434, .654,  89.6,  12800000000000000000000.00023],
--                    ["lmn",     5e-78,   5e-78, 89.4,  .000000000000128],
--                    ["opqrstu", .023,    5e+78, 92.,   12800000000000000000000]])
--    print(table.draw())
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-texttable.git/commitdiff/2c1587b973fc0f1fa2eea95ebcc657f936876370



More information about the pld-cvs-commit mailing list