Blob Blame Raw
%define cvsdate 20070510

Name:           xu4
Version:        1.1
Release:        0.1.%{cvsdate}%{?dist}
Summary:        Ultima IV recreated
Group:          Amusements/Games
License:        GPL
# This was generated as follows:
# cvs login
# cvs -z3 co -P u4
# rm -r `find u4 -name CVS`
# rm `find u4 -name .cvsignore`
# rm -r u4/vc6
# tar cvfz xu4-%{cvsdate}.tar.gz u4
Source0:        xu4-%{cvsdate}.tar.gz
Source2:        xu4.autodlrc
Source3:        u4download.txt
Patch0:         xu4-zipfile.patch
Patch1:         xu4-1.0beta3-desktop.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL_mixer-devel libxml2-devel libpng-devel desktop-file-utils
Requires:       hicolor-icon-theme autodownloader

XU4 is a remake of the computer game Ultima IV. This game requires the
original Ultima IV datafiles, which can be freely downloaded from the internet
but may not be (re)distributed. When you start xu4 for the first time it will
offer to download the datafiles for you.

XU4 isn't a new game based on the Ultima IV story -- it is a faithful
recreation of the old game, right up to the crappy graphics.  If you
are looking for a game with modern gameplay and graphics, this is not
it -- yet.  New features that improve the gameplay and keep with the
spirit of the original game will be added.

%setup -q -n u4
%patch0 -p1 -z .zipfile
%patch1 -p1 -z .desktop
if [ "%{_lib}" = "lib64" ]; then
  sed -i 's|/usr/lib|%{_libdir}|g' src/u4file.cpp
cp %{SOURCE3} .

pushd src
  bindir=%{_bindir} datadir=%{_datadir} libdir=%{_libdir}

pushd src
# Note: make install DESTDIR=$RPM_BUILD_ROOT, doesn't work
find $RPM_BUILD_ROOT%{_libdir}/u4 -name '*.xml' -o -name '*.dtd'|xargs chmod -x

# mv u4 to u4.bin and install our autodl wrapper script
mv $RPM_BUILD_ROOT%{_bindir}/u4 $RPM_BUILD_ROOT%{_bindir}/u4.bin
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/u4
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_libdir}/u4

# below is the desktop file and icon stuff.
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  --delete-original                             \

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
mv $RPM_BUILD_ROOT%{_datadir}/pixmaps/u4.png \


touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%doc AUTHORS COPYING README doc/Algorithms.* doc/*FileFormats.txt
%doc doc/U4Notes.txt doc/tools.txt u4download.txt

* Fri May 11 2007 Hans de Goede <> 1.1-0.1.20070510
- Update to latest CVS, as this actually makes the game finishable
- Add missing BuildRequires: desktop-file-utils
- Add u4download.txt to the docs

* Thu Feb  1 2007 Hans de Goede <> 1.0-0.1.beta3
- Initial Fedora Extras package