File CriticalMass.spec of Package CriticalMass

# Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs.nl>
# Copyright (c) 2007-2008 oc2pus
# 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 to toni@links2linux.de

# norootforbuild

Name:			CriticalMass
Version:		1.0.2
Release:		1
Summary:		SDL/OpenGL space shoot'em up game also known as critter
Group:			Amusements/Games/Action/Arcade
License:		GPL
URL:			http://criticalmass.sourceforge.net/critter.php
Source0:		http://downloads.sourceforge.net/criticalmass/%{name}-%{version}.tar.bz2
Patch0:			%{name}-1.0.2-sys-curl.patch
Patch1:			%{name}-1.0.2-gcc43.patch
Patch2:			%{name}-1.0.2-tinyxml-gcc43.patch
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires:	curl-devel
BuildRequires:	gcc-c++
%if %suse_version <= 1120
BuildRequires:	libpng-devel
%else
BuildRequires:	libpng12-compat-devel
%endif
BuildRequires:	Mesa-devel
BuildRequires:	libSDL_image-devel
BuildRequires:	libSDL_mixer-devel
BuildRequires:	update-desktop-files
# Also known as critter ...
Provides:		critter = %{version}-%{release}

%description
Critical Mass (aka Critter) is an SDL/OpenGL space shoot'em up
game. Your world has been infested by an aggressive army of space
critters. Overrun and unprepared, your government was unable to
defend its precious resources. As a last effort to recapture some
of the 'goodies', you have been placed into a tiny spacecraft and
sent after them.

# %debug_package

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

%build
%configure
%__make %{?jobs:-j%{jobs}}

%install
%makeinstall

# remove unwanted utility
%__rm %{buildroot}%{_bindir}/Packer

# icon
%__install -dm 755 %{buildroot}%{_datadir}/pixmaps
%__install -m 644 critter.png \
	%{buildroot}%{_datadir}/pixmaps

# menu
%__install -dm 755 %{buildroot}%{_datadir}/applications/
%__cat > %{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Critical Mass
Comment=A space shoot'em up game also known as critter
Exec=critter
Icon=critter
Type=Application
Terminal=false
Categories=Game;ArcadeGame;
EOF
%__install -m 644 %{name}.desktop \
	%{buildroot}%{_datadir}/applications
%suse_update_desktop_file %{name} Game ArcadeGame

%clean
[ -d %{buildroot} -a "%{buildroot}" != "" ] && %__rm -rf  %{buildroot}


%files
%defattr(-,root,root,-)
%doc COPYING Readme.html TODO
%{_bindir}/critter
%dir %{_datadir}/Critical_Mass
%{_datadir}/Critical_Mass/*
%{_mandir}/man6/critter.6.gz
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/*

%changelog
* Fri Nov 30 2007 Toni Graffy <toni@links2linux.de> - 1.0.2-0.pm.1
- initial build 1.0.2 for packman based on fedora package
* Thu Nov 29 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.0.2-1
- Initial Fedora Package