File trackballs.spec of Package trackballs

#
# spec file for package trackballs (Version 1.1.4)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# 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 libstdc++ libstdc++-devel update-desktop-files xorg-x11-Mesa-devel
Summary:        Trackballs - A Marble Madness-like Game
Version:        1.1.4
Release:        20
PreReq:         permissions
AutoReqProv:    on
Provides:       trackballs-music
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
Group:          Amusements/Games/3D/Other
License:        GPL v2 or later
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
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
* Mon Sep 24 2007 - bk@suse.de
- remove tb_design,genesis.ogg (old, new songs were added, saves 7MB)
* Fri Aug 10 2007 - bk@suse.de
- Update to 1.1.4 (much for fun wit new music), major points are:
  * Added great new songs and level sets by Attila Boros
  * Added custom backgrounds in the setup game mode for each levelset
  * Huge improvements in the map editor
* Mon Jul 02 2007 - aj@suse.de
- Fix typo in last change.
* Fri Jun 29 2007 - pth@suse.de
- BuidRequire SDL_ttf-devel
* Wed Oct 18 2006 - pth@suse.de
- Fix an off-by-one bug.
* Fri Oct 13 2006 - aj@suse.de
- Add guile-devel to buildrequires.
* Fri Oct 13 2006 - ro@suse.de
- added gmp-devel to buildreq (guile)
* Mon Jan 30 2006 - pth@suse.de
- Add gcc-c++ and libstdc++ to BuildRequires
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Nov 17 2005 - sndirsch@suse.de
- updated to release 1.1.1
- adjusted codecleanup patch
* Tue May 03 2005 - pth@suse.de
- Fix pointer->int casts.
- Fix the use of uninitialized variables.
- Reduce compiler warnings.
* Wed Mar 02 2005 - sndirsch@suse.de
- merged trackballs/trackballs-music
* Wed Aug 25 2004 - bk@suse.de
- fix the last return code patch, the return false was wrong
* Wed May 26 2004 - ro@suse.de
- added some return values to non-void functions
* Tue Feb 10 2004 - sndirsch@suse.de
- updated to release 1.0.0
- removed patch (no longer required)
- removed "-ffast-math"; does not work any longer with 1.0.0
* Wed Nov 05 2003 - ro@suse.de
- package according to permissions.secure and add run_permissions
* Mon Aug 25 2003 - ro@suse.de
- fix compile with current gcc
* Tue Aug 12 2003 - sndirsch@suse.de
- added desktop icon
* Mon Aug 11 2003 - bk@suse.de
- Updated to 0.9.0
* Sun Aug 10 2003 - sndirsch@suse.de
- added desktop file
* Mon Jun 02 2003 - ro@suse.de
- fix build without platform-prefixed binaries
* Thu Mar 13 2003 - bk@suse.de
- fix highscore saving if score is in /var, fixes bug number 25256
* Mon Mar 03 2003 - bk@suse.de
- 0.7.1: fix small bugs, add jump height, antialisasing for map-grid
* Mon Feb 24 2003 - bk@suse.de
- 0.7.0: fix textures, new pipe level, diagonal keys added, and mm.
* Mon Feb 17 2003 - bk@suse.de
- 0.6.0: health bar, pipes, pipe connectors, save points, help screen
* Mon Feb 10 2003 - bk@suse.de
- initial version: 0.5.1
openSUSE Build Service is sponsored by