aa911fa
%define svndate 20150221
aa911fa
%define svnrev 3087
813bcf2
813bcf2
Name:           xu4
813bcf2
Version:        1.1
76c787a
Release:        0.23.%{svndate}svn%{svnrev}%{?dist}
813bcf2
Summary:        Ultima IV recreated
813bcf2
Group:          Amusements/Games
baf002e
License:        GPLv2+
813bcf2
URL:            http://xu4.sourceforge.net/
926b55c
# This was generated by running the xu4-svn-checkout.sh script
926b55c
Source0:        xu4-%{svndate}svn.tar.xz
813bcf2
Source1:        xu4.sh
813bcf2
Source2:        xu4.autodlrc
813bcf2
Source3:        u4download.txt
264b9c7
Patch0:         xu4-1.0beta3-desktop.patch
264b9c7
Patch1:         xu4-1.1-unbundle.patch
2cc6292
Patch2:         xu4-1.1-format-security.patch
44b3541
BuildRequires:  SDL_mixer-devel libxml2-devel minizip-devel
2cc6292
BuildRequires:  libicns-utils libpng-devel desktop-file-utils
813bcf2
Requires:       hicolor-icon-theme autodownloader
813bcf2
813bcf2
%description
813bcf2
XU4 is a remake of the computer game Ultima IV. This game requires the
813bcf2
original Ultima IV datafiles, which can be freely downloaded from the internet
813bcf2
but may not be (re)distributed. When you start xu4 for the first time it will
813bcf2
offer to download the datafiles for you.
813bcf2
813bcf2
XU4 isn't a new game based on the Ultima IV story -- it is a faithful
813bcf2
recreation of the old game, right up to the crappy graphics.  If you
813bcf2
are looking for a game with modern gameplay and graphics, this is not
813bcf2
it -- yet.  New features that improve the gameplay and keep with the
813bcf2
spirit of the original game will be added.
813bcf2
813bcf2
813bcf2
%prep
2cc6292
%autosetup -p1 -n u4
813bcf2
if [ "%{_lib}" = "lib64" ]; then
813bcf2
  sed -i 's|/usr/lib|%{_libdir}|g' src/u4file.cpp
813bcf2
fi
813bcf2
cp %{SOURCE3} .
813bcf2
813bcf2
813bcf2
%build
813bcf2
pushd src
44b3541
make DEBUGCXXFLAGS="%{optflags}" EXTRALIBS=-lminizip\
e76ebd8
  bindir=%{_bindir} datadir=%{_datadir} libdir=%{_libdir} %{?_smp_mflags}
813bcf2
popd
813bcf2
2cc6292
# The apple icns file has a higher resolution icon, but still not 256x256.
2cc6292
pushd icons
2cc6292
icns2png -x xu4.icns
2cc6292
popd
813bcf2
813bcf2
%install
813bcf2
pushd src
44b3541
# Note: make install DESTDIR=%%{buildroot}, doesn't work
813bcf2
%{makeinstall}
fd9231e
find %{buildroot}/%{_libdir}/u4 -name '*.xml' -o -name '*.dtd'|xargs chmod -x
813bcf2
popd
Parag Nemade 5b4d817
cp -p mid/*.it %{buildroot}/%{_libdir}/u4/music
813bcf2
813bcf2
# mv u4 to u4.bin and install our autodl wrapper script
fd9231e
mv %{buildroot}/%{_bindir}/u4 %{buildroot}/%{_bindir}/u4.bin
fd9231e
install -p -m 755 %{SOURCE1} %{buildroot}/%{_bindir}/u4
fd9231e
install -p -m 644 %{SOURCE2} %{buildroot}/%{_libdir}/u4
813bcf2
813bcf2
# below is the desktop file and icon stuff.
2cc6292
desktop-file-install \
2cc6292
    --dir %{buildroot}/%{_datadir}/applications \
2cc6292
    --delete-original \
2cc6292
    %{buildroot}/%{_datadir}/applications/u4.desktop
813bcf2
2cc6292
mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/128x128/apps
2cc6292
install -p -m 655 icons/xu4_128x128x32.png \
2cc6292
     %{buildroot}/%{_datadir}/icons/hicolor/128x128/apps/u4.png
2cc6292
rm -rf %{buildroot}/%{_datadir}/pixmaps
813bcf2
813bcf2
813bcf2
%post
264b9c7
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
813bcf2
813bcf2
%postun
264b9c7
if [ $1 -eq 0 ]; then
264b9c7
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
264b9c7
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
baf002e
fi
813bcf2
264b9c7
%posttrans
264b9c7
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
813bcf2
813bcf2
%files
813bcf2
%doc AUTHORS COPYING README doc/Algorithms.* doc/*FileFormats.txt
813bcf2
%doc doc/U4Notes.txt doc/tools.txt u4download.txt
813bcf2
%{_bindir}/u4*
813bcf2
%{_libdir}/u4
Parag Nemade 5b4d817
%{_datadir}/applications/u4.desktop
2cc6292
%{_datadir}/icons/hicolor/128x128/apps/u4.png
813bcf2
813bcf2
813bcf2
%changelog
76c787a
* Tue Feb 24 2015 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.23.20150221svn3087
76c787a
- Oops, I screwed up and made the version go backwards.
76c787a
aa911fa
* Sat Feb 21 2015 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.1.20150221svn3087
aa911fa
- Update from SVN.
2cc6292
- Extract higher resulution icon from macos .icns archive.
2cc6292
- Fix a format-security error.
aa911fa
5591ab6
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.22.20120106svn2999
5591ab6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
5591ab6
20ad205
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.21.20120106svn2999
20ad205
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
20ad205
a0b4883
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.20.20120106svn2999
a0b4883
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a0b4883
Parag Nemade 5b4d817
* Sun Feb 10 2013 Parag Nemade <paragn AT fedoraproject DOT org> - 1.1-0.19.20120106svn2999
Parag Nemade 5b4d817
- Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077
Parag Nemade 5b4d817
- Cleanup spec as per recently changed packaging guidelines
Parag Nemade 5b4d817
9a9aa58
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.18.20120106svn2999
9a9aa58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9a9aa58
fc13211
* Fri Jan 06 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.17.20120106svn2999
fc13211
- Update to latest SVN.
fc13211
264b9c7
* Thu Dec 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.16.20111215svn2997
264b9c7
- Update to new snapshot, fixing (among other things) the libpng build issue.
264b9c7
- Remove unneeded zipfile patch.
264b9c7
- Use recommended gtk icon cache scriptlets.
264b9c7
f55ff19
* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 1.1-0.15.20110329svn2873
f55ff19
- Rebuild for new libpng
f55ff19
44b3541
* Tue Mar 29 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.14.20110329svn2873
44b3541
- Slightly newer snapshot with more fixes.
44b3541
- Use the system minizip library instead of the ancient bundled version.
44b3541
fd9231e
* Tue Mar 29 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.13.20110329svn2869
fd9231e
- Update to latest SVN snapshot.
fd9231e
- Drop gcc46 patch; no longer needed.
fd9231e
- Add buildfix patch.
fd9231e
- Install the .it music files manually so that music works again.
fd9231e
- Switch from $RPM_* to macros with less yelling.
fd9231e
f9062c4
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.12.20110124svn2792
f9062c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f9062c4
2966ded
* Mon Jan 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.11.20110124svn2792
2966ded
- Update to latest SVN, just past the beta4 tag made by upstream.
2966ded
- Add patch for building with gcc46.
2966ded
eecc59a
* Wed Jan 19 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.10.20110119svn2776
eecc59a
- Update to current SVN.  Upstream indicates that this should fix bug 666631.
eecc59a
e76ebd8
* Thu Jan 06 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.9.20110106svn2767
e76ebd8
- Update to current SVN now that development has picked back up.
e76ebd8
- Update to current Fedora packaging guidelines.
e76ebd8
- Turn on parallel make.
e76ebd8
- Update download links in autodlrc.
e76ebd8
926b55c
* Tue Jan 19 2010 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.8.20100119svn2725
926b55c
- Upstream revived!  Now uses SVN; switch everything over to that.
926b55c
- Provide a checkout script instead of requiring cut-n-paste.
926b55c
- Use correct versioning (date comes first).
926b55c
- Drop gcc44 patch; upstream has fixed the issues.
926b55c
e8b2c6c
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.7.cvs20090209
e8b2c6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e8b2c6c
26db99c
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-0.6.cvs20090209
26db99c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
26db99c
a2b4b89
* Mon Feb 09 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.1-0.5.cvs20090209
a2b4b89
- Update to latest CVS snapshot - it contains a few minor bugfixes.
a2b4b89
- Tweak for gcc 4.4.
a2b4b89
8da0723
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1-0.4.cvs20070510
8da0723
- Autorebuild for GCC 4.3
8da0723
d066de6
* Fri Jan 11 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1-0.3.cvs20070510
d066de6
- Fix compilation with gcc 4.3
d066de6
baf002e
* Wed Aug 15 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1-0.2.cvs20070510
baf002e
- Update License tag for new Licensing Guidelines compliance
baf002e
813bcf2
* Fri May 11 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1-0.1.20070510
813bcf2
- Update to latest CVS, as this actually makes the game finishable
813bcf2
- Add missing BuildRequires: desktop-file-utils
813bcf2
- Add u4download.txt to the docs
813bcf2
813bcf2
* Thu Feb  1 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.0-0.1.beta3
813bcf2
- Initial Fedora Extras package