[packages/python-texttable] new, version 0.8.4
glen
glen at pld-linux.org
Sun Mar 20 19:02:30 CET 2016
commit 4e4d485486de41fb51aa3421ff31055cd6b4f1a6
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Mar 20 20:01:53 2016 +0200
new, version 0.8.4
based on fedora package, 5c1a3f9
python-texttable.spec | 85 ++++++++++++++++++++++++++++++++++++++++++++++
remove-main-from-lib.patch | 37 ++++++++++++++++++++
2 files changed, 122 insertions(+)
---
diff --git a/python-texttable.spec b/python-texttable.spec
new file mode 100644
index 0000000..928cf9f
--- /dev/null
+++ b/python-texttable.spec
@@ -0,0 +1,85 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+# python3 not currently supported upstream
+%bcond_with python3 # CPython 3.x module
+
+%define module texttable
+Summary: Python module to generate a formatted text table, using ASCII characters
+Name: python-%{module}
+Version: 0.8.4
+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
+URL: https://pypi.python.org/pypi/texttable/
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python3}
+BuildRequires: python-2to3
+BuildRequires: python3-setuptools
+%endif
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Python module to generate a formatted text table, using ASCII
+characters
+
+%package -n python3-%{module}
+Summary: Python module to generate a formatted text table, using ASCII characters
+Group: Development/Languages
+
+%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
+
+%build
+%if %{with python2}
+%py_build
+%endif
+
+%if %{with python3}
+cd py3
+%py3_build
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
+%py_install
+%endif
+
+%if %{with python3}
+cd py3
+%py3_install
+%endif
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc PKG-INFO
+%{py_sitescriptdir}/texttable*
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc PKG-INFO
+%{py3_sitescriptdir}/texttable*
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
diff --git a/remove-main-from-lib.patch b/remove-main-from-lib.patch
new file mode 100644
index 0000000..386fee4
--- /dev/null
+++ b/remove-main-from-lib.patch
@@ -0,0 +1,37 @@
+--- 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/4e4d485486de41fb51aa3421ff31055cd6b4f1a6
More information about the pld-cvs-commit
mailing list