diff --git a/newt.changes b/newt.changes index 26a2826..1334a40 100644 --- a/newt.changes +++ b/newt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Sep 24 13:04:01 UTC 2017 - mc@suse.com + +- build python3 subpackage + ------------------------------------------------------------------- Mon Jul 3 15:24:29 UTC 2017 - lars@linux-schulserver.de diff --git a/newt.spec b/newt.spec index 211714a..08d2eab 100644 --- a/newt.spec +++ b/newt.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1320 +%bcond_without python3 +%else +%bcond_with python3 +%endif + %define libname lib%{name} %define libsoname %{libname}0_52 Name: newt @@ -46,6 +52,9 @@ BuildRequires: texlive-helvetic BuildRequires: texlive-jadetex BuildRequires: texlive-times %endif +%if %{with python3} +BuildRequires: python3-devel +%endif %description Newt is a programming library for color text-mode, widget-based user @@ -136,9 +145,21 @@ Obsoletes: %{name}-python < %{version} %py_requires %description -n python-%{name} -The newt-python package contains the Python bindings for the newt +The python-newt package contains the Python bindings for the newt library providing a python API for creating text mode interfaces. +%if %{with python3} +%package -n python3-%{name} +Summary: Python 3 bindings for newt +License: LGPL-2.1+ +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description -n python3-%{name} +The python3-newt package contains the Python 3 bindings for the newt library +providing a python API for creating text mode interfaces. +%endif + %prep %setup -q @@ -149,9 +170,14 @@ library providing a python API for creating text mode interfaces. ## make depend make CPPFLAGS="%{optflags} -fPIC" %{?_smp_mflags} all #docbook2txt tutorial.sgml +chmod 0644 peanuts.py popcorn.py %install -make PYTHONVERS="python%{py_ver}" instroot=%{buildroot} DESTDIR=%{buildroot} install install-sh +pyversions="python%{py_ver}" +%if %{with python3} +pyversions="$pyversions python%{py3_ver}" +%endif +make PYTHONVERS="$pyversions" instroot=%{buildroot} DESTDIR=%{buildroot} install install-sh # currently we don't support these languages for lang in ast bal sr@latin wo; do rm -rf %{buildroot}%{_datadir}/locale/$lang @@ -175,6 +201,15 @@ rm tutorial.{aux,log,out} CATALOG.* *.dsl popd 1>/dev/null %find_lang %{name} +%if 0%{?suse_version} +%py_compile %{buildroot}/%{python_sitearch} +%py_compile -O %{buildroot}/%{python_sitearch} +%if %{with python3} +%py3_compile %{buildroot}/%{python3_sitearch} +%py3_compile -O %{buildroot}/%{python3_sitearch} +%endif +%endif + %post -n %{libsoname} -p /sbin/ldconfig %postun -n %{libsoname} -p /sbin/ldconfig @@ -215,4 +250,12 @@ popd 1>/dev/null %doc %{_defaultdocdir}/%{name}/examples/*.py %{py_sitedir}/* +%if %{with python3} +%files -n python3-%{name} +%doc peanuts.py popcorn.py +%{python3_sitearch}/*.so +%{python3_sitearch}/*.py* +%{python3_sitearch}/__pycache__/*.py* +%endif + %changelog