File python-Kivy.spec of Package python-Kivy
#
# spec file for package python-Kivy
#
# Copyright (c) 2016 SUSE LINUX 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: python-Kivy
Version: 1.9.1
Release: 0
Url: http://kivy.org/
Summary: Hardware-accelerated multitouch application library
License: LGPL-3.0
Group: Development/Languages/Python
Source0: https://pypi.python.org/packages/source/K/Kivy/kivy-%{version}.tar.gz
#
# Suppressing wrong fsf address and python abi warnings - not really relevant
#
Source1: python-Kivy-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: Mesa-devel
%if 0%{?suse_version} > 1310
BuildRequires: SDL2-devel
BuildRequires: SDL2_image-devel
BuildRequires: SDL2_mixer-devel
BuildRequires: SDL2_ttf-devel
%endif
BuildRequires: fdupes
BuildRequires: gstreamer-devel
BuildRequires: mtdev
BuildRequires: pkg-config
BuildRequires: python-Cython
BuildRequires: python-Pillow
BuildRequires: python-Sphinx
BuildRequires: python-devel
BuildRequires: python-opengl
BuildRequires: python-pyenchant
BuildRequires: python-pygame
Requires: mtdev
Requires: python-Pillow
Requires: python-opengl
Requires: python-pyenchant
Requires: python-pygame
Recommends: python-cairo
Recommends: python-gstreamer-0_10
Recommends: python-opencv
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
%description
Kivy is an open source software library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
%package doc
Summary: Documentation for %{name}
Group: Documentation/Other
Requires: %{name} = %{version}
%description doc
Kivy is an open source software library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
This package contains the developer documentation and examples
%package devel
Summary: Development files for %{name}
Group: Development/Languages/Python
Requires: %{name} = %{version}
%description devel
Kivy is an open source software library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
This package contains the headers and source files for extending kivy
%prep
%setup -q -n kivy-%{version}
sed -i "s|data_file_prefix = 'share/kivy-'|data_file_prefix = '%{_docdir}/%{name}/'|" setup.py
sed -i "s|#!/usr/bin/python||" kivy/lib/osc/OSC.py # Fix non-executable script
rm examples/demo/pictures/images/.empty # Remove empty file
rm -r examples/audio # Remove content with non-commercial only license (bnc#749340)
find examples -name android.txt -exec chmod 644 {} \;
#drop usr/bin/kivy shebang to not produce dependency on itself
sed -i 's@#!/usr/bin/kivy@#!/usr/bin/env kivy@' \
examples/demo/showcase/main.py \
examples/demo/kivycatalog/main.py \
examples/demo/pictures/main.py \
examples/demo/shadereditor/main.py \
examples/demo/touchtracer/main.py
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python setup.py build
cd doc && make html && rm -r build/html/.buildinfo # Build HTML documentation
%install
install -dm0755 %{buildroot}%{_defaultdocdir}/%{name}-doc
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# workaround to make fdupes its magic as if %%doc macro is used
# would be used after fdupes so rpmlint would complain about duplicates...
cp -a examples %{buildroot}%{_defaultdocdir}/%{name}-doc
%fdupes %{buildroot}%{_defaultdocdir}
%fdupes %{buildroot}%{python_sitearch}
%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE
%{python_sitearch}/kivy/
%{python_sitearch}/Kivy-%{version}-py*.egg-info
%exclude %{python_sitearch}/kivy/graphics/*.h
%exclude %{python_sitearch}/kivy/tools/gles_compat/gl2.h
%files doc
%defattr(644,root,root,-)
%doc doc/build/html
%{_defaultdocdir}/%{name}-doc
%files devel
%defattr(644,root,root,-)
%{python_sitearch}/kivy/graphics/*.h
%{python_sitearch}/kivy/tools/gles_compat/gl2.h
%changelog