File powder.spec of Package powdertoy

#
# spec file for package powder
#
# Copyright (c) 2015 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/
#


Summary:        Physics sandbox game
License:        GPL-2.0+
Group:          Amusements/Games/Other
Name:           powder
Version:        90.2.322
Release:        0
Source0:        https://github.com/simtr/The-Powder-Toy/archive/v%{version}.tar.gz
Source1:        %{name}.desktop
# PATCH-FIX-OPENSUSE not to force build arch and to fix arm & ppc builds.
Patch0:         arm_ppc.patch
Url:            http://powdertoy.co.uk
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  ImageMagick
BuildRequires:  SDL-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  fftw3-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  hicolor-icon-theme
BuildRequires:  libbz2-devel
BuildRequires:  lua51-devel
BuildRequires:  python-devel
BuildRequires:  scons
BuildRequires:  update-desktop-files
BuildRequires:  zlib-devel

%description
The Powder Toy is a free physics sandbox game, which simulates
air pressure and velocity, heat, gravity and a countless number
of interactions between different substances! The game provides
you with various building materials, liquids, gases and electronic
components which can be used to construct complex machines, guns,
bombs, realistic terrains and almost anything else.

%prep
%setup -q -n The-Powder-Toy-%{version}
%patch0
convert resources/powder.ico resources/powder.png

%build
scons --lin --release

%install
%ifarch %ix86
install -D -m 0755 build/powder %{buildroot}%{_bindir}/powder
%endif
%ifarch x86_64
install -D -m 0755 build/powder64 %{buildroot}%{_bindir}/powder
%endif
install -D -m 0644 resources/powder-0.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/powder.png
install -D -m 0644 resources/powder-1.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/powder.png
install -D -m 0644 resources/powder-2.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/powder.png
install -D -m 0644 resources/powder-3.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/powder.png
install -D -m 0644 resources/powder-4.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/powder.png

install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/powder.desktop
%suse_update_desktop_file powder

%files
%defattr(-, root, root)
%{_bindir}/powder
%{_datadir}/applications/powder.desktop
%{_datadir}/icons/hicolor/256x256/apps/powder.png
%{_datadir}/icons/hicolor/48x48/apps/powder.png
%{_datadir}/icons/hicolor/32x32/apps/powder.png
%{_datadir}/icons/hicolor/24x24/apps/powder.png
%{_datadir}/icons/hicolor/16x16/apps/powder.png

%changelog
openSUSE Build Service is sponsored by