a8b4d28
%define build_id build15
c521a0d
Name:           widelands
c521a0d
Version:        0
a8b4d28
Release:        0.23.%{build_id}%{?dist}
c521a0d
Summary:        Open source realtime-strategy game
c521a0d
c521a0d
Group:          Amusements/Games
8b06edc
License:        GPLv2+
c521a0d
URL:            http://www.widelands.org
a8b4d28
Source0:        http://launchpad.net/widelands/build15/build15/+download/widelands-%{build_id}-src.tar.bz2
a8b4d28
Patch0:         widelands-gcc45.patch
a8b4d28
Patch1:         widelands-gcc46.patch
c521a0d
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
c521a0d
bde8cef
BuildRequires: SDL_mixer-devel SDL_image-devel SDL_net-devel SDL_ttf-devel
bde8cef
BuildRequires: SDL_gfx-devel boost-devel ggz-base-libs-devel libpng-devel
cdf2fa3
BuildRequires: libjpeg-devel libtiff-devel lua-devel
a8b4d28
BuildRequires: desktop-file-utils cmake gettext ctags optipng
a8b4d28
Requires:      hicolor-icon-theme gnu-free-serif-fonts gnu-free-sans-fonts
c521a0d
c521a0d
%description
c521a0d
Widelands is an open source (GPLed), realtime-strategy game, using SDL and
c521a0d
other free libraries, which is still under development. Widelands is inspired
c521a0d
by Settlers II (Bluebyte) and is partly similar to it, so if you know it, you
c521a0d
perhaps will have a thought, what Widelands is all about. 
c521a0d
c521a0d
c521a0d
%prep
a8b4d28
%setup -q -n widelands-%{build_id}-src
bde8cef
%patch0 -p1
bde8cef
%patch1 -p1
a8b4d28
chmod -x src/scripting/luna.h
bde8cef
c521a0d
c521a0d
%build
a8b4d28
mkdir -p build/compile
a8b4d28
pushd build/compile
a8b4d28
%cmake \
a8b4d28
    -DWL_INSTALL_PREFIX=%{_prefix} \
a8b4d28
    -DWL_INSTALL_BINDIR=%{_bindir} \
a8b4d28
    -DWL_INSTALL_DATADIR=share/%{name} \
a8b4d28
    ../..
a8b4d28
make %{?_smp_mflags}
bde8cef
popd
bde8cef
c521a0d
c521a0d
%install
c521a0d
rm -rf $RPM_BUILD_ROOT
a8b4d28
pushd build/compile
a8b4d28
make install DESTDIR=$RPM_BUILD_ROOT
a8b4d28
popd
c521a0d
c521a0d
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
c521a0d
cp -a pics/wl-logo-64.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
c521a0d
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
c521a0d
cat > widelands.desktop <
c521a0d
[Desktop Entry]
c521a0d
Type=Application
c521a0d
Name=Widelands
c521a0d
GenericName=Realtime Strategy Game
c521a0d
Comment=Build a growing settlement and rule the world
0cf2700
Icon=widelands
c521a0d
Exec=widelands
c521a0d
Categories=Game;StrategyGame;
c521a0d
EOF
c521a0d
a8b4d28
desktop-file-install --vendor="fedora" \
a8b4d28
  --dir=$RPM_BUILD_ROOT%{_datadir}/applications/ %{name}.desktop
c521a0d
bde8cef
pushd $RPM_BUILD_ROOT
a8b4d28
rm usr/share/widelands/fonts/FreeSans.ttf
a8b4d28
rm usr/share/widelands/fonts/FreeSerif.ttf
a8b4d28
ln -s /usr/share/fonts/gnu-free/FreeSans.ttf usr/share/widelands/fonts/FreeSans.ttf
a8b4d28
ln -s /usr/share/fonts/gnu-free/FreeSerif.ttf usr/share/widelands/fonts/FreeSerif.ttf
a8b4d28
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
a8b4d28
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
a8b4d28
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
bde8cef
popd
bde8cef
c521a0d
c521a0d
%clean
c521a0d
rm -rf $RPM_BUILD_ROOT
c521a0d
bde8cef
ef3eeb6
%pre
ef3eeb6
# preparing system before update
ef3eeb6
cat << EOF | while read name; do rm -rf "%{_datadir}/widelands/maps/${name}.wmf"; done
ef3eeb6
Checkmate
ef3eeb6
Dry Riverbed
ef3eeb6
Elven Forests
ef3eeb6
Enemy in sight
ef3eeb6
Finlakes
ef3eeb6
Firegames
ef3eeb6
Four Castles
ef3eeb6
Glacier Lake
ef3eeb6
Golden Peninsula
ef3eeb6
Lake of tranquility
ef3eeb6
Plateau
ef3eeb6
Riverlands
ef3eeb6
The Oasis Triangle
ef3eeb6
The big lake
ef3eeb6
The long way
ef3eeb6
Two frontiers
ef3eeb6
War of the Valleys
ef3eeb6
EOF
ef3eeb6
c521a0d
%post
c521a0d
touch --no-create %{_datadir}/icons/hicolor || :
b9c95c4
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
b9c95c4
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
b9c95c4
fi
c521a0d
c521a0d
%postun
c521a0d
touch --no-create %{_datadir}/icons/hicolor || :
b9c95c4
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
b9c95c4
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
b9c95c4
fi
c521a0d
bde8cef
c521a0d
%files -f %{name}.files
c521a0d
%defattr(-,root,root,-)
a8b4d28
%doc ChangeLog COPYING CREDITS
c521a0d
%{_bindir}/%{name}
c521a0d
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
c521a0d
%{_datadir}/applications/fedora-%{name}.desktop
c521a0d
%dir %{_datadir}/%{name}
c521a0d
%dir %{_datadir}/%{name}/locale
c521a0d
bde8cef
c521a0d
%changelog
a8b4d28
* Tue Feb 15 2011 Hans de Goede <hdegoede@redhat.com> - 0-0.23.build15
a8b4d28
- Rebase to new upstream release build15
a8b4d28
- Fix compilation with gcc-4.6
a8b4d28
91ed9d6
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.22.Build14
91ed9d6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
91ed9d6
442a357
* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0-0.21.Build14
442a357
- rebuild for new boost
442a357
d7f6571
* Mon Aug  2 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.20.Build14
d7f6571
- Fix compilation with gcc-4.5
d7f6571
f0f672c
* Sat Jul 31 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.19.Build14
f0f672c
- Rebuild for Boost soname bump
f0f672c
8257720
* Sat Jan 23 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.18.Build14
8257720
- Fixup %%build_id, which accidentally got bumped in the previous rebuild
8257720
  attempt (#558041)
8257720
c7474d8
* Fri Jan 22 2010 Rahul Sundaram <sundaram@fedoraproject.org> - 0-0.17.Build15
c7474d8
- Rebuild for Boost soname bump
c7474d8
bde8cef
* Fri Jan 15 2010 Hans de Goede <hdegoede@redhat.com> - 0-0.16.Build14
bde8cef
- Rebase to new upstream release Build14
bde8cef
- Fix FTBFS (#511430)
bde8cef
cda114d
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.15.Build13
cda114d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
cda114d
8cb47ce
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.14.Build13
8cb47ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
8cb47ce
d9ea605
* Thu Dec 04 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.13.Build13
d9ea605
- Update to Build13
b53b639
* Sun Nov 16 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.12.Build13rc
b53b639
- Update to Build13rc
b53b639
- Add %%{?_smp_mflags}
36ece56
* Thu Apr 10 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.11.build12
36ece56
- Fix BRs
1e82a3e
* Wed Apr 09 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.10.build12
1e82a3e
- Update to build12
f5c8138
* Sun Feb 10 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.9.build11
f5c8138
- Fix building with gcc43
0cf2700
* Sat Feb 09 2008 Karol Trzcionka <karlikt at gmail.com> - 0-0.8.build11
0cf2700
- Rebuild for gcc43
0cf2700
- Changes in desktop file
ef3eeb6
* Mon Sep 17 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.7.build11
ef3eeb6
- Fix update problems
b9c95c4
* Mon Sep 10 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.6.build11
b9c95c4
- Upgrade to build-11
8b06edc
* Sat Aug 25 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.5.build10
8b06edc
- Patching for compatibility with scons 0.97
8488c74
* Tue May 08 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.4.build10
8488c74
- Change BRs for ppc64
c521a0d
* Sun May 06 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.3.build10
c521a0d
- Changes in .desktop and icon-dir
c521a0d
- Changes in %%postun and %%post sections
c521a0d
- Merge -data subpackage with core package
c521a0d
* Tue May 01 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.2.build10
c521a0d
- Return to first method of versioning
c521a0d
- Some changes in summary and GenericName
c521a0d
- Make spec-file more clear
c521a0d
* Mon Apr 30 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.10.1.build10
c521a0d
- Flagfix
c521a0d
- Change versions numerating
c521a0d
* Sat Apr 28 2007 Karol Trzcionka <karlikt at gmail.com> - 0-0.1.build10
c521a0d
- Initial Release