[newt] build python3 subpackage (#963839)

Miroslav Lichvar mlichvar at fedoraproject.org
Thu Oct 17 15:54:14 UTC 2013


commit fa31b7e714004b2564e0aa144dbd3c9ecc42a3c6
Author: Miro HronĨok <mhroncok at redhat.com>
Date:   Thu Oct 17 16:50:45 2013 +0200

    build python3 subpackage (#963839)

 newt.spec |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/newt.spec b/newt.spec
index 62c6637..4f09d46 100644
--- a/newt.spec
+++ b/newt.spec
@@ -1,4 +1,9 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%endif
+
 Summary: A library for text mode user interfaces
 Name: newt
 Version: 0.52.16
@@ -9,6 +14,9 @@ URL: https://fedorahosted.org/newt/
 Source: https://fedorahosted.org/released/newt/newt-%{version}.tar.gz
 BuildRequires: popt-devel python-devel slang-devel
 BuildRequires: docbook-utils
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+%endif
 Provides: snack = %{version}-%{release}
 
 Patch1: newt-python3.patch
@@ -50,13 +58,24 @@ The newt-static package contains the static version of the newt library.
 Install it if you need to link statically with libnewt.
 
 %package python
-Summary: Python bindings for newt
+Summary: Python 2 bindings for newt
 Group: Development/Libraries
 Requires: %{name}%{?_isa} = %{version}-%{release}
 
 %description python
-The newt-python package contains the Python bindings for the newt library
+The newt-python package contains the Python 2 bindings for the newt library
+providing a python API for creating text mode ionterfaces.
+
+%if 0%{?with_python3}
+%package python3
+Summary: Python 3 bindings for newt
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description python3
+The newt-python3 package contains the Python 3 bindings for the newt library
 providing a python API for creating text mode ionterfaces. 
+%endif
 
 %prep
 %setup -q
@@ -101,6 +120,14 @@ make DESTDIR=$RPM_BUILD_ROOT install
 %{python_sitearch}/*.so
 %{python_sitearch}/*.py*
 
+%if 0%{?with_python3}
+%files python3
+%doc peanuts.py popcorn.py
+%{python3_sitearch}/*.so
+%{python3_sitearch}/*.py*
+%{python3_sitearch}/__pycache__/*.py*
+%endif
+
 %changelog
 * Tue Aug 06 2013 Miroslav Lichvar <mlichvar at redhat.com> - 0.52.16-1
 - add newtComponentGetSize and newtComponentGetPosition (#987596)


More information about the scm-commits mailing list