File jag-level-editor.spec of Package jag-level-editor

# spec file for package jag-level-editor
# 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

%define oname   jag

Name:           jag-level-editor
Version:        0.3.2
Release:        0
Summary:        Level Editor for the JAG
License:        GPL-3.0+
Group:          Amusements/Games/Logic
Source1:        %{name}-icons.tar
Source2:        %{name}.desktop
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  gcc-c++
BuildRequires:  libqt4-devel
BuildRequires:  unzip
BuildRequires:  pkgconfig(SDL_mixer)
BuildRequires:  pkgconfig(sdl)
Requires:       %{oname}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The aim of JAG is to break all of the target pieces on each level,
and to do this before the time runs out. Keep doing this until you
have beaten the last level and won the game.

Level Editor for JAG.

%setup -q -a 1 -n %{oname}-%{version}-src

# SED-FIX-OPENSUSE -- Fix paths and name
sed -i -e 's|/usr/local/bin|/usr/bin|;
           s|jag-editor|jag-level-editor|' editor/

cd editor
qmake QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags"
make %{?_smp_mflags} CFLAGS="%{optflags} -fgnu89-inline"

cd editor
make INSTALL_ROOT=%{buildroot} install

# install icons
cd ..
for i in 22 32 48 64 72 96 128 256 ; do
    install -Dm 0644 icons/%{name}_${i}x${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png

# install Desktop files
install -Dm 0644 %{S:2} %{buildroot}%{_datadir}/applications/%{name}.desktop

%if 0%{?suse_version}
    %suse_update_desktop_file %{name}