Blob Blame History Raw
%define build_id build16
Name:           widelands
Version:        0
Release:        0.24.%{build_id}%{?dist}
Summary:        Open source realtime-strategy game

Group:          Amusements/Games
License:        GPLv2+
URL:            http://www.widelands.org
Source0:        http://launchpad.net/widelands/%{build_id}/%{build_id}/+download/widelands-%{build_id}-src.tar.bz2

BuildRequires: SDL_mixer-devel SDL_image-devel SDL_net-devel SDL_ttf-devel
BuildRequires: SDL_gfx-devel boost-devel ggz-base-libs-devel libpng-devel
BuildRequires: libjpeg-devel libtiff-devel lua-devel glew-devel
BuildRequires: desktop-file-utils cmake gettext ctags optipng
Requires:      hicolor-icon-theme gnu-free-serif-fonts gnu-free-sans-fonts

%description
Widelands is an open source (GPLed), realtime-strategy game, using SDL and
other free libraries, which is still under development. Widelands is inspired
by Settlers II (Bluebyte) and is partly similar to it, so if you know it, you
perhaps will have a thought, what Widelands is all about. 


%prep
%setup -q -n widelands-%{build_id}-src


%build
mkdir -p build/compile
pushd build/compile
%cmake \
    -DWL_INSTALL_PREFIX=%{_prefix} \
    -DWL_INSTALL_BINDIR=%{_bindir} \
    -DWL_INSTALL_DATADIR=share/%{name} \
    ../..
make %{?_smp_mflags}
popd


%install
pushd build/compile
make install DESTDIR=$RPM_BUILD_ROOT
popd

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
cp -a pics/wl-logo-64.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > widelands.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Widelands
GenericName=Realtime Strategy Game
Comment=Build a growing settlement and rule the world
Icon=widelands
Exec=widelands
Categories=Game;StrategyGame;
EOF

desktop-file-install --vendor="fedora" \
  --dir=$RPM_BUILD_ROOT%{_datadir}/applications/ %{name}.desktop

pushd $RPM_BUILD_ROOT
rm usr/share/widelands/fonts/FreeSans.ttf
rm usr/share/widelands/fonts/FreeSerif.ttf
ln -s /usr/share/fonts/gnu-free/FreeSans.ttf usr/share/widelands/fonts/FreeSans.ttf
ln -s /usr/share/fonts/gnu-free/FreeSerif.ttf usr/share/widelands/fonts/FreeSerif.ttf
find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/widelands-%{build_id}-src/%{name}.files
find usr/share/widelands/locale/ -maxdepth 1 -type d ! -name "*_*" | sed -n -e 's#\(usr/share/widelands/locale/\(.\+\)\)#%lang(\2) /\1#p' >> %{_builddir}/widelands-%{build_id}-src/%{name}.files
find usr/share/widelands/ -mindepth 1 -maxdepth 1 -not -name locale | sed -n 's#\(usr/share/widelands/*\)#/\1#p' >> %{_builddir}/widelands-%{build_id}-src/%{name}.files
popd


%pre
# preparing system before update
cat << EOF | while read name; do rm -rf "%{_datadir}/widelands/maps/${name}.wmf"; done
Checkmate
Dry Riverbed
Elven Forests
Enemy in sight
Finlakes
Firegames
Four Castles
Glacier Lake
Golden Peninsula
Lake of tranquility
Plateau
Riverlands
The Oasis Triangle
The big lake
The long way
Two frontiers
War of the Valleys
EOF

%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 -f %{name}.files
%defattr(-,root,root,-)
%doc ChangeLog COPYING CREDITS
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{_datadir}/applications/fedora-%{name}.desktop
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/locale


%changelog
* Wed Apr 27 2011 Hans de Goede <hdegoede@redhat.com> - 0-0.24.build16
- Rebase to new upstream release build16
- This also fixes a security vulnerability in internet play (#684924)

* Tue Feb 15 2011 Hans de Goede <hdegoede@redhat.com> - 0-0.23.build15
- Rebase to new upstream release build15
- Fix compilation with gcc-4.6

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.22.Build14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0-0.21.Build14
- rebuild for new boost

* Mon Aug  2 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.20.Build14
- Fix compilation with gcc-4.5

* Sat Jul 31 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.19.Build14
- Rebuild for Boost soname bump

* Sat Jan 23 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.18.Build14
- Fixup %%build_id, which accidentally got bumped in the previous rebuild
  attempt (#558041)

* Fri Jan 22 2010 Rahul Sundaram <sundaram@fedoraproject.org> - 0-0.17.Build15
- Rebuild for Boost soname bump

* Fri Jan 15 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.16.Build14
- Rebase to new upstream release Build14
- Fix FTBFS (#511430)

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.15.Build13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.14.Build13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Dec 04 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.13.Build13
- Update to Build13
* Sun Nov 16 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.12.Build13rc
- Update to Build13rc
- Add %%{?_smp_mflags}
* Thu Apr 10 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.11.build12
- Fix BRs
* Wed Apr 09 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.10.build12
- Update to build12
* Sun Feb 10 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.9.build11
- Fix building with gcc43
* Sat Feb 09 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.8.build11
- Rebuild for gcc43
- Changes in desktop file
* Mon Sep 17 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.7.build11
- Fix update problems
* Mon Sep 10 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.6.build11
- Upgrade to build-11
* Sat Aug 25 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.5.build10
- Patching for compatibility with scons 0.97
* Tue May 08 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.4.build10
- Change BRs for ppc64
* Sun May 06 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.3.build10
- Changes in .desktop and icon-dir
- Changes in %%postun and %%post sections
- Merge -data subpackage with core package
* Tue May 01 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.2.build10
- Return to first method of versioning
- Some changes in summary and GenericName
- Make spec-file more clear
* Mon Apr 30 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.10.1.build10
- Flagfix
- Change versions numerating
* Sat Apr 28 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.1.build10
- Initial Release