Blob Blame History Raw
Name:           spring
Version:        0.80.5.2
Release:        1%{?dist}
Summary:        Multiplayer, 3D realtime strategy combat game

Group:          Amusements/Games
# Few notes about licensing:
# The main game is GPLv2+
# - AI/Global/RAI/README says that AI is licensed under GPLv3+
# - License for some sounds is LGPLv2 as taken from bzflag.
# - License for some graphics is GFDL and (GFDL or CC-BY). See
#   installer/builddata/bitmaps/README.txt.
License:        GPLv2+ and GPLv3+ and LGPLv2 and GFDL and (GFDL or CC-BY)

URL:            http://springrts.com
Source0:        http://springrts.com/dl/spring_%{version}_src.tar.lzma
Source1:        spring-README.Fedora

# Teach CMake to find allegro
Patch0:         spring-0.80.2-allegro.patch
# http://springrts.com/phpbb/viewtopic.php?f=12&t=21120&p=399610
Patch1:         spring-0.80.5.2-staticlib.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  cmake SDL-devel openal-soft-devel boost-devel DevIL-devel
BuildRequires:  glew-devel libvorbis-devel DevIL-ILUT-devel
BuildRequires:  freetype-devel python-devel allegro-devel zip
BuildRequires:  java-devel-openjdk p7zip-plugins
BuildRequires:  desktop-file-utils

Requires:       spring-lobby spring-installer spring-maps-default

# TODO: split the package
Provides:       spring-dedicated = %{version}-%{release}

# Spring is not supposed to run on Linux/PPC. Noone in the dev team has the
# hardware to test it. Currently, it does not even build. Here's a thread in
# the forums about this issue:
# http://spring.clan-sy.com/phpbb/viewtopic.php?f=20&t=6234
ExcludeArch:    ppc ppc64


%description
Spring is a project aiming to create a new, versatile, full 3D Real Time
Strategy Engine.

Spring is designed to be played as online multiplayer matches, but some AI are
also available to play against the computer.

Please read the README.Fedora file to get started. The Spring wiki is also a
great resource, read it here: http://spring.clan-sy.com/wiki/Main_Page


%prep
%setup -q -n %{name}_%{version}
cp -p %{SOURCE1} README.Fedora
touch ./rts/build/cmake/FindAllegro.cmake
%patch0 -p0 -b .allegro
%patch1 -p0 -b .staticlib
find rts/lib/7z -type f | xargs chmod -x 


%build
# BUILD_SHARED_LIBS = ON causes a build failure:
# http://springrts.com/phpbb/viewtopic.php?f=12&t=21120&p=399610
#       -DBUILD_SHARED_LIBS:BOOL=OFF \
%cmake -DDATADIR:PATH=share/%{name} \
       -DLIBDIR:PATH=%{_lib} \
       .
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

# KAI is deprecated: http://spring.clan-sy.com/phpbb/viewtopic.php?f=20&t=18196
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/AI/Bot-libs/libKAI-0.2.so

# Prepare maps and mods dirs
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/{maps,mods}

# Move icons into proper Freedesktop hicolor theme
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps
mv $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png \
   $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/mimetypes/
mv $RPM_BUILD_ROOT%{_datadir}/pixmaps/application-x-spring-demo.png \
         $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/mimetypes/

# Fix Icon entry
sed -i -e 's/^Icon=\(.*\).png/Icon=\1/g' \
        $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
desktop-file-install  \
        --dir $RPM_BUILD_ROOT%{_datadir}/applications \
        --remove-category Application \
        --delete-original \
        $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop


%post
# Icons
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
# MimeType entry in the desktop file
update-desktop-database &> /dev/null || :
# MIME package
update-mime-database %{_datadir}/mime &> /dev/null || :

%postun
# Icons
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
# MimeType entry in the desktop file
update-desktop-database &> /dev/null || :
# MIME package
update-mime-database %{_datadir}/mime &> /dev/null || :


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE.html README.AUTHORS README.LICENSE README.Fedora Documentation/*
%{_bindir}/*
%{_libdir}/libunitsync.so
%{_libdir}/libspringserver.so
#%{_libdir}/%{name}
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/icons/hicolor/48x48/*/*.png
%{_datadir}/applications/*.desktop
%{_datadir}/%{name}


%changelog
* Sat Nov 21 2009 Aurelien Bompard <abompard@fedoraproject.org> -  0.80.5.2-1
- New release: 0.80.5.2

* Sun Sep 20 2009 Aurelien Bompard <abompard@fedoraproject.org> -  0.80.4.2-1
- New release: 0.80.4.2 (bugfix)

* Sat Sep 05 2009 Aurelien Bompard <abompard@fedoraproject.org> -  0.80.4.1-1
- New release: 0.80.4.1 (bugfix)

* Thu Sep 03 2009 Aurelien Bompard <abompard@fedoraproject.org> -  0.80.4-1
- New release: 0.80.4

* Sat Aug 22 2009 Aurelien Bompard <abompard@fedoraproject.org> -  0.80.2-1
- New release: 0.80.2

* Wed Aug 12 2009 Ville Skyttä <ville.skytta@iki.fi> - 0.79.1.2-4
- Use lzma compressed upstream tarball.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.79.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sun Jul 19 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.79.1.2-2
- use OpenJDK's version of Java

* Sat Jul 18 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.79.1.2-1
- version 0.79.1.2
- remove obsolete fonts hack
- build dedicated server

* Sat May 23 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.79.0.2-1
- version 0.79.0.2
- update URL

* Sun Mar 22 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-9
- exclude KAI, since it's deprecated
  (http://spring.clan-sy.com/phpbb/viewtopic.php?f=20&t=18196)

* Tue Mar 17 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-8
- use relative symlinks for the fonts
- fix perms in the 7zip sources
- handle the font package rename in F11

* Sun Mar 15 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-7
- add info about licensing
- use system fonts

* Mon Feb 02 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-6
- use cmake, as requested by upstream:
  http://spring.clan-sy.com/phpbb/viewtopic.php?p=330802#p330802

* Mon Feb 02 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-5
- use Fedora's compilation flags

* Sun Feb 01 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-4
- fix x86_64 build

* Sun Jan 18 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-2
- remove trademarks from summary and description
- add patch for python 2.6
- fix detection of devil libraries

* Sun Jan 18 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.2.1-1
- update to 0.78.2.1 (bugfix release)

* Sun Jan 18 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.1.1-2
- Other changes from the review:
  - remove Cmake-specific patch
  - drop meta-package

* Sat Jan 17 2009 Aurelien Bompard <abompard@fedoraproject.org> 0.78.1.1-1
- Implement changes from the review (#478767):
  - improve description
  - add a README.Fedora file
  - remove commas from (build)requires
  - remove vendor from the desktop file
  - update to version 0.78.1.1

* Sun Jul 09 2006 Aurelien Bompard <abompard@fedoraproject.org> 0.77-1.b5
- initial package