diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/python-xcffib-ffi-import.patch b/python-xcffib-ffi-import.patch
new file mode 100644
index 0000000..d6d6230
--- /dev/null
+++ b/python-xcffib-ffi-import.patch
@@ -0,0 +1,23 @@
+Index: xcffib-1.2.0/test/test_python_code.py
+===================================================================
+--- xcffib-1.2.0.orig/test/test_python_code.py
++++ xcffib-1.2.0/test/test_python_code.py
+@@ -19,7 +19,6 @@ import xcffib.xinput
+ import os
+ import struct
+ import sys
+-from xcffib._ffi import ffi
+ from xcffib.xproto import EventMask
+
+ from .conftest import XcffibTest
+@@ -176,8 +175,8 @@ class TestPythonCode:
+ )
+
+ # Create cdata from the bytearray and cast it to a generic reply
+- cdata = ffi.new("char x[72]", B_HIT_EVENT)
+- generic_reply = ffi.cast("xcb_generic_reply_t *", cdata)
++ cdata = xcffib.ffi.new("char x[72]", B_HIT_EVENT)
++ generic_reply = xcffib.ffi.cast("xcb_generic_reply_t *", cdata)
+
+ # Pass the reply to our hoist_event method
+ event = xcffib_test.conn.hoist_event(generic_reply)
diff --git a/python-xcffib-six-leftover.patch b/python-xcffib-six-leftover.patch
new file mode 100644
index 0000000..675cb5a
--- /dev/null
+++ b/python-xcffib-six-leftover.patch
@@ -0,0 +1,13 @@
+diff --git a/test/test_python_code.py b/test/test_python_code.py
+index f8568b4..5aa67ff 100644
+--- a/test/test_python_code.py
++++ b/test/test_python_code.py
+@@ -17,7 +17,6 @@
+ import xcffib.xproto
+ import xcffib.xinput
+ import os
+-import six
+ import struct
+ import sys
+ from xcffib._ffi import ffi
+
diff --git a/python-xcffib.changes b/python-xcffib.changes
index 7e905d5..4f487e3 100644
--- a/python-xcffib.changes
+++ b/python-xcffib.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Thu Mar 23 09:19:27 UTC 2023 - pgajdos@suse.com
+
+- version update to 1.2.0
+ * no upstream changelog found
+- do not require six
+- added patches
+ fix https://github.com/tych0/xcffib/commit/8a488867d30464913706376ca3a9f4c98ca6c5cf
+ + python-xcffib-six-leftover.patch
+ fix ffi import [bsc#1209570c4]
+ + python-xcffib-ffi-import.patch
+
-------------------------------------------------------------------
Tue Sep 27 16:04:01 UTC 2022 - Markéta Machová
diff --git a/python-xcffib.spec b/python-xcffib.spec
index abe23c4..e905ab4 100644
--- a/python-xcffib.spec
+++ b/python-xcffib.spec
@@ -1,7 +1,7 @@
#
-# spec file for package python-xcffib
+# spec file
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,27 +16,39 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define skip_python2 1
-Name: python-xcffib
-Version: 0.12.1
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+
+Name: python-xcffib%{?psuffix}
+Version: 1.2.0
Release: 0
Summary: A drop in replacement for xpyb, an XCB python binding
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/tych0/xcffib
Source: https://files.pythonhosted.org/packages/source/x/xcffib/xcffib-%{version}.tar.gz
+# https://github.com/tych0/xcffib/commit/8a488867d30464913706376ca3a9f4c98ca6c5cf
+Patch0: python-xcffib-six-leftover.patch
+# fix ffi import [bsc#1209570c4]
+Patch1: python-xcffib-ffi-import.patch
BuildRequires: %{python_module cffi >= 1.1.0}
-BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
-BuildRequires: %{python_module six}
+%if %{with test}
+BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module xcffib}
+%endif
BuildRequires: fdupes
BuildRequires: libxcb-devel
BuildRequires: python-rpm-macros
BuildRequires: xeyes
BuildRequires: xvfb-run
Requires: python-cffi >= 1.1.0
-Requires: python-six
BuildArch: noarch
%python_subpackages
@@ -45,22 +57,30 @@ The xcffib package is intended to be a (mostly) drop-in
replacement for xpyb.
%prep
-%setup -q -n xcffib-%{version}
+%autosetup -p1 -n xcffib-%{version}
%build
+%if !%{with test}
%python_build
+%endif
%install
+%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} xvfb-run pytest-%{$python_bin_suffix} -v
+%if %{with test}
+%pytest
+%endif
+%if !%{with test}
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/xcffib/
%{python_sitelib}/xcffib-%{version}-py*.egg-info
+%endif
%changelog
diff --git a/xcffib-0.12.1.tar.gz b/xcffib-0.12.1.tar.gz
deleted file mode 100644
index f9ff92c..0000000
--- a/xcffib-0.12.1.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:82fc55d7530d05d25506e77891ddbae2727ff30aca32b9c98845030ea379f17f
-size 85272
diff --git a/xcffib-1.2.0.tar.gz b/xcffib-1.2.0.tar.gz
new file mode 100644
index 0000000..6e6084a
--- /dev/null
+++ b/xcffib-1.2.0.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f323021447f9e73078d21bb928c48f4dabeaeb3f3b37e803c6d6b98735e81483
+size 88972