File trackballs.spec of Package trackballs
#
# spec file for package trackballs (Version 1.1.4)
#
# Copyright (c) 2010 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: trackballs
BuildRequires: SDL_image-devel SDL_mixer-devel SDL_ttf-devel gcc-c++ guile-devel hicolor-icon-theme libdrm-devel update-desktop-files xorg-x11-Mesa-devel
Summary: Trackballs - A Marble Madness-like Game
Version: 1.1.4
Release: 155
PreReq: permissions
AutoReqProv: on
Obsoletes: trackballs-music
Source0: trackballs-%version.tar.bz2
Source4: %name.png
Source5: tb_hrluebke.ogg
Source6: tb_plinkeplanke.ogg
Source7: tb_schizophrenia.ogg
Source8: tb_sorrow.ogg
Patch: trackballs-%version-codecleanup.diff
Patch1: trackballs-off_by_one.diff
Patch2: void-funcs.diff
Patch3: trackballs-1.1.4-bufferoverflow.diff
Group: Amusements/Games/3D/Other
License: GPLv2+
Url: http://trackballs.sf.net
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _gamesbindir /usr/games
%define _gamesdatadir %{_datadir}
%define highscores /var/games/%name.scores
%description
Trackballs is a simple game similar to the classic game Marble Madness
on the Amiga in the 80's. The player collects points by steering a
marble ball through a labyrinth filled with vicious hammers, pools of
acid, and other obstacles.
When the ball reaches the destination you continue on to the next, more
difficult level - unless, of course, the time runs out.
You steer the ball using the mouse and by pressing space, you can jump
a short distance.
When all levels are finished, an editor mode permits you to create new
ones ("trackballs -e").
%prep
%setup -q
%patch
%patch1
%patch2
%patch3 -p1
sed -i 's/MimeType=application\/x-executable/&;/' share/icons/trackballs.desktop.in
%build
mkdir -p m4 # makes autoreconf happy
autoreconf -fi
export CFLAGS="%{optflags}"
%configure --bindir=%{_gamesbindir} \
--datadir=%{_gamesdatadir} \
--with-highscores=%highscores \
--mandir=%_mandir || {
--with-resolution=2
grep '[og]:' config.log
exit 1
}
make
%install
%makeinstall
if [ -f %buildroot/%{_gamesbindir}/%{_target_platform}-%{name} ] ; then
mv %buildroot/%{_gamesbindir}/%{_target_platform}-%{name} \
%buildroot/%{_gamesbindir}/%{name}
fi
install -d %buildroot/%_gamesdatadir/%name/music/
install %SOURCE5 %buildroot/%_gamesdatadir/%name/music/
install %SOURCE6 %buildroot/%_gamesdatadir/%name/music/
install %SOURCE7 %buildroot/%_gamesdatadir/%name/music/
install %SOURCE8 %buildroot/%_gamesdatadir/%name/music/
mkdir -p %buildroot/usr/share/pixmaps/
install -m 644 $RPM_SOURCE_DIR/%name.png $RPM_BUILD_ROOT/usr/share/pixmaps
%suse_update_desktop_file -i %name ArcadeGame
%find_lang %name
cd %buildroot
if [ -d usr/share/trackballs/locale ]; then
mv usr/share/trackballs/locale usr/share
fi
mv usr/share/trackballs/*.html ~-
%post
%run_permissions
%verifyscript
%verify_permissions -e /usr/games/trackballs
%files -f %name.lang
%defattr(-,root,root)
%attr(-,root,root) %doc AUTHORS ChangeLog FAQ NEWS README TODO *.jpg *.html
%attr(644,root,root) %{_mandir}/man6/%{name}.6.*
%defattr(-,games,games)
%{_gamesdatadir}/%{name}
# Binariy set-gid game:
%verify(not mode) %attr(0755,games,games) %{_gamesbindir}/%{name}
# Scores group-writeable for game:
%attr(664,games,games) %highscores
/usr/share/applications/%name.desktop
/usr/share/pixmaps/%name.png
%{_datadir}/icons/hicolor/*/apps/trackballs.png
%clean
rm -rf $RPM_BUILD_ROOT
%changelog