From a184030d90486ebb48a68dc529a832dac27f1772 Mon Sep 17 00:00:00 2001
From: anag+factory <>
Date: Feb 06 2025 20:29:18 +0000
Subject: Update python-gphoto2 to version 2.5.1 / rev 11 via SR 1238988


https://build.opensuse.org/request/show/1238988
by user anag+factory

---

diff --git a/.files b/.files
index ed5d55e..fe7e2ea 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index 137964a..d809ccc 100644
--- a/.rev
+++ b/.rev
@@ -79,4 +79,12 @@
     <comment></comment>
     <requestid>1069731</requestid>
   </revision>
+  <revision rev="11" vrev="1">
+    <srcmd5>36d1cc43e74f9dca7afccbbc978f9c53</srcmd5>
+    <version>2.5.1</version>
+    <time>1737389712</time>
+    <user>anag+factory</user>
+    <comment></comment>
+    <requestid>1238988</requestid>
+  </revision>
 </revisionlist>
diff --git a/gphoto2-2.2.4.tar.gz b/gphoto2-2.2.4.tar.gz
deleted file mode 120000
index d64cb56..0000000
--- a/gphoto2-2.2.4.tar.gz
+++ /dev/null
@@ -1 +0,0 @@
-/ipfs/bafybeibmsl5azl5fabdlxtuy4mpjkcy5g4x2kjc37vekkhnaizz2wwnusu
\ No newline at end of file
diff --git a/gphoto2-2.5.1.tar.gz b/gphoto2-2.5.1.tar.gz
new file mode 120000
index 0000000..f032feb
--- /dev/null
+++ b/gphoto2-2.5.1.tar.gz
@@ -0,0 +1 @@
+/ipfs/bafybeifink65repsozsslpdcqvjuin63dbnamyerjy55rppn7276ccjubq
\ No newline at end of file
diff --git a/python-gphoto2-do_not_install_data.patch b/python-gphoto2-do_not_install_data.patch
index df63d86..b653142 100644
--- a/python-gphoto2-do_not_install_data.patch
+++ b/python-gphoto2-do_not_install_data.patch
@@ -1,14 +1,17 @@
-Index: gphoto2-1.7.0/setup.py
+Index: gphoto2-2.5.1/setup.py
 ===================================================================
---- gphoto2-1.7.0.orig/setup.py
-+++ gphoto2-1.7.0/setup.py
-@@ -308,9 +308,4 @@ setup(name = 'gphoto2',
-       ext_modules = ext_modules,
-       packages = ['gphoto2'],
-       package_dir = {'gphoto2' : mod_src_dir},
--      data_files = [
--          ('share/python-gphoto2/examples', examples),
--          ('share/python-gphoto2', [
--              'CHANGELOG.txt', 'LICENSE.txt', 'README.rst']),
--          ],
-       )
+--- gphoto2-2.5.1.orig/setup.py
++++ gphoto2-2.5.1/setup.py
+@@ -25,9 +25,9 @@ import os
+ import subprocess
+ import sys
+ 
+-packages = ['gphoto2', 'gphoto2.examples']
+-package_dir = {'gphoto2.examples': 'examples'}
+-package_data = {'gphoto2.examples': ['*']}
++packages = ['gphoto2']
++package_dir = {}
++package_data = {}
+ exclude_package_data = {'': ['*.c']}
+ extra_link_args = []
+ 
diff --git a/python-gphoto2.changes b/python-gphoto2.changes
index 83a1693..191ee55 100644
--- a/python-gphoto2.changes
+++ b/python-gphoto2.changes
@@ -1,4 +1,38 @@
 -------------------------------------------------------------------
+Mon Jan 13 01:59:41 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
+
+- Update to 2.5.1:
+  * Add '__version_tuple__' for easy runtime version checking.
+  * API change: gp_log_add_func callback is passed str instead of bytes
+  * Add some GPPort methods. This allows a port to be reset when an error
+    occurs.
+  * Pass CameraFile to gp_camera_capture_preview & gp_camera_file_get.
+    Optional - one will be created if needed.
+  * Remove Context::camera_autodetect method deprecated 3 years ago.
+  * Rename Context, PortInfo & PortInfoList. Add aliases of old names.
+  * Update libgphoto2 to v2.5.31.
+  * API change! gp_file_open no longer creates CameraFile object. It is now
+    consistent with the C API.
+  * Deprecated functions: gp_abilities_list_append, gp_list_populate,
+    gp_port_info_list_append, gp_widget_add_choice, gp_widget_set_info,
+    gp_widget_set_name, gp_widget_set_range, gp_widget_set_readonly.
+    These will be removed in a future release.
+  * Change licence from GPLv3+ to LGPLv3+.
+  * CameraList behaves like a cross between Python list and dict types.
+  * Added unit tests to check most libgphoto2 functions.
+  * Add Python 3.11 binary wheels.
+  * Drop support for libgphoto2 before version v2.5.10
+  * Clearer installation documentation.
+  * Modernised Python package build system.
+  * Update libgphoto2 to v2.5.30.
+  * Include localisation files in Python package.
+- Rebase python-gphoto2-do_not_install_data.patch to support upstream
+  changes.
+- Switch to pyproject macros.
+- Move to the GitHub tarball.
+- Run a portion of the (new!) testsuite.
+
+-------------------------------------------------------------------
 Mon Mar  6 16:04:32 UTC 2023 - Matej Cepl <mcepl@suse.com>
 
 - Don't use fdupes -s, it hurts.
diff --git a/python-gphoto2.spec b/python-gphoto2.spec
index 41fe90b..215fd4f 100644
--- a/python-gphoto2.spec
+++ b/python-gphoto2.spec
@@ -1,7 +1,7 @@
 #
 # spec file for package python-gphoto2
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,16 +17,20 @@
 
 
 Name:           python-gphoto2
-Version:        2.2.4
+Version:        2.5.1
 Release:        0
 Summary:        Python interface to libgphoto2
-License:        GPL-3.0-or-later
+License:        LGPL-3.0-or-later
 URL:            https://github.com/jim-easterbrook/python-gphoto2
-Source0:        https://files.pythonhosted.org/packages/source/g/gphoto2/gphoto2-%{version}.tar.gz
+Source0:        https://github.com/jim-easterbrook/python-gphoto2/archive/refs/tags/v%{version}.tar.gz#/gphoto2-%{version}.tar.gz
 # PATCH-FIX-OPENSUSE python-gphoto2-do_not_install_data.patch
 Patch0:         %{name}-do_not_install_data.patch
 BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module pip}
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module toml if %python-setuptools < 61}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  pkgconfig
 BuildRequires:  python-rpm-macros
@@ -40,7 +44,7 @@ access to nearly all of the libgphoto2 functions, although sometimes
 in a nonstandard manner.
 
 %prep
-%autosetup -p1 -n gphoto2-%{version}
+%autosetup -p1 -n python-gphoto2-%{version}
 # remove unwanted shebang
 sed -e '1d' -i examples/*.py
 
@@ -48,16 +52,22 @@ sed -e '1d' -i examples/*.py
 chmod -x examples/*.py
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitearch}
 
+%check
+export IOLIBS=%{_libdir}/libgphoto2_port/$(pkg-config --variable=VERSION libgphoto2_port)
+export CAMLIBS=%{_libdir}/libgphoto2/$(pkg-config --variable=VERSION libgphoto2)
+# Large portions of the testsuite fail with gphoto2.GPhoto2Error: [-105] Unknown model
+%pytest_arch -k 'TestList'
+
 %files %{python_files}
 %license LICENSE.txt
-%doc CHANGELOG.txt README.rst examples
+%doc README.rst examples
 %{python_sitearch}/gphoto2
-%{python_sitearch}/gphoto2-%{version}*-info
+%{python_sitearch}/gphoto2-%{version}.dist-info
 
 %changelog