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