# # spec file for package widelands # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define build_launchpad 0 Name: widelands Version: build18 Release: 0 Summary: Open source realtime-strategy game License: GPL-2.0+ Group: Amusements/Games/Strategy/Other Url: http://www.widelands.org Source0: %{name}-%{version}-src.tar.bz2 Source1: %{name}.desktop Patch1: fix-return-values.diff BuildRequires: SDL_gfx-devel BuildRequires: SDL_image-devel BuildRequires: SDL_mixer-devel BuildRequires: SDL_net-devel BuildRequires: SDL_ttf-devel BuildRequires: boost-devel BuildRequires: cmake BuildRequires: doxygen BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gettext BuildRequires: glew-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: optipng BuildRequires: python-devel BuildRequires: update-desktop-files BuildRequires: zlib-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} >= 1220 BuildRequires: lua51-devel %else BuildRequires: lua-devel %endif Requires: %{name}-data = %{version} %if %build_launchpad Source2: launchpad-export.tar.gz # for launchpad translation update Requires: perl %endif %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. %package data Summary: Data files for Widelands Group: Amusements/Games/Strategy/Other Requires: %{name} = %{version} %if 0%{?suse_version} >= 1120 BuildArch: noarch %endif %description data Data files for Widelands. Including localization, maps graphics and music. %prep %setup -q -n %{name}-%{version}-src %patch1 %if %build_launchpad # for launchpad translation update cd .. tar -xzf %{SOURCE2} find po -name "*.po" |perl -ne 'chomp;$a=$_;$a=~s{/[^/]*-}{/}; rename $_,"widelands/$a";' %endif %build # recreate compile.sh contents here mkdir -p build/locale cd build cmake \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DWL_INSTALL_PREFIX=%{_prefix} \ -DWL_INSTALL_BINDIR=bin \ -DWL_INSTALL_DATADIR=share/%{name} \ -DWL_INSTALL_LOCALEDIR=%{_datadir}/%{name}/locale \ -DCMAKE_BUILD_TYPE="Release" \ -DBoost_USE_STATIC_LIBS=OFF \ .. make %{?_smp_mflags} %install cd build make DESTDIR=%{buildroot} install cd .. for i in 16 32 48 64 128; do install -D -m 0644 pics/wl-ico-${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png done install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop %suse_update_desktop_file %{name} %fdupes %{buildroot}%{_datadir} %find_lang %{name} --all-name %files %defattr(-,root,root,-) %doc COPYING CREDITS ChangeLog %{_bindir}/%{name} %dir %{_datadir}/icons/hicolor %dir %{_datadir}/icons/hicolor/128x128 %dir %{_datadir}/icons/hicolor/128x128/apps %dir %{_datadir}/icons/hicolor/16x16 %dir %{_datadir}/icons/hicolor/16x16/apps %dir %{_datadir}/icons/hicolor/32x32 %dir %{_datadir}/icons/hicolor/32x32/apps %dir %{_datadir}/icons/hicolor/48x48 %dir %{_datadir}/icons/hicolor/48x48/apps %dir %{_datadir}/icons/hicolor/64x64 %dir %{_datadir}/icons/hicolor/64x64/apps %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/applications/%{name}.desktop %files data -f %{name}.lang %defattr(-,root,root,-) %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/locale %dir %{_datadir}/%{name}/locale/* %dir %{_datadir}/%{name}/locale/*/LC_MESSAGES %{_datadir}/%{name}/[^l]* %changelog