Blob Blame History Raw
Name:           hedgewars
Version:        0.9.0
Release:        2%{?dist}
Summary:        2D tankbattle game with the tanks replaced by hedgehogs
Group:          Amusements/Games
License:        GPL+
URL:            http://www.hedgewars.org/
Source0:        http://hedgewars.org/download/hedgewars-src-%{version}.tar.bz2
Source1:        %{name}.desktop
Source2:        %{name}.png
Patch0:         hedgewars-0.9.0-debuginfo.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  fpc qt4-devel SDL_mixer-devel SDL_net-devel SDL_image-devel
BuildRequires:  SDL_ttf-devel cmake desktop-file-utils
Requires:       hicolor-icon-theme

%description
Hedgewars is a turn based strategy game but the real buzz is from watching the
devastation caused by those pesky hedgehogs with those fantastic weapons.

Each player controls a team of several hedgehogs. During the course of the
game, players take turns with one of their hedgehogs. They then use whatever
tools and weapons are available to attack and kill the opponents' hedgehogs,
thereby winning the game. Hedgehogs may move around the terrain in a variety
of ways, normally by walking and jumping but also by using particular tools
such as the "Rope" or "Parachute", to move to otherwise inaccessible areas.


%prep
%setup -q
%patch0 -p1


%build
cmake -DCMAKE_CXX_FLAGS="$RPM_OPT_FLAGS" -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  -DDATA_INSTALL_DIR=%{_datadir}
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
install -p -m 644 %{SOURCE2} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps


%clean
rm -rf $RPM_BUILD_ROOT


%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files
%defattr(-,root,root,-)
%doc COPYING Fonts_LICENSE.txt README
%{_bindir}/%{name}
%{_bindir}/hwengine
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png


%changelog
* Sun Sep  9 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.9.0-2
- Install data files into /usr/share/hedgewars instead of into
  /usr/share/hedgewars/hedgewars
- Minor desktop file cleanup

* Sun Aug 26 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.9.0-1
- Initial Fedora package