From 2d003f73bb3f27154f0d82d94e5f27ef97bb85d71e75a7f0e25f84b984b7118b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 9 Jan 2018 13:46:12 +0000 Subject: [PATCH] Accepting request 561694 from openSUSE:Factory:Staging:O - Build without py2 if needed - Fix upstream url OBS-URL: https://build.opensuse.org/request/show/561694 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/newt?expand=0&rev=43 --- newt.changes | 6 ++++++ newt.spec | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/newt.changes b/newt.changes index 581e28b..3a7d8f9 100644 --- a/newt.changes +++ b/newt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 3 14:38:04 UTC 2018 - tchvatal@suse.com + +- Build without py2 if needed +- Fix upstream url + ------------------------------------------------------------------- Wed Nov 8 16:43:04 UTC 2017 - mpluskal@suse.com diff --git a/newt.spec b/newt.spec index 57fd7a4..8ccf844 100644 --- a/newt.spec +++ b/newt.spec @@ -1,7 +1,7 @@ # # spec file for package newt # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,14 @@ %define libname lib%{name} %define libsoname %{libname}0_52 +%bcond_without python2 Name: newt Version: 0.52.20 Release: 0 Summary: A library for text mode user interfaces License: LGPL-2.1+ Group: Development/Libraries/C and C++ -Url: https://fedorahosted.org/newt/ +Url: https://pagure.io/newt Source: https://fedorahosted.org/releases/n/e/newt/%{name}-%{version}.tar.gz Source2: baselibs.conf Source10: %{name}-rpmlintrc @@ -40,9 +41,7 @@ BuildRequires: texlive-ec BuildRequires: texlive-helvetic BuildRequires: texlive-jadetex BuildRequires: texlive-times -%if 0%{?suse_version} > 1320 -BuildRequires: python2-devel -%else +%if %{with python2} BuildRequires: python-devel %endif @@ -75,7 +74,7 @@ License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %{libsoname} = %{version} Requires: popt-devel -Requires: python-devel +Requires: python3-devel Requires: slang-devel Recommends: %{name} = %{version} @@ -132,7 +131,6 @@ Provides: python-%{name} = %{version} Obsoletes: python-%{name} < %{version} Provides: %{name}-python = %{version} Obsoletes: %{name}-python < %{version} -%py_requires %description -n python2-%{name} The python-newt package contains the Python bindings for the newt @@ -161,7 +159,11 @@ make CPPFLAGS="%{optflags} -fPIC" %{?_smp_mflags} all chmod 0644 peanuts.py popcorn.py %install +%if %{with python2} pyversions="python%{py_ver}" +%else +pyversions="" +%endif pyversions="$pyversions python%{py3_ver}" make PYTHONVERS="$pyversions" instroot=%{buildroot} DESTDIR=%{buildroot} install install-sh # currently we don't support these languages @@ -187,10 +189,14 @@ rm tutorial.{aux,log,out} CATALOG.* *.dsl popd 1>/dev/null %find_lang %{name} +%if %{with python2} %py_compile %{buildroot}/%{python_sitearch} %py_compile -O %{buildroot}/%{python_sitearch} +%endif %py3_compile %{buildroot}/%{python3_sitearch} %py3_compile -O %{buildroot}/%{python3_sitearch} +# pointless examples +rm %{buildroot}%{_defaultdocdir}/%{name}/examples/*.py %post -n %{libsoname} -p /sbin/ldconfig %postun -n %{libsoname} -p /sbin/ldconfig @@ -200,11 +206,6 @@ popd 1>/dev/null %doc %{_defaultdocdir}/%{name}/COPYING %{_bindir}/whiptail %{_mandir}/man1/whiptail.1* -%if 0%{?suse_version} <= 1020 -%dir %{_datadir}/locale/as -%dir %{_datadir}/locale/as/LC_MESSAGES -%{_datadir}/locale/as/LC_MESSAGES/* -%endif %files -n %{libsoname} %{_libdir}/%{libname}.so.* @@ -220,13 +221,12 @@ popd 1>/dev/null %files static %{_libdir}/%{libname}.a +%if %{with python2} %files -n python2-%{name} -%dir %{_defaultdocdir}/%{name}/examples -%doc %{_defaultdocdir}/%{name}/examples/*.py -%{py_sitedir}/* +%{python2_sitearch}/* +%endif %files -n python3-%{name} -%doc peanuts.py popcorn.py %{python3_sitearch}/*.so %{python3_sitearch}/*.py* %{python3_sitearch}/__pycache__/*.py*