Blob Blame History Raw
%define cvsdate 20070510

Name:           xu4
Version:        1.1
Release:        0.4.cvs%{cvsdate}%{?dist}
Summary:        Ultima IV recreated
Group:          Amusements/Games
License:        GPLv2+
URL:            http://xu4.sourceforge.net/
# This was generated as follows:
# cvs -d:pserver:anonymous@xu4.cvs.sourceforge.net:/cvsroot/xu4 login
# cvs -z3 -d:pserver:anonymous@xu4.cvs.sourceforge.net:/cvsroot/xu4 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
Source1:        xu4.sh
Source2:        xu4.autodlrc
Source3:        u4download.txt
Patch0:         xu4-zipfile.patch
Patch1:         xu4-1.0beta3-desktop.patch
Patch2:         xu4-1.0beta3-gcc43.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

%description
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.


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


%build
pushd src
make DEBUGCXXFLAGS="$RPM_OPT_FLAGS" \
  bindir=%{_bindir} datadir=%{_datadir} libdir=%{_libdir}
popd


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

# 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                             \
  $RPM_BUILD_ROOT%{_datadir}/applications/u4.desktop

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
mv $RPM_BUILD_ROOT%{_datadir}/pixmaps/u4.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/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 AUTHORS COPYING README doc/Algorithms.* doc/*FileFormats.txt
%doc doc/U4Notes.txt doc/tools.txt u4download.txt
%{_bindir}/u4*
%{_libdir}/u4
%{_datadir}/pixmaps/u4.bmp
%{_datadir}/applications/fedora-u4.desktop
%{_datadir}/icons/hicolor/64x64/apps/u4.png


%changelog
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1-0.4.cvs20070510
- Autorebuild for GCC 4.3

* Fri Jan 11 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1-0.3.cvs20070510
- Fix compilation with gcc 4.3

* Wed Aug 15 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1-0.2.cvs20070510
- Update License tag for new Licensing Guidelines compliance

* Fri May 11 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 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 <j.w.r.degoede@hhs.nl> 1.0-0.1.beta3
- Initial Fedora Extras package