File python3-opengl.spec of Package python3-opengl

#
# spec file for package python3-opengl
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           python3-opengl
%define tarname PyOpenGL
Version:        3.1.0
Release:        0
Summary:        OpenGL bindings for Python
License:        BSD-3-Clause
Group:          Development/Libraries/Python
Url:            http://pyopengl.sourceforge.net
Source0:        https://pypi.python.org/packages/source/P/%{tarname}/%{tarname}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  libdrm-devel
BuildRequires:  python3
BuildRequires:  python3-2to3
BuildRequires:  python3-devel
BuildRequires:  python3-Pillow
BuildRequires:  python3-numpy
BuildRequires:  swig
BuildRequires:  tk-devel
BuildRequires:  xorg-x11
Requires:       python3-numpy
Requires:       tk >= 8.1
Recommends:     python3-opengl-accelerate
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# this is only noarch as long as the accelerator module is missing
%if %{?suse_version: 0%{?suse_version} > 1110} %{!?suse_version:1}
BuildRequires:  libgle-devel
BuildArch:      noarch
%else
BuildRequires:  gle
%endif

%description
OpenGL bindings for Python including support for GL extensions, GLU,
WGL, GLUT, GLE, and Tk.

%prep
%setup -q -n %{tarname}-%{version}

%build
CFLAGS="%{optflags} -DGLX_GLXEXT_LEGACY" python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
chmod a+x %{buildroot}%{python3_sitelib}/OpenGL/arrays/_buffers.py
chmod a+x %{buildroot}%{python3_sitelib}/OpenGL/arrays/buffers.py
%fdupes %{buildroot}%{python3_sitelib}/OpenGL/

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc license.txt
%{python3_sitelib}/OpenGL/
%{python3_sitelib}/PyOpenGL-%{version}-py*.egg-info

%changelog