122 lines
4.2 KiB
RPMSpec
122 lines
4.2 KiB
RPMSpec
|
# norootforbuild
|
||
|
|
||
|
%define build_id build-11
|
||
|
|
||
|
Name: widelands
|
||
|
Version: 11
|
||
|
Release: 1
|
||
|
Summary: Open source realtime-strategy game
|
||
|
|
||
|
Group: Amusements/Games
|
||
|
License: GPLv2+
|
||
|
URL: http://www.widelands.org
|
||
|
Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{build_id}-source.tar.bz2
|
||
|
Source1: widelands.desktop
|
||
|
Patch0: widelands.flagfix.patch
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
|
||
|
|
||
|
BuildRequires: SDL_mixer-devel SDL_image-devel SDL_net-devel SDL_ttf-devel SDL_gfx-devel
|
||
|
BuildRequires: update-desktop-files scons gettext libpng-devel zlib-devel ctags
|
||
|
BuildRequires: gcc-c++ boost-devel
|
||
|
%ifnarch ppc64
|
||
|
BuildRequires: optipng
|
||
|
%endif
|
||
|
|
||
|
Requires: hicolor-icon-theme
|
||
|
AutoReqProv: On
|
||
|
|
||
|
%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 %{name}
|
||
|
%patch0 -p0
|
||
|
sed -i 's#flagi#%{optflags}##' build/scons-tools/scons_configure.py
|
||
|
#begin porting to gcc43
|
||
|
find src -type f -exec sed -i 's/#include <string>/#include <string>\n#include <cstring>/' {} \; ;
|
||
|
sed -i 's/#include <stdexcept>/#include <stdexcept>\n#include <typeinfo>/' src/main.cc
|
||
|
sed -i 's/#include <algorithm>/#include <algorithm>\n#include <climits>/' src/network.cc
|
||
|
sed -i 's/#include <vector>/#include <vector>\n#include <algorithm>/' src/text_parser.cc
|
||
|
sed -i 's/user_info(std::string name, std::string name, std::string room)/user_info(std::string user, std::string game, std::string room)/' src/ui/ui_fs_menus/fullscreen_menu_inet_lobby.h
|
||
|
sed -i 's/#include <cstdarg>/#include <cstdarg>\n#include <algorithm>/' src/transport.cc
|
||
|
sed -i 's/#include <set>/#include <set>\n#include <algorithm>/' src/editor_game_base.cc
|
||
|
sed -i 's/std::abs/abs/' src/ui/ui_basic/ui_window.cc
|
||
|
sed -i 's/#include <vector>/#include <vector>\n#include <climits>\n#include <cstdlib>/' src/editor/tools/multi_select.h
|
||
|
sed -i 's/#include <vector>/#include <vector>\n#include <climits>\n#include <cstdlib>/' src/filesystem/filesystem.cc
|
||
|
sed -i 's/#include <cstring>/#include <cstring>\n#include <cstdlib>/' src/filesystem/zip_filesystem.cc
|
||
|
#end
|
||
|
|
||
|
%build
|
||
|
scons build=release datadir=%{_datadir}/%{name} bindir=%{_bindir} localedir=%{_datadir}/%{name}/locale build_id=%{build_id}
|
||
|
|
||
|
# ./build-widelands.sh
|
||
|
|
||
|
%install
|
||
|
rm -rf $RPM_BUILD_ROOT
|
||
|
scons datadir=$RPM_BUILD_ROOT%{_datadir}/%{name} bindir=$RPM_BUILD_ROOT%{_bindir} localedir=$RPM_BUILD_ROOT%{_datadir}/%{name} build_id=%{build_id} install
|
||
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/doc
|
||
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/game_server
|
||
|
|
||
|
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
|
||
|
|
||
|
%suse_update_desktop_file -i %{name} Game StrategyGame
|
||
|
|
||
|
cd $RPM_BUILD_ROOT
|
||
|
find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/%{name}/%{name}.files
|
||
|
|
||
|
%clean
|
||
|
rm -rf $RPM_BUILD_ROOT
|
||
|
|
||
|
%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/%{name}.desktop
|
||
|
%dir %{_datadir}/%{name}
|
||
|
%dir %{_datadir}/%{name}/locale
|
||
|
%{_datadir}/%{name}/*s*
|
||
|
|
||
|
%changelog
|
||
|
|