[python-texttable] first import for Fedora

Adam Miller maxamillion at fedoraproject.org
Tue Aug 12 19:47:19 UTC 2014


commit b03e4f07735b9a43d022e2d9668072141b3efc94
Author: Adam Miller <admiller at redhat.com>
Date:   Tue Aug 12 14:47:17 2014 -0500

    first import for Fedora

 .gitignore                                 |    1 +
 python-texttable.spec                      |  100 ++++++++++++++++++++++++++++
 sources                                    |    1 +
 texttable-0.8.1-remove-main-from-lib.patch |   36 ++++++++++
 4 files changed, 138 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..27dcd7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/texttable-0.8.1.tar.gz
diff --git a/python-texttable.spec b/python-texttable.spec
new file mode 100644
index 0000000..5de483e
--- /dev/null
+++ b/python-texttable.spec
@@ -0,0 +1,100 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
+%{!?python_sitearch: %global python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+# python3 not currently supported upstream, leaving macros in preparation
+# for upstream support in the future.
+%global with_python3 0
+
+%global upstream_name texttable
+
+Name:           python-%{upstream_name}
+Version:        0.8.1
+Release:        4%{?dist}
+Summary:        Python module to generate a formatted text table, using ASCII characters
+
+Group:          Development/Libraries
+License:        LGPLv2+
+URL:            http://foutaise.org/code/
+Source0:        https://pypi.python.org/packages/source/t/texttable/texttable-0.8.1.tar.gz
+
+Patch0:         texttable-0.8.1-remove-main-from-lib.patch
+
+BuildRequires:  python-devel python-setuptools 
+
+BuildArch:      noarch
+
+%if 0%{?with_python3}
+BuildRequires: python3-devel python3-setuptools 
+# For /usr/bin/2to3
+BuildRequires: python-tools
+%endif # if with_python3
+
+
+%description
+Python module to generate a formatted text table, using ASCII characters
+
+%if 0%{?with_python3}
+%package -n python3-%{upstream_name}
+Summary:    Python module to generate a formatted text table, using ASCII characters
+Group:      Development/Languages
+
+%description -n python3-%{upstream_name}
+Python module to generate a formatted text table, using ASCII characters
+%endif #if with_python3
+
+%prep
+%setup -q -n %{upstream_name}-%{version}
+
+%patch0 -p0
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+2to3 --write --nobackups %{py3dir}
+%endif # with_python3
+
+%build
+CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
+popd
+%endif # with_python3
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+popd
+%endif # with_python3
+
+%files
+%doc PKG-INFO
+%{python2_sitelib}/texttable*
+
+%if 0%{?with_python3}
+%files -n python3-%{upstream_name}
+%doc PKG-INFO
+%{python3_sitelib}/texttable*
+%endif # with_python3
+
+%changelog
+* Tue Aug 12 2014 Adam Miller <maxamillion at fedoraproject.org> - 0.8.1-4
+- Patch to remove "__main__" and /usr/bin/env from non-executable library
+
+* Mon Aug 11 2014 Adam Miller <maxamillion at fedoraproject.org> - 0.8.1-3
+- Fix description for rpmlin errors, fix files listing
+
+* Fri Aug 08 2014 Adam Miller <maxamillion at fedoraproject.org> - 0.8.1-2
+- Fixed __python vs __python2 macros, BuildArch: noarch
+
+* Wed Jul 23 2014 Adam Miller <maxamillion at fedoraproject.org> - 0.8.1-1
+- Initial package for Fedora
diff --git a/sources b/sources
index e69de29..6218ff4 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+4fe37704f16ecf424b91e122defedd7e  texttable-0.8.1.tar.gz
diff --git a/texttable-0.8.1-remove-main-from-lib.patch b/texttable-0.8.1-remove-main-from-lib.patch
new file mode 100644
index 0000000..9b43908
--- /dev/null
+++ b/texttable-0.8.1-remove-main-from-lib.patch
@@ -0,0 +1,36 @@
+--- texttable.py.orig	2014-08-12 09:33:57.209300749 -0500
++++ texttable.py	2014-08-12 09:34:11.943615696 -0500
+@@ -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>
+ #
+@@ -565,27 +563,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()


More information about the scm-commits mailing list