lbalhar / rpms / openclonk

Forked from rpms/openclonk a year ago
Clone
d4a8288
%global __cmake_in_source_build 1
d4a8288
12eea16
%global commit 570ba7a8adc7973327ae612a3d535fd8621c41dd
12eea16
%global date 20180321
12eea16
%global shortcommit %(c=%{commit}; echo ${c:0:7})
12eea16
6861e06
# For building documentation, it needed Python2
6861e06
%global with_doc 0
6861e06
cce76ed
f165c7a
Name:           openclonk
f165c7a
Summary:        Multiplayer action, tactics and skill game
3a3c8eb
Version:        8.1
8fb4781
Release:        18.%{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
ee24dda
Patch0:         %{name}-gcc11.patch
f165c7a
6c07b9c
BuildRequires: make
f165c7a
BuildRequires:  boost-devel
6a70021
BuildRequires:  cmake, gcc, gcc-c++
6861e06
BuildRequires:  python3-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
6861e06
Obsoletes:   %{name}-devel-docs < 0:8.1-9
6861e06
Obsoletes:   %{name}-doc < 0:8.1-10
6861e06
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}
6861e06
Requires:    %{name} = %{version}-%{release}
f165c7a
BuildArch:   noarch
f165c7a
f165c7a
%description data
f165c7a
This package contains the data files for openclonk.
f165c7a
6861e06
%if 0%{?with_doc}
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}.
6861e06
%endif
f165c7a
f165c7a
%prep
ee24dda
%autosetup -p1 -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
6861e06
# Force Python3
6861e06
%if 0%{?with_doc}
ae0b863
%{__python3} %{_rpmconfigdir}/redhat/pathfix.py -pn -i "%{__python3}" docs/build_hhp.py docs/xml2po.py docs/build_contents.py
6861e06
sed -i 's|@python2|@python3|' docs/Makefile
6861e06
%endif
6861e06
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" \
6861e06
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
fb4e0de
 -DCMAKE_SKIP_RPATH:BOOL=NO -DWITH_AUTOMATIC_UPDATE:BOOL=OFF \
6861e06
 -DUSE_X11:BOOL=ON -DUSE_GTK:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF \
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
6861e06
%if 0%{?with_doc}
f165c7a
pushd ../docs
d3c7c42
%make_build chm/en/Developer.chm
f165c7a
popd
6861e06
%endif
f165c7a
f165c7a
%install
fb4e0de
%make_install -C build
6861e06
install -pm 755 $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
6861e06
install -pm 644 $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
6861e06
%if 0%{?with_doc}
f165c7a
# W: wrong-file-end-of-line-encoding
d3c7c42
sed -i 's/\r$//' docs/chm/en/Output.hhp
f5f75af
f5f75af
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
f5f75af
install -D -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}-docs.png
f165c7a
f165c7a
# HTML desktop files
d3c7c42
install -pm 0644  %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/applications/
f5f75af
%endif
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
f5f75af
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
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
6861e06
%if 0%{?with_doc}
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
6861e06
%endif
f165c7a
f165c7a
%changelog
8fb4781
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-18.20180321git570ba7a
8fb4781
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
8fb4781
5c618a9
* Thu Feb 10 2022 Orion Poplawski <orion@nwra.com> - 8.1-17.20180321git570ba7a
5c618a9
- Rebuild for glew 2.2
5c618a9
55ab101
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-16.20180321git570ba7a
55ab101
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
55ab101
d0d58cc
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-15.20180321git570ba7a
d0d58cc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
d0d58cc
916431c
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-14.20180321git570ba7a
916431c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
916431c
ee24dda
* Thu Oct 15 2020 Jeff Law <law@redhat.com> - 8.1-13.20180321git570ba7a
ee24dda
- Fix missing #include for gcc-11
ee24dda
fa5975a
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-12.20180321git570ba7a
fa5975a
- Second attempt - Rebuilt for
fa5975a
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
fa5975a
b1bc6d4
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.1-11.20180321git570ba7a
b1bc6d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b1bc6d4
6861e06
* Wed Feb 26 2020 Antonio Trande <sagitter@fedoraproject.org> - 8.1-10.20180321git570ba7a
6861e06
- Use python3 but disable documentation building
6861e06
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