%define ver      @VERSION@
%define rel      1
%define prefix   /usr

Summary: A Scrabble(tm) Clone for the Gnome Desktop Environment.
Name: Gnerudite
Version: %ver
Release: %rel
Buildroot: /tmp/Gnerudite
Copyright: GPL
Group: Amusements/Games
Source: http://www.tomgilbert.freeserve.co.uk/Gnerudite-%{ver}.tar.gz

URL: http://www.tomgilbert.freeserve.co.uk
Docdir: %{prefix}/doc

Requires: gnome-libs >= 1.0.0

%description
Gnerudite is a game similar to the board game Scrabble. The aim is to make
words from random letters, scoring points from word length and use of
difficult letters. Additional features include themeability and rule
configurability.


%prep
%setup

%build
# Needed for snapshot releases.
%ifarch alpha
  MYARCH_FLAGS="--host=alpha-redhat-linux"
%endif
MYCFLAGS="$RPM_OPT_FLAGS"

if [ ! -f configure ]; then
  CFLAGS="$MYCFLAGS" ./autogen.sh $MYARCH_FLAGS --prefix=%prefix --localstatedir=/var/lib
else
  CFLAGS="$MYCFLAGS" ./configure $MYARCH_FLAGS --prefix=%prefix --localstatedir=/var/lib
fi

if [ "$SMP" != "" ]; then
  (make "MAKE=make -k -j $SMP"; exit 0)
  make
else
  make
fi

%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)

%doc AUTHORS COPYING ChangeLog NEWS README HACKING
%{prefix}/bin/Gnerudite
%{prefix}/share/Gnerudite/dictionary.gz
%{prefix}/share/Gnerudite/themes/Default/*
%{prefix}/share/Gnerudite/themes/Classic/*
%{prefix}/share/Gnerudite/themes/SciFi/*
%{prefix}/share/pixmaps/Gnerudite.png
%{prefix}/share/gnome/apps/Games/Gnerudite.desktop
