Blame 8Kingdoms.spec

83da7d8
# Copyright (c) 2007 oc2pus <toni@links2linux.de>
83da7d8
# Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs.nl>
83da7d8
# This file and all modifications and additions to the pristine
83da7d8
# package are under the same license as the package itself.
83da7d8
83da7d8
Name:           8Kingdoms
83da7d8
Version:        1.1.0
abd34cd
Release:        4%{?dist}
83da7d8
Summary:        8 Kingdoms is a 3D turn-based fantasy strategic game
83da7d8
Group:          Amusements/Games
83da7d8
License:        GPL+
83da7d8
URL:            http://kralovstvi.sourceforge.net/
83da7d8
# This is:
83da7d8
# http://downloads.sourceforge.net/kralovstvi/%{name}-%{version}.tar.gz
83da7d8
# With external/extgl.h removed, as that contains parts of Windows gl.h and
83da7d8
# parts of a version of glext.h which falls under the "SGI Free Software
83da7d8
# License B", neither which are Free software.
83da7d8
Source0:        %{name}-%{version}.tar.gz
83da7d8
# This is a Free replacement file with the troublesome parts replaced with
83da7d8
# parts from Mesa's gl.h and from The Kronos Group glext.h .
83da7d8
Source1:        extgl.h
83da7d8
Source2:        %{name}.desktop
83da7d8
Source3:        %{name}.png
83da7d8
Patch0:         8Kingdoms-1.1.0-64bit.patch
83da7d8
Patch1:         8Kingdoms-1.1.0-locking.patch
2b55dc2
Patch2:         8Kingdoms-1.1.0-crash.patch
abd34cd
Patch3:         8Kingdoms-1.1.0-gcc43.patch
abd34cd
Patch4:         8Kingdoms-1.1.0-divide-by-zero.patch
abd34cd
Patch5:         8Kingdoms-1.1.0-cvs-fixes.patch
83da7d8
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
83da7d8
BuildRequires:  expat-devel SDL_mixer-devel tcl-devel desktop-file-utils
83da7d8
Requires:       hicolor-icon-theme opengl-games-utils
83da7d8
83da7d8
%description
83da7d8
8 Kingdoms is a 3D turn-based fantasy strategic game in which
83da7d8
players become kings, build their empires and conquer enemy
83da7d8
kingdoms.
83da7d8
83da7d8
Theme of the game 8 Kingdoms is inspirated by the world of fantasy.
83da7d8
Players play on a fully 3D hex map. They construct buildings,
83da7d8
recruit units including infantry, mounted units, mages, catapults
83da7d8
and finally they attack enemy or help allies. Units gain experiences
83da7d8
during the battle, each unit can get some abilities upgraded to be
83da7d8
stronger. Data are stored in XML and freely accessible - from
83da7d8
language versions to units' attributes, moreover map editor with
83da7d8
random map generator is included for comfortable map editing.
83da7d8
83da7d8
83da7d8
%prep
83da7d8
%setup -q
83da7d8
%patch0 -p1
83da7d8
%patch1 -p1
2b55dc2
%patch2 -p1
abd34cd
%patch3 -p1
abd34cd
%patch4 -p1
abd34cd
%patch5 -p1
83da7d8
cp -a %{SOURCE1} external
83da7d8
chmod -x doc/gui/gui_img1.png
83da7d8
# configure won't recognize --datadir ...
83da7d8
sed -i 's|games/8Kingdoms|share/8Kingdoms|g' configure
83da7d8
83da7d8
83da7d8
%build
83da7d8
%configure
83da7d8
make %{?_smp_mflags}
83da7d8
83da7d8
83da7d8
%install
83da7d8
rm -rf $RPM_BUILD_ROOT
83da7d8
# And here we must explicitly set pkgdatadir despite our earlier sed!
83da7d8
make install DESTDIR=$RPM_BUILD_ROOT pkgdatadir=%{_datadir}/%{name}
83da7d8
ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/%{name}-wrapper
83da7d8
83da7d8
# below is the desktop file and icon stuff.
83da7d8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
83da7d8
desktop-file-install --vendor fedora            \
83da7d8
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
83da7d8
  %{SOURCE2}
83da7d8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/96x96/apps
83da7d8
install -p -m 644 %{SOURCE3} \
83da7d8
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/96x96/apps
83da7d8
83da7d8
83da7d8
%clean
83da7d8
rm -rf $RPM_BUILD_ROOT
83da7d8
83da7d8
83da7d8
%post
83da7d8
touch --no-create %{_datadir}/icons/hicolor || :
83da7d8
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
83da7d8
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
83da7d8
fi
83da7d8
83da7d8
%postun
83da7d8
touch --no-create %{_datadir}/icons/hicolor || :
83da7d8
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
83da7d8
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
83da7d8
fi
83da7d8
83da7d8
83da7d8
%files
83da7d8
%defattr(-,root,root,-)
83da7d8
%doc AUTHORS ChangeLog COPYING README doc/*
83da7d8
%{_bindir}/%{name}*
83da7d8
%{_datadir}/%{name}
83da7d8
%{_datadir}/applications/fedora-%{name}.desktop
83da7d8
%{_datadir}/icons/hicolor/96x96/apps/%{name}.png
83da7d8
83da7d8
83da7d8
%changelog
abd34cd
* Fri Jan  4 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-4
abd34cd
- Fix divide by zero abort (bz 427485)
abd34cd
- Backport various fixes from CVS
abd34cd
2b55dc2
* Thu Jan  3 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-3
abd34cd
- Fix compiling with gcc 4.3
2b55dc2
- Fix crash undercertain conditions (bz 425799)
2b55dc2
83da7d8
* Sun Dec  2 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-2
83da7d8
- Replace BuildRequires expat with expat-devel (oops)
83da7d8
- Add a patch which stops 8Kingdoms from hanging in certain cases
83da7d8
- Use opengl-games-utils wrapper to show error dialog when DRI is missing
83da7d8
83da7d8
* Sat Nov 24 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-1
83da7d8
- Adapted Packman specfile for Fedora
83da7d8
83da7d8
* Fri Aug 10 2007 Toni Graffy <toni@links2linux.de> - 1.1.0-0.pm.1
83da7d8
- initial build 1.1.0