File cubosphere.spec of Package cubosphere

# spec file for package cubosphere
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright Vincent Petry <>
# 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

Name:           cubosphere
Version:        0.1
Release:        0
Summary:        3d puzzle similar to Kula World / Roll Away
License:        GPL-3.0
Group:          Amusements/Games/3D/Other
BuildRequires:  Mesa-devel
BuildRequires:  SDL-devel >= 1.2
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_ttf-devel
BuildRequires:  dos2unix
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  glew-devel >= 1.5
BuildRequires:  libjpeg-devel
BuildRequires:  libogg-devel
%if 0%{?suse_version} >= 1220
BuildRequires:  lua51-devel
BuildRequires:  lua-devel
# Sources downloaded from SourceForge:
# Extracted into cubosphere-0.1 (beware, it's a tarbomb!)
# Removed data subdir (moved to cubosphere-music package)
# Repacked as tar.bz2 archive.
Source:         %{name}-%{version}.tar.bz2
Requires:       cubosphere-data = %{version}
# File should / can be auto generated on suse distribution anyway but lets make it multi distro happy
%if ! 0%{?suse_version}
Source2:        %{name}.desktop
Source3:        %{name}.png
# Changed music from mp3 to ogg.
# PATCH-FIX-UPSTREAM cubosphere-music.patch
Patch0:         %{name}-music.patch
# Fixed makefile so new gcc does not need SUSE_ASNEEDED workaround and
# fixing default path search creation
# PATCH-FIX-UPSTREAM cubosphere-0.0.4b-MakefileFixes.patch
Patch1:         %{name}-0.1-MakefileFixes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires:  update-desktop-files

3d Puzzle similar to Kula World / Roll Away
Roll your ball trough a 3d maze, collect all keys and proceed to the exit. The strange physics - where gravity acts always relative to your position and orientation - makes Cubosphere to a challenging puzzle where no "up", "down", "left", "right", "front" and "back" exist.
The game comes with an internal level editor!
Please note that this game is in Beta stage.

%setup -q
%patch0 -p1
%patch1 -p1
chmod a-x documents/*.txt
dos2unix documents/*.txt

make PREFIX=%{_prefix} LUALIBS=-llua NEWLUA=true %{?_smp_mflags}

# Install binary
install -d -D -m 755 %{buildroot}%{_bindir}
install -D -m 755 %{name} %{buildroot}%{_bindir}
install -dm0755  "%{buildroot}/%{_datadir}/pixmaps/"
install -m0644 "%{SOURCE3}" "%{buildroot}/%{_datadir}/pixmaps/"
%if 0%{?suse_version}
%suse_update_desktop_file -c %{name} Cubosphere Cubosphere cubosphere cubosphere
%suse_update_desktop_file -C "3d puzzle similar to Kula World / Roll Away" -i %{name} Game ArcadeGame
install -dm0755  "%{buildroot}/%{_datadir}/applications/"
install -m0644 "%{SOURCE2}" "%{buildroot}/%{_datadir}/applications/"

%doc documents/GPL.txt documents/SDL.txt documents/editormanual.pdf