# Spec file to build RPM packages - shamefully ripped from Exult
# (but since they got our configure summary, that's just fair I guess)

%define ver         @VERSION@
%define rel         1
%define prefix      /usr
%define name        @PACKAGE@
%define bindir      %prefix/bin
%define datadir     %prefix/share
%define gamedatadir @gamedatadir@

Summary: Official game package for Adonthell %ver
Name: %name
Version: %ver
Release: %rel
Copyright: GPL
Group: Amusements/Games
Source: http://freesoftware.fsf.org/download/adonthell/%{name}-%{ver}.tar.gz
URL: http://adonthell.linuxgames.com
BuildArch: noarch
BuildRoot: /tmp/wastesedge
Requires: adonthell >= %ver
Prefix: %prefix
Docdir: %{prefix}/doc

%description
As a loyal servant of the elven Lady Silverhair, you arrive at the remote
trading post of Waste's Edge, where she is engaged in negotiations with the
dwarish merchant Bjarn Fingolson. But not all is well at Waste's Edge, and
soon you are confronted with circumstances that are about to destroy your
mistress' high reputation. And you are the only one to avert this ...

%prep
%setup

%build
if [ ! -f configure ]; then
  ./autogen.sh
fi
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --bindir=%bindir --datadir=%datadir
make

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

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS PLAYING README
%{bindir}/adonthell-wastesedge
%{datadir}/pixmaps/wastesedge_16x16.xpm
%{datadir}/pixmaps/wastesedge_32x32.xpm
%{gamedatadir}
