Blob Blame History Raw
%global buildno 18
%global buildid build%{buildno}
%global build_id build-%{buildno}

Name:           widelands
Version:        0
Release:        0.57.%{buildid}%{?dist}
Summary:        Open source realtime-strategy game

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

BuildRequires: SDL-devel >= 1.2.11
BuildRequires: SDL_gfx-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel >= 1.2.6
BuildRequires: SDL_net-devel
BuildRequires: SDL_sound-devel
BuildRequires: SDL_ttf-devel >= 2.0.0
BuildRequires: boost-devel >= 1.47.0
BuildRequires: boost-static >= 1.47.0
BuildRequires: cmake
BuildRequires: ctags
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: ggz-base-libs-devel
BuildRequires: glew-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: optipng
%if 0%{?fedora} >= 20
BuildRequires: compat-lua-devel
%else
BuildRequires: lua-devel
%endif
Requires:      drehatlas-widelands-fonts
Requires:      gnu-free-serif-fonts
Requires:      gnu-free-sans-fonts
Requires:      hicolor-icon-theme

%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-%{buildid}-src


%build
mkdir -p build/compile
pushd build/compile
# We need to set CMAKE_INCLUDE_PATH to /usr for FindLua51.cmake
%cmake \
    -DCMAKE_INCLUDE_PATH=%{_prefix} \
    -DWL_INSTALL_PREFIX=%{_prefix} \
    -DWL_INSTALL_BINDIR=%{_bindir} \
    -DWL_INSTALL_DATADIR=share/%{name} \
    ../..
make %{?_smp_mflags}
popd


%install
pushd build/compile
%make_install
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  \
  --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
rm usr/share/widelands/fonts/Widelands/*
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
ln -s /usr/share/fonts/drehatlas-widelands/Widelands.otf usr/share/widelands/fonts/Widelands/Widelands.ttf
find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/widelands-%{buildid}-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-%{buildid}-src/%{name}.files
find usr/share/widelands/ -mindepth 1 -maxdepth 1 -not -name locale | sed -n 's#\(usr/share/widelands/*\)#/\1#p' >> %{_builddir}/widelands-%{buildid}-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 &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files -f %{name}.files
%doc ChangeLog COPYING CREDITS
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/locale


%changelog
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.57.build18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.56.build18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Jan 27 2017 Jonathan Wakely <jwakely@redhat.com> - 0-0.55.build18
- Rebuilt for Boost 1.63

* Tue Jan 10 2017 Orion Poplawski <orion@cora.nwra.com> - 0-0.54.build18
- Rebuild for glew 2.0.0

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.53.build18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Jan 16 2016 Jonathan Wakely <jwakely@redhat.com> - 0-0.52.build18
- Rebuilt for Boost 1.60

* Thu Jan 14 2016 Adam Jackson <ajax@redhat.com> - 0-0.51.build18
- Rebuild for glew 1.13

* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 0-0.50.build18
- Rebuilt for Boost 1.59

* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.49.build18
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159

* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 0-0.48.build18
- rebuild for Boost 1.58

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.47.build18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0-0.46.build18
- Rebuilt for GCC 5 C++11 ABI change

* Tue Jan 27 2015 Petr Machata <pmachata@redhat.com> - 0-0.45.build18
- Rebuild for boost 1.57.0

* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.44.build18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Fri Jun 13 2014 Hans de Goede <hdegoede@redhat.com> - 0-0.43.build18
- Update to new upstream Build18 release (rhbz#1085517)
- Rebuild for new SDL_gfx

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.42.build17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 0-0.41.build17
- Rebuild for boost 1.55.0

* Tue Dec 03 2013 Nils Philippsen <nils@redhat.com> - 0-0.40.build17
- use string literals as format strings (#1037384)

* Mon Nov 18 2013 Dave Airlie <airlied@redhat.com> - 0-0.39.build17
- rebuilt for GLEW 1.10

* Sun Aug 04 2013 Hans de Goede <hdegoede@redhat.com> - 0-0.38.build17
- Build with compat-lua on f20+

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.37.build17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Jul 30 2013 Petr Machata <pmachata@redhat.com> - 0-0.36.build17
- Rebuild for boost 1.54.0

* Sat Feb 09 2013 Parag Nemade <paragn AT fedoraproject DOT org> - 0-0.35.build17
- Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077
- Cleanup spec as per recently changed packaging guidelines

* Thu Dec 13 2012 Adam Jackson <ajax@redhat.com> - 0-0.34.build17
- Rebuild for glew 1.9.0

* Sat Jul 28 2012 Hans de Goede <hdegoede@redhat.com> - 0-0.33.build17
- Rebuilt for new GLEW

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.32.build17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jun 25 2012 Nils Philippsen <nils@redhat.com> - 0-0.31.build17
- Rebase to new upstream release build17
- Unclutter, versionize requirements

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.30.build16
- Rebuilt for c++ ABI breakage

* Tue Jan 10 2012 Nils Philippsen <nils@redhat.com> - 0-0.29.build16
- rebuild for gcc 4.7

* Tue Dec 06 2011 Hans de Goede <hdegoede@redhat.com> - 0-0.28.build16
- Fix building with libpng-1.5

* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 0-0.27.build16
- Rebuild for new libpng

* Sat Jul 16 2011 Hans de Goede <hdegoede@redhat.com> - 0-0.26.build16
- Rebuild for new SDL_gfx
- Require and link to drehatlas-widelands-fonts instead of shipping
  a private copy (#477483)
- Fix a patch on toplevel messageboxes (#718130)

* Mon Jun 20 2011 ajax@redhat.com - 0-0.25.build16
- Rebuild for new glew soname

* 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