File rocksndiamonds.spec of Package rocksndiamonds.636

#
# spec file for package rocksndiamonds
#
# Copyright (c) 2012 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:           rocksndiamonds
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_net-devel
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
Provides:       rockdiam
Obsoletes:      rockdiam
Version:        3.3.0.1
Release:        0
PreReq:         permissions
Summary:        Arcade style game with stereo sounds
License:        GPL-2.0+
Group:          Amusements/Games/Action/Arcade
Url:            http://www.artsoft.org/rocksndiamonds/
# Downloaded from http://www.artsoft.org/RELEASES/unix/rocksndiamonds/rocksndiamonds-3.3.0.1.tar.gz
# Deleted already compiled binary: rm rocksndiamonds
# Repacked as tar.bz2
Source:         %{name}-%{version}.tar.bz2
Source2:        %{name}.png
Source3:        %{name}.desktop
Source4:        Contributions-1.2.0.tar.bz2
Patch:          %{name}-%{version}-smpeg.patch
Patch1:         %{name}-CVE-2011-4606.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A game like "Boulderdash" (C 64) or "Emerald Mine" (Amiga). Included
are many levels known from the games "Boulderdash", "Emerald Mine",
"Sokoban", "Supaplex" and "DX-Boulderdash", level elements for "Diamond
Caves II" style games and a lot of new levels designed by other
players.

Some features:

- joystick support for Linux, FreeBSD and DOS/Windows

- local multiplayer support for all supported platforms

- network multiplayer support for Unix platform

- soft scrolling with 50 frames/s

- stereo sound effects and music

- music module support for SDL version (Unix/Win32)

- fullscreen support for SDL version (Unix/Win32)

- lots of additional levels available (over 10.000)



Authors:
--------
    Holger Schemel <info@artsoft.org>

%prep
%setup -q
if [ ! -f /usr/%_lib/libsmpeg.a ] ; then
%patch -p1
fi
%patch1 -p1
cp %{S:2} %{S:3} .
pushd levels
tar xjf %{S:4}
popd

%build
make sdl \
    OPTIONS="$RPM_OPT_FLAGS" \
    XLIB_PATH=/usr/X11R6/%{_lib} \
    RO_GAME_DIR=%{_datadir}/%{name} \
    RW_GAME_DIR=%{_var}/games/%{name}

%install
rm -rf $RPM_BUILD_ROOT
LIBDIR=$RPM_BUILD_ROOT%{_datadir}/%{name}
SCOREDIR=$RPM_BUILD_ROOT%{_var}/games/%{name}
install -m 755 -d $LIBDIR
install -m 755 -d $SCOREDIR
install -m 755 -d $RPM_BUILD_ROOT%{_bindir}/
install -m 755 -d $RPM_BUILD_ROOT%{_mandir}/man6
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp -a graphics $LIBDIR
cp -a sounds $LIBDIR
cp -a music $LIBDIR
cp -a levels $LIBDIR
find $LIBDIR/levels -name '*.orig' | xargs rm
find $LIBDIR -type f -exec chmod 644 \{\} \;
find $LIBDIR -type d -exec chmod 755 \{\} \;
install -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}
install -m 644 %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man6/%{name}.6
install -m 644 %{name}.png $RPM_BUILD_ROOT%{_datadir}/pixmaps
%suse_update_desktop_file -i %{name} Game ArcadeGame
%fdupes $RPM_BUILD_ROOT

%post
%run_permissions
%verifyscript
%verify_permissions -e %{_bindir}/rocksndiamonds

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc ChangeLog COPYING CREDITS README
%doc %{_mandir}/man6/*
%verify(not mode) %attr(0755,games,games) %{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%attr(775,games,games) %{_var}/games/%{name}

%changelog
openSUSE Build Service is sponsored by