%global forgeurl https://github.com/jim-easterbrook/python-gphoto2 %global version %(date +%Y%m%d) %global commit a288ef55c6f82c4a3afa7ec6f8fe20e368144a9e %global _forgeversionsuffix %{scm}%(printf %.7s %{commit}) %global source_date_epoch_from_changelog 0 %forgemeta %global pypi_name gphoto2 Name: python-%{pypi_name} Version: %{forgeversion} Release: %{autorelease} Summary: A Python interface to libgphoto2 # Automatically converted from old format: GPLv3+ - review is highly recommended. License: GPL-3.0-or-later URL: %{forgeurl} Source0: %{forgesource} BuildRequires: gcc BuildRequires: libgphoto2-devel BuildRequires: pkgconfig %description python-gphoto2 is a comprehensive Python interface (or binding) to libgphoto2. It is built using SWIG to automatically generate the interface code. This ives direct access to nearly all the libgphoto2 functions, but sometimes in a rather un-Pythonic manner. %package -n python3-%{pypi_name} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} python-gphoto2 is a comprehensive Python interface (or binding) to libgphoto2. It is built using SWIG to automatically generate the interface code. This gives direct access to nearly all the libgphoto2 functions, but sometimes in a rather un-Pythonic manner. %prep %forgeautosetup # Remove shebang sed -e '1d' -i examples/*.py # Examples don't need to be executable chmod -x examples/*.py %build %py3_build %install %py3_install # Data files are goining to the wrong location rm -rf %{buildroot}%{_datadir}/%{name} %files -n python3-%{pypi_name} %doc CHANGELOG.txt README.rst examples %license LICENSE.txt %{python3_sitearch}/*.egg-info %{python3_sitearch}/%{pypi_name}/