File jvgs.spec of Package jvgs

#
# spec file for package jvgs
#
# 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:           jvgs
Version:        0.5.1
Release:        0
Summary:        Minimalistic platform game loosely based on the xkcd webcomics
License:        WTFPL and CPL-1.0
Group:          Amusements/Games/Action/Other
Url:            http://jvgs.sourceforge.net/
Source0:        http://sourceforge.net/projects/%{name}/files/%{name}-0.5/%{name}-%{version}-src.tar.gz
Source1:        jvgs.desktop
Source2:        jvgs.png
# PATCH-FIX-UPSTREAM https://github.com/jaspervdj/JVGS/pull/6
Patch0:         CMakelists.patch
BuildRequires:  cmake
BuildRequires:  gcc gcc-c++
BuildRequires:  swig
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  lua51-devel
BuildRequires:  pkgconfig(dri)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(SDL_mixer)
BuildRequires:  pkgconfig(zlib)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
JVGS is a free, minimalistic platform game. Some elements are
loosely based on xkcd. The Ghosts album by Nine Inch Nails
was chosen as soundtrack.

%prep
%setup -q -n %{name}-%{version}-src
%patch0 -p1

%build
cmake .

%install
mkdir -p %{buildroot}/usr/{share/jvgs/resources,bin}
install -D -m644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/jvgs.png
install -D -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications/jvgs.desktop

install -D -m644 ./main.lua %{buildroot}%{_datadir}/%{name}/main.lua
install -D -m755 ./src/jvgs %{buildroot}%{_libexecdir}/jvgs

cd resources
tar cf - * | ( cd %{buildroot}%{_datadir}/%{name}/resources; tar xfp -)
(echo "#!/bin/bash
cd /usr/share/jvgs
/usr/lib/jvgs \"\$@\"") > %{buildroot}%{_bindir}/%{name}

%files
%defattr(-,root,root)
%doc AUTHORS LICENSE README.markdown
%attr(755,root,root) %{_bindir}/%{name}
%{_datadir}/%{name}
%{_libexecdir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/jvgs.desktop

%changelog
openSUSE Build Service is sponsored by