%global srcname PyOpenGL %global shortname pyopengl %global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 Name: python-%{shortname} Version: 3.1.5 Release: 10%{?dist} Summary: Python bindings for OpenGL License: BSD URL: https://github.com/mcfletch/pyopengl Source0: https://pypi.python.org/packages/source/P/%{srcname}/%{srcname}-%{version}.tar.gz Source1: https://pypi.python.org/packages/source/P/%{srcname}-accelerate/%{srcname}-accelerate-%{version}.tar.gz %description PyOpenGL is the cross platform Python binding to OpenGL and related APIs. It includes support for OpenGL v1.1, GLU, GLUT v3.7, GLE 3 and WGL 4. It also includes support for dozens of extensions (where supported in the underlying implementation). PyOpenGL is inter-operable with a large number of external GUI libraries for Python including (Tkinter, wxPython, FxPy, PyGame, and Qt). %package -n python%{python3_pkgversion}-%{shortname} Summary: Python 3 bindings for OpenGL BuildRequires: gcc BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-Cython Requires: freeglut Requires: python%{python3_pkgversion}-numpy %{?python_provide:%python_provide python%{python3_pkgversion}-%{shortname}} %description -n python%{python3_pkgversion}-%{shortname} PyOpenGL is the cross platform Python binding to OpenGL and related APIs. It includes support for OpenGL v1.1, GLU, GLUT v3.7, GLE 3 and WGL 4. It also includes support for dozens of extensions (where supported in the underlying implementation). PyOpenGL is inter-operable with a large number of external GUI libraries for Python including (Tkinter, wxPython, FxPy, PyGame, and Qt). %package -n python%{python3_pkgversion}-%{shortname}-tk Summary: %{srcname} Python 3.x Tk widget BuildArch: noarch Requires: python%{python3_pkgversion}-%{shortname} = %{version}-%{release} Requires: python%{python3_pkgversion}-tkinter %{?python_provide:%python_provide python%{python3_pkgversion}-%{shortname}-tk} %description -n python%{python3_pkgversion}-%{shortname}-tk %{srcname} Togl (Tk OpenGL widget) 1.6 support for Python 3.x. %prep %setup -q -c -n %{srcname}-%{version} -T -a0 -a1 %build # Delete all Cython generated .c files to force a rebuild in py3_build # (py2_build then reuses the Cython output) pushd %{srcname}-accelerate-%{version}/src for f in *.pyx ; do rm -f "${f%.pyx}.c" done popd for dir in %{srcname}-%{version} %{srcname}-accelerate-%{version} ; do pushd $dir %py3_build popd done %install for dir in %{srcname}-%{version} %{srcname}-accelerate-%{version} ; do pushd $dir %py3_install popd done # Fix up perms on compiled object files find %{buildroot}%{python3_sitearch}/OpenGL_accelerate/ -name *.so -exec chmod 755 '{}' \; # Remove shebangs - note that weirdly these files have a space between # the #! and the /, so this sed recipe is not the usual one pushd %{buildroot}%{python3_sitelib}/OpenGL/arrays sed -i -e '/^#! \//, 1d' buffers.py _buffers.py popd %files -n python%{python3_pkgversion}-%{shortname} %license %{srcname}-%{version}/license.txt %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/OpenGL/ %exclude %{python3_sitelib}/OpenGL/Tk %{python3_sitearch}/OpenGL_accelerate/ %{python3_sitearch}/%{srcname}_accelerate-%{version}-py%{python3_version}.egg-info/ %files -n python%{python3_pkgversion}-%{shortname}-tk %{python3_sitelib}/OpenGL/Tk %changelog