Blame 8Kingdoms.spec

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