Blob Blame History Raw
Name:           boswars
Version:        2.5
Release:        4%{?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
Patch2:         boswars-2.4.1-gcc43.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
Requires:       hicolor-icon-theme xorg-x11-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
%patch2 -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 intro maps scripts sounds units \
  $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/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
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Feb 21 2009 Hans de Goede <hdegoede@redhat.com> 2.5-2
- Fix build with gcc 4.4

* Sun Mar  2 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 2.5-1
- New upstream release 2.5

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.4.1-5
- Autorebuild for GCC 4.3

* Sat Jan 12 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 2.4.1-4
- Fix compilation with gcc 4.3
- Drop workaround for intel graphics crash, this is "fixed" in SDL now

* Tue Oct 30 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.4.1-3
- Add workaround for boswars crashing on intel integrated video (bz 310841)

* 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