Blob Blame History Raw
%define svndate 20110329
%define svnrev 2873

Name:           xu4
Version:        1.1
Release:        0.14.%{svndate}svn%{svnrev}%{?dist}
Summary:        Ultima IV recreated
Group:          Amusements/Games
License:        GPLv2+
URL:            http://xu4.sourceforge.net/
# This was generated by running the xu4-svn-checkout.sh script
Source0:        xu4-%{svndate}svn.tar.xz
Source1:        xu4.sh
Source2:        xu4.autodlrc
Source3:        u4download.txt
Patch0:         xu4-zipfile.patch
Patch1:         xu4-1.0beta3-desktop.patch
Patch2:         xu4-1.1-unbundle.patch
BuildRequires:  SDL_mixer-devel libxml2-devel minizip-devel
BuildRequires:  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 .unbundle
if [ "%{_lib}" = "lib64" ]; then
  sed -i 's|/usr/lib|%{_libdir}|g' src/u4file.cpp
fi
cp %{SOURCE3} .


%build
pushd src
make DEBUGCXXFLAGS="%{optflags}" EXTRALIBS=-lminizip\
  bindir=%{_bindir} datadir=%{_datadir} libdir=%{_libdir} %{?_smp_mflags}
popd


%install
pushd src
# Note: make install DESTDIR=%%{buildroot}, doesn't work
%{makeinstall}
find %{buildroot}/%{_libdir}/u4 -name '*.xml' -o -name '*.dtd'|xargs chmod -x
popd
cp mid/*.it %{buildroot}/%{_libdir}/u4/music

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

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

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


%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 Mar 29 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.14.20110329svn2873
- Slightly newer snapshot with more fixes.
- Use the system minizip library instead of the ancient bundled version.

* Tue Mar 29 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.13.20110329svn2869
- Update to latest SVN snapshot.
- Drop gcc46 patch; no longer needed.
- Add buildfix patch.
- Install the .it music files manually so that music works again.
- Switch from $RPM_* to macros with less yelling.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.12.20110124svn2792
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Jan 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.11.20110124svn2792
- Update to latest SVN, just past the beta4 tag made by upstream.
- Add patch for building with gcc46.

* Wed Jan 19 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.10.20110119svn2776
- Update to current SVN.  Upstream indicates that this should fix bug 666631.

* Thu Jan 06 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.9.20110106svn2767
- Update to current SVN now that development has picked back up.
- Update to current Fedora packaging guidelines.
- Turn on parallel make.
- Update download links in autodlrc.

* Tue Jan 19 2010 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.8.20100119svn2725
- Upstream revived!  Now uses SVN; switch everything over to that.
- Provide a checkout script instead of requiring cut-n-paste.
- Use correct versioning (date comes first).
- Drop gcc44 patch; upstream has fixed the issues.

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.7.cvs20090209
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.6.cvs20090209
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Feb 09 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.5.cvs20090209
- Update to latest CVS snapshot - it contains a few minor bugfixes.
- Tweak for gcc 4.4.

* 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