diff --git a/libarch-py2compat.patch b/libarch-py2compat.patch new file mode 100644 index 0000000..f8452ff --- /dev/null +++ b/libarch-py2compat.patch @@ -0,0 +1,13 @@ +Index: liblarch-3.0/liblarch/tree.py +=================================================================== +--- liblarch-3.0.orig/liblarch/tree.py ++++ liblarch-3.0/liblarch/tree.py +@@ -17,6 +17,8 @@ + # along with this program. If not, see . + # ----------------------------------------------------------------------------- + ++from __future__ import print_function ++ + from . import processqueue + from liblarch.treenode import _Node + diff --git a/python-liblarch.changes b/python-liblarch.changes index 232ad0d..1074db6 100644 --- a/python-liblarch.changes +++ b/python-liblarch.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 7 09:16:21 UTC 2018 - tchvatal@suse.com + +- Reflect deps properly on what is needed +- Add patch to work properly under py2: + * libarch-py2compat.patch + ------------------------------------------------------------------- Sat Jul 28 17:28:02 UTC 2018 - jengelh@inai.de diff --git a/python-liblarch.spec b/python-liblarch.spec index 17c49eb..e89dbb2 100644 --- a/python-liblarch.spec +++ b/python-liblarch.spec @@ -18,6 +18,7 @@ %define _name liblarch +%define _name_gtk liblarch_gtk %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-liblarch Version: 3.0 @@ -27,10 +28,15 @@ License: LGPL-3.0-or-later Group: Development/Languages/Python URL: https://live.gnome.org/liblarch Source: https://github.com/getting-things-gnome/%{_name}/archive/v%{version}.tar.gz +Patch0: libarch-py2compat.patch +BuildRequires: %{python_module gobject} BuildRequires: %{python_module nose} +BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-gobject2 +BuildRequires: xvfb-run +BuildRequires: typelib(Gtk) >= 3.0 +Requires: python-gobject BuildArch: noarch %python_subpackages @@ -40,12 +46,11 @@ are lists, trees and acyclic graphs (tree where nodes can have multiple parents) %package gtk -%define _name_gtk liblarch_gtk Summary: GTK bindings for liblarch Group: Development/Languages/Python Requires: %{name} = %{version} -Requires: python-gobject2 -Requires: python-gtk +Requires: python-gobject +Requires: typelib(Gtk) >= 3.0 %description gtk Liblarch is a Python library built to handle data structure such @@ -56,6 +61,7 @@ This package provides GTK bindings for liblarch. %prep %setup -q -n %{_name}-%{version} +%patch0 -p1 %build %python_build @@ -64,6 +70,10 @@ This package provides GTK bindings for liblarch. %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +# TESTS fail with segf, local execution works +#%check +#%%python_expand xvfb-run nosetests-%{$python_bin_suffix} tests + %files %{python_files} %license LICENSE %doc README.md AUTHORS