%global develdocdir %{_docdir}/%{name}-devel/html %global commit 570ba7a8adc7973327ae612a3d535fd8621c41dd %global date 20180321 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: openclonk Summary: Multiplayer action, tactics and skill game Version: 8.1 Release: 5.%{date}git%{shortcommit}%{?dist} URL: http://www.openclonk.org/ Source0: https://github.com/openclonk/openclonk/archive/v%{commit}.tar.gz#/%{name}-%{commit}.zip License: ISC and CC-BY-SA Group: Amusements/Games Source1: %{name}-html-de.desktop Source2: %{name}-html-en.desktop Source3: %{name}-docs.png BuildRequires: boost-devel BuildRequires: cmake, gcc, gcc-c++ BuildRequires: gtest-devel BuildRequires: libjpeg-devel BuildRequires: tinyxml-devel BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(SDL2_mixer) BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(freealut) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtksourceview-3.0) BuildRequires: pkgconfig(libpng12) BuildRequires: pkgconfig(libupnp) BuildRequires: pkgconfig(ogg) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(sdl) BuildRequires: pkgconfig(vorbis) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xpm) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(xml2po) BuildRequires: qt5-qtbase-devel BuildRequires: readline-devel BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: libxslt BuildRequires: gettext BuildRequires: libxml2-devel BuildRequires: gtk3-devel Requires: %{name}-data = %{version}-%{release} Requires: hicolor-icon-theme Provides: bundled(timsort) %description Clonk is a multiplayer-action-tactics-skill game. It is often referred to as a mixture of The Settlers and Worms. In a simple 2D antfarm-style landscape, the player controls his crew of Clonks, small but robust humanoid beings. The game encourages free play but the normal goal is to either exploit valuable resources from the earth by building a mine or fight each other on an arena-like map. %package data Summary: %{summary} Requires: %{name} = %{version} BuildArch: noarch %description data This package contains the data files for openclonk. %package devel-docs Summary: Documentation for developing programs that will use %{name} Group: Documentation BuildArch: noarch Requires: xdg-utils %description devel-docs This package contains documentation needed for developing with %{name}. %prep %autosetup -n %{name}-%{commit} # remove bundled tinyxml rm -rf thirdparty/tinyxml # remove bundled getopt rm -rf thirdparty/getopt # remove bundled natupnp rm -rf thirdparty/natupnp rm -rf planet/Tests.c4f # change permission in src and docs folder find src -type f | xargs chmod -v 644 find docs -type f | xargs chmod -v 644 find docs -type d | xargs chmod -v 755 # change permission due rpmlint W: spurious-executable-perm chmod a-x README Credits.txt thirdparty/timsort/sort.h \ COPYING TRADEMARK licenses/* # Set directory for datafiles sed -e 's|share/games/openclonk|share/openclonk|g' -i CMakeLists.txt cp -p planet/COPYING COPYING-planet %build mkdir -p build && cd build # -Werror=format-security/ flag prevents compilation # https://github.com/openclonk/openclonk/issues/64 export LDFLAGS="$RPM_LD_FLAGS" SETOPT_FLAGS=$(echo "%{optflags}" | sed -e 's/-Werror=format-security/-Wno-error=format-security/g') %cmake -Wno-cpp -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_FLAGS:STRING="$SETOPT_FLAGS" \ -DCMAKE_EXE_LINKER_FLAGS:STRING="$RPM_LD_FLAGS" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ -DCMAKE_SKIP_RPATH:BOOL=NO -DWITH_AUTOMATIC_UPDATE:BOOL=OFF \ -DUSE_X11:BOOL=ON -DUSE_GTK:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=NO \ -DUSE_STATIC_BOOST=OFF -DUSE_SYSTEM_TINYXML=ON \ %if 0%{?fedora} > 27 -DUSE_GCC_STYLE_LTCG:BOOL=OFF .. %else -DUSE_GCC_STYLE_LTCG:BOOL=ON .. %endif %make_build # build the German and English HTML-documentation from the English \ # XML-source files and the translation file pushd ../docs mkdir -p sdk-de/{definition,folder,material,particle,scenario,script/fn} make %{?_smp_mflags} chm/de/Entwickler.chm make %{?_smp_mflags} chm/en/Developer.chm popd %install %make_install -C build mv $RPM_BUILD_ROOT%{_prefix}/games/openclonk $RPM_BUILD_ROOT%{_bindir} desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop # Move upstream appdata file to metainfo/ directory mkdir -p $RPM_BUILD_ROOT%{_datadir}/metainfo mv $RPM_BUILD_ROOT%{_datadir}/appdata/*.appdata.xml $RPM_BUILD_ROOT%{_datadir}/metainfo/ rm -rf $RPM_BUILD_ROOT%{_datadir}/appdata appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/*.appdata.xml # install html docs to %%{_docdir}/%%{name}-devel/html mkdir -p $RPM_BUILD_ROOT%{develdocdir}/{de,en} cp -pr docs/chm/de $RPM_BUILD_ROOT%{develdocdir}/ cp -pr docs/chm/en $RPM_BUILD_ROOT%{develdocdir}/ # W: wrong-file-end-of-line-encoding sed -i 's/\r$//' $RPM_BUILD_ROOT%{develdocdir}/de/Output.hhp sed -i 's/\r$//' $RPM_BUILD_ROOT%{develdocdir}/en/Output.hhp # W: file-not-utf8 iconv -f iso8859-1 -t utf-8 $RPM_BUILD_ROOT%{develdocdir}/de/Output.hhk > \ Output.hhk.conv && mv -f Output.hhk.conv $RPM_BUILD_ROOT%{develdocdir}/de/Output.hhk # HTML desktop files desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1} desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE2} # Set main desktop file (bz#1454638) desktop-file-edit --set-key=Exec --set-value="env WAYLAND_DISPLAY= openclonk" \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps install -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}-docs.png %files %doc Version.txt README TRADEMARK Credits.txt %license COPYING COPYING-planet %{_bindir}/openclonk %{_bindir}/c4group %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/applications/%{name}.desktop %{_datadir}/metainfo/*.appdata.xml %files data %{_datadir}/%{name}/ %files devel-docs %license COPYING COPYING-planet %dir %{_docdir}/%{name}-devel %doc %{develdocdir} %{_datadir}/applications/%{name}-html-*.desktop %{_datadir}/pixmaps/%{name}-docs.png %changelog * Thu Aug 23 2018 Nicolas Chauvet - 8.1-5.20180321git570ba7a - Rebuilt for glew 2.1.0 * Fri Jul 13 2018 Fedora Release Engineering - 8.1-4.20180321git570ba7a - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Mar 21 2018 Antonio Trande - 8.1-3.20180321git570ba7a - Update to commit #570ba7a (blake2 no-SSE reloaded) for upstream bug #69 * Sun Mar 18 2018 Antonio Trande - 8.1-2 - ExclusiveArch for upstream bug #69 * Sat Mar 17 2018 Martin Gansser - 8.1-1 - Update to 8.1 (bz#1557656) - Add BR gcc * Fri Feb 09 2018 Antonio Trande - 8.0-2 - Set USE_GCC_STYLE_LTCG CMake option * Fri Feb 09 2018 Martin Gansser - 8.0-1 - Update to version 8.0 - Disable Werror=format-security flag (https://github.com/openclonk/openclonk/issues/64) - Use appdata file from upstream * Thu Jan 18 2018 Igor Gnatenko - 7.0-10 - Remove obsolete scriptlets * Fri Dec 22 2017 Antonio Trande - 7.0-9 - Appdata file moved into metainfo data directory * Thu Aug 03 2017 Fedora Release Engineering - 7.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 7.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Jun 24 2017 Antonio Trande - 7.0-6 - Set main desktop file (bz#1454638) * Sat Feb 11 2017 Fedora Release Engineering - 7.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Jan 10 2017 Orion Poplawski - 7.0-4 - Rebuild for glew 2.0.0 * Tue May 10 2016 Antonio Trande - 7.0-3 - Made sub-package for documentation * Sun May 08 2016 Antonio Trande - 7.0-2 - Unbundle getopt - Strip all .png files - Make an appdata file * Sat May 07 2016 Antonio Trande - 7.0-1 - First package