Blob Blame History Raw
Name:           boswars
Version:        2.4.1
Release:        2%{?dist}
Summary:        Bos Wars is a futuristic real-time strategy game
Group:          Amusements/Games
License:        GPLv2
URL:            http://www.boswars.org/
Source0:        http://www.boswars.org/dist/releases/%{name}-%{version}-src.tar.gz
Source1:        %{name}.desktop
Patch0:         boswars-2.4.1-SConstruct.patch
# incomplete patch to port boswars to the sysytem guichan-0.6 instead of
# using the included guichan-0.4. Incomplete, NOT finished and NOT working!
Patch1:         boswars-2.4.1-guichan26.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  libtheora-devel libvorbis-devel lua-devel SDL-devel libGL-devel
BuildRequires:  tolua++-devel libpng-devel scons desktop-file-utils

%description
Bos Wars is a futuristic real-time strategy game. It is possible to play
against human opponents over LAN, internet, or against the computer.
Bos Wars aims to create a completly original and fun open source RTS game.


%prep
%setup -q -n %{name}-%{version}-src
%patch0 -p1
chmod -x engine/guichan/include/guichan/sdl/sdlgraphics.h \
  engine/include/animation.h engine/guichan/sdl/gsdl.cpp
# we want to use the system version of these
rm engine/tolua/*.h engine/tolua/tolua_*.cpp


%build
scons %{?_smp_mflags} opengl=1 CC="gcc $RPM_OPT_FLAGS" CXX="g++ $RPM_OPT_FLAGS"


%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/languages
install -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}
install -p -m 644 languages/*.po languages/*.pot \
  $RPM_BUILD_ROOT%{_datadir}/%{name}/languages
cp -a campaigns graphics maps scripts sounds units video \
  $RPM_BUILD_ROOT%{_datadir}/%{name}


# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
install -p -m 644 graphics/elites/ui/elites_claw.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png


%clean
rm -rf $RPM_BUILD_ROOT


%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 *.txt CHANGELOG doc/*.html doc/guichan-copyright.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png


%changelog
* Mon Sep 10 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.4.1-2
- Add missing BuildRequires libpng-devel

* Sun Sep  9 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.4.1-1
- Initial Fedora package