Blame 8Kingdoms.spec

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