From 69ea5e28b1e3ef0d4f2da6b48400dfac92a31f20e8c3994bfd8abadd4a2a9ab0 Mon Sep 17 00:00:00 2001 From: Ana Guerrero Date: Mon, 20 Jan 2025 10:59:39 +0000 Subject: [PATCH] - 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. OBS-URL: https://build.opensuse.org/package/show/graphics/python-gphoto2?expand=0&rev=20 --- .gitattributes | 23 ++++ .gitignore | 1 + gphoto2-2.2.4.tar.gz | 3 + gphoto2-2.5.1.tar.gz | 3 + python-gphoto2-do_not_install_data.patch | 17 +++ python-gphoto2.changes | 140 +++++++++++++++++++++++ python-gphoto2.spec | 73 ++++++++++++ 7 files changed, 260 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 gphoto2-2.2.4.tar.gz create mode 100644 gphoto2-2.5.1.tar.gz create mode 100644 python-gphoto2-do_not_install_data.patch create mode 100644 python-gphoto2.changes create mode 100644 python-gphoto2.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/gphoto2-2.2.4.tar.gz b/gphoto2-2.2.4.tar.gz new file mode 100644 index 0000000..c6102b6 --- /dev/null +++ b/gphoto2-2.2.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48b4c4ab70826d3ddaaf7440564d513c02d78680fa690994b0640d383ffb8a7d +size 1807843 diff --git a/gphoto2-2.5.1.tar.gz b/gphoto2-2.5.1.tar.gz new file mode 100644 index 0000000..416d041 --- /dev/null +++ b/gphoto2-2.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cdfd8ddb676a8041298bee32b7943d0f3a261067a5b0b95e238f1647ebe0316 +size 565949 diff --git a/python-gphoto2-do_not_install_data.patch b/python-gphoto2-do_not_install_data.patch new file mode 100644 index 0000000..2531170 --- /dev/null +++ b/python-gphoto2-do_not_install_data.patch @@ -0,0 +1,17 @@ +Index: gphoto2-2.5.1/setup.py +=================================================================== +--- 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 new file mode 100644 index 0000000..2696fd7 --- /dev/null +++ b/python-gphoto2.changes @@ -0,0 +1,140 @@ +------------------------------------------------------------------- +Mon Jan 13 01:59:41 UTC 2025 - Steve Kowalik + +- 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 + +- Don't use fdupes -s, it hurts. + +------------------------------------------------------------------- +Thu Sep 2 14:42:48 UTC 2021 - Christophe Giboudeaux + +- Fix rpmlint errors. + +------------------------------------------------------------------- +Tue Nov 10 07:17:16 UTC 2020 - aloisio@gmx.com + +- Update to version 2.2.4 + * Built with SWIG version 4.0.2 to provide Python 3.8 + compatibility. + +------------------------------------------------------------------- +Mon Oct 12 16:47:56 UTC 2020 - aloisio@gmx.com + +- Update to version 2.2.3 + * Minor improvement in setup.py script. + * Minor improvements in example scripts. + +------------------------------------------------------------------- +Thu Apr 9 10:22:57 UTC 2020 - aloisio@gmx.com + +- Update to version 2.2.2 + * Added Camera.autodetect alternative to gp_camera_autodetect. + * Added some deprecation warnings. Use 'python -Wd' to see them + when running software under development. + * Added gphoto2_version.py example program. + +------------------------------------------------------------------- +Sat Mar 14 08:30:36 UTC 2020 - aloisio@gmx.com + +- Update to version 2.2.1 + * Reinstated Context.camera_autodetect method removed in 2.2.0. + version 2.2.0: + * COMPATIBILITY CHANGE: Removed Context.camera_autodetect + method. + * COMPATIBILITY CHANGE: Removed deprecated widget get/set + functions. + * Python3 log messages are now str instead of bytes. + * Documentation improvements. + +------------------------------------------------------------------- +Sat Jan 25 17:06:18 UTC 2020 - Luigi Baldoni + +- Update to version 2.1.0 + * COMPATIBILITY CHANGE: gp_file_set_data_and_size and + gp_file_append now take a single buffer parameter (such as + a bytes string) instead of a string and length. + * Fixed memory double free bug in gp_file_set_data_and_size. + * Removed support for libgphoto2 v2.4. + +------------------------------------------------------------------- +Mon Apr 22 11:09:09 UTC 2019 - Luigi Baldoni + +- Update to version 2.0.0 + * COMPATIBILITY CHANGE: gp_log_add_func and use_python_logging + now return a Python object which must be stored until logging + is no longer needed. + * Added cam-conf-view-gui & wait-for-event examples. Thanks to + the users who contributed these. + * Various minor bug fixes and improvements. + version 1.9.0: + * Enabled use of context callback functions such as + gp_context_set_progress_funcs. + * Added a time lapse movie example script. + version 1.8.5: + * Fix memory leak in gp_camera_get_config. + version 1.8.4: + * Fix segfault if camera disconnected before calling + get_storageinfo. + version 1.8.3: + * Fix Qt5 usage in examples (thanks fatzh). + * Handle GP_EVENT_FILE_CHANGED (new in libgphoto2 2.5.17). + * Allow Python threads during gp_camera_init. + +------------------------------------------------------------------- +Tue Jan 30 18:43:35 UTC 2018 - aloisio@gmx.com + +- Update to version 1.8.2 + * Fix bug in v1.8.1 that caused installation problems on some + systems. + version 1.8.1: + * Logging callbacks now pass 'bytes' objects in Python3. + * Increased number of functions allow other Python threads to + run. + version 1.8.0: + * The 'context' parameter is now optional for most functions. + * Some deprecated functions have been removed. + * Improved documentation of many functions. + * Substantial rework of logging callback processing. + +------------------------------------------------------------------- +Sun Aug 27 05:56:47 UTC 2017 - aloisio@gmx.com + +- Update to version 1.7.1 + * Return string values from gp_camera_wait_for_event. + +------------------------------------------------------------------- +Fri Jul 7 11:39:04 UTC 2017 - aloisio@gmx.com + +- Initial package (1.7.0) diff --git a/python-gphoto2.spec b/python-gphoto2.spec new file mode 100644 index 0000000..7d4b40f --- /dev/null +++ b/python-gphoto2.spec @@ -0,0 +1,73 @@ +# +# spec file for package python-gphoto2 +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-gphoto2 +Version: 2.5.1 +Release: 0 +Summary: Python interface to libgphoto2 +License: LGPL-3.0-or-later +URL: https://github.com/jim-easterbrook/python-gphoto2 +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 +BuildRequires: pkgconfig(libgphoto2) +%python_subpackages + +%description +Python bindings to libgphoto2. The module is built using SWIG to +automatically generate the interface code. This gives direct +access to nearly all of the libgphoto2 functions, although sometimes +in a nonstandard manner. + +%prep +%autosetup -p1 -n python-gphoto2-%{version} +# remove unwanted shebang +sed -e '1d' -i examples/*.py + +# E: spurious-executable-perm +chmod -x examples/*.py + +%build +%pyproject_wheel + +%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 README.rst examples +%{python_sitearch}/gphoto2 +%{python_sitearch}/gphoto2-%{version}.dist-info + +%changelog