5f538b5
Name:    colobot
41888d3
%global orgname info.colobot.Colobot
41888d3
1e5b30c
Version: 0.1.12
ad8b089
Release: 4%{?dist}
5f538b5
Summary: A video game that teaches programming in a fun way
5f538b5
5f538b5
License: GPLv3
5f538b5
URL: https://colobot.info
5f538b5
5f538b5
%global giturl https://github.com/colobot
5f538b5
%global gittag colobot-gold-%{version}-alpha
5f538b5
Source0: %{giturl}/colobot/archive/%{gittag}/colobot-%{gittag}.tar.gz
5f538b5
Source1: %{giturl}/colobot-data/archive/%{gittag}/colobot-data-%{gittag}.tar.gz
5f538b5
5f538b5
# Music files are licensed under GPLv3, like the rest of the game.
5f538b5
# They are not kept in the colobot-data repo, and by default are downloaded during the build.
5f538b5
# Since Fedora builders have net-access disabled, we need to download them beforehand.
5f538b5
%global musicurl https://colobot.info/files/music
5f538b5
Source100: %{musicurl}/Intro1.ogg
5f538b5
Source101: %{musicurl}/Intro2.ogg
5f538b5
Source102: %{musicurl}/music002.ogg
5f538b5
Source103: %{musicurl}/music003.ogg
5f538b5
Source104: %{musicurl}/music004.ogg
5f538b5
Source105: %{musicurl}/music005.ogg
5f538b5
Source106: %{musicurl}/music006.ogg
5f538b5
Source107: %{musicurl}/music007.ogg
5f538b5
Source108: %{musicurl}/music008.ogg
5f538b5
Source109: %{musicurl}/music009.ogg
5f538b5
Source110: %{musicurl}/music010.ogg
5f538b5
Source111: %{musicurl}/music011.ogg
5f538b5
Source112: %{musicurl}/music012.ogg
5f538b5
Source113: %{musicurl}/music013.ogg
5f538b5
Source114: %{musicurl}/Constructive.ogg
5f538b5
Source115: %{musicurl}/Humanitarian.ogg
5f538b5
Source116: %{musicurl}/Hv2.ogg
5f538b5
Source117: %{musicurl}/Quite.ogg
5f538b5
Source118: %{musicurl}/Infinite.ogg
5f538b5
Source119: %{musicurl}/Proton.ogg
5f538b5
Source120: %{musicurl}/Prototype.ogg
5f538b5
709f14f
ad8b089
# The game uses the translated string "Player" as the default player name
ad8b089
# yet it does not properly handle UTF-8 in player names,
ad8b089
# so non-English speakers may have the game always crash when putting in the player name.
ad8b089
#
ad8b089
# See: https://github.com/colobot/colobot/issues/1268 
ad8b089
Patch0: colobot--do-not-translate-default-player-name.patch
ad8b089
ad8b089
5f538b5
BuildRequires: boost-devel >= 1.51
5f538b5
BuildRequires: boost-filesystem >= 1.51
5f538b5
BuildRequires: boost-regex >= 1.51
5f538b5
BuildRequires: cmake >= 2.8
5f538b5
BuildRequires: desktop-file-utils
5f538b5
BuildRequires: gcc-c++
5f538b5
BuildRequires: gettext-devel >= 0.18
5f538b5
BuildRequires: glew-devel >= 1.8.0
5f538b5
BuildRequires: libappstream-glib
5f538b5
BuildRequires: libogg-devel >= 1.3.0
5f538b5
BuildRequires: libpng-devel >= 1.2
5f538b5
BuildRequires: libsndfile-devel >= 1.0.25
5f538b5
BuildRequires: libvorbis >= 1.3.2
5f538b5
BuildRequires: openal-soft-devel >= 1.13
5f538b5
BuildRequires: po4a
5f538b5
BuildRequires: physfs-devel
2d3fea4
BuildRequires: python3-devel
5f538b5
BuildRequires: SDL2-devel SDL2_image-devel SDL2_ttf-devel
5f538b5
BuildRequires: xmlstarlet
5f538b5
BuildRequires: %{_bindir}/pod2man
5f538b5
BuildRequires: %{_bindir}/rsvg-convert
5f538b5
5f538b5
Requires: colobot-data = %{version}-%{release}
5f538b5
Requires: colobot-music = %{version}-%{release}
5f538b5
Requires: hicolor-icon-theme
5f538b5
5f538b5
%description
5f538b5
Colobot: Gold Edition is a real-time strategy game, where you can program
5f538b5
your units (bots) in a language called CBOT, which is similar to C++ and Java.
5f538b5
Your mission is to find a new planet to live and survive.
5f538b5
You can save the humanity and get programming skills!
5f538b5
5f538b5
5f538b5
%package data
5f538b5
Summary: Data files for Colobot: Gold Edition
5f538b5
BuildArch: noarch
5f538b5
5f538b5
%description data
5f538b5
Data files (graphics, sounds, levels) required to run Colobot Gold.
5f538b5
5f538b5
5f538b5
%package music
5f538b5
Summary: Music for Colobot: Gold Edition
5f538b5
BuildArch: noarch
5f538b5
5f538b5
%description music
5f538b5
Music files used by Colobot Gold.
5f538b5
5f538b5
5f538b5
%prep
5f538b5
%setup -q -n colobot-%{gittag}
ad8b089
%patch0 -p1
5f538b5
5f538b5
rm -rf ./data
5f538b5
cp %{SOURCE1} ./data.tgz
5f538b5
tar xzf ./data.tgz
5f538b5
rm ./data.tgz
5f538b5
mv ./colobot-data-%{gittag} ./data
5f538b5
5f538b5
cp -a %{SOURCE100} data/music/
5f538b5
cp -a %{SOURCE101} data/music/
5f538b5
cp -a %{SOURCE102} data/music/
5f538b5
cp -a %{SOURCE103} data/music/
5f538b5
cp -a %{SOURCE104} data/music/
5f538b5
cp -a %{SOURCE105} data/music/
5f538b5
cp -a %{SOURCE106} data/music/
5f538b5
cp -a %{SOURCE107} data/music/
5f538b5
cp -a %{SOURCE108} data/music/
5f538b5
cp -a %{SOURCE109} data/music/
5f538b5
cp -a %{SOURCE110} data/music/
5f538b5
cp -a %{SOURCE111} data/music/
5f538b5
cp -a %{SOURCE112} data/music/
5f538b5
cp -a %{SOURCE113} data/music/
5f538b5
cp -a %{SOURCE114} data/music/
5f538b5
cp -a %{SOURCE115} data/music/
5f538b5
cp -a %{SOURCE116} data/music/
5f538b5
cp -a %{SOURCE117} data/music/
5f538b5
cp -a %{SOURCE118} data/music/
5f538b5
cp -a %{SOURCE119} data/music/
5f538b5
cp -a %{SOURCE120} data/music/
5f538b5
5f538b5
sed \
5f538b5
  -e 's|set(COLOBOT_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/games |set(COLOBOT_INSTALL_BIN_DIR %{_bindir}/ |' \
5f538b5
  -e 's|set(COLOBOT_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/colobot |set(COLOBOT_INSTALL_LIB_DIR %{_libdir}/colobot |' \
5f538b5
  -e 's|set(COLOBOT_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot |set(COLOBOT_INSTALL_DATA_DIR %{_datadir}/colobot |' \
5f538b5
  -e 's|set(COLOBOT_INSTALL_I18N_DIR ${CMAKE_INSTALL_PREFIX}/share/locale |set(COLOBOT_INSTALL_I18N_DIR %{_datadir}/locale |' \
5f538b5
  -e 's|set(COLOBOT_INSTALL_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/colobot |set(COLOBOT_INSTALL_DOC_DIR %{_datadir}/doc/colobot |' \
5f538b5
  -i CMakeLists.txt
5f538b5
5f538b5
5f538b5
%build
5f538b5
mkdir build
5f538b5
cd build
18b47ee
%cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{__python3} ..
5f538b5
make %{?_smp_mflags}
5f538b5
5f538b5
5f538b5
%install
5f538b5
pushd build
5f538b5
%make_install
5f538b5
popd
41888d3
41888d3
# Change the .desktop file name to match the .appdata.xml file name
41888d3
mv %{buildroot}%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{orgname}.desktop
41888d3
sed -e 's|%{name}.desktop|%{orgname}.desktop|' -i %{buildroot}%{_metainfodir}/%{orgname}.appdata.xml
41888d3
5f538b5
%find_lang %{name} --with-man
5f538b5
5f538b5
5f538b5
%check
41888d3
desktop-file-validate %{buildroot}%{_datadir}/applications/%{orgname}.desktop
41888d3
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{orgname}.appdata.xml
5f538b5
5f538b5
5f538b5
%files -f %{name}.lang
5f538b5
%license LICENSE.txt
5f538b5
%{_bindir}/%{name}
5f538b5
%{_libdir}/%{name}/
5f538b5
41888d3
%{_datadir}/applications/%{orgname}.desktop
41888d3
%{_metainfodir}/%{orgname}.appdata.xml
41888d3
5f538b5
%{_datadir}/icons/hicolor/**/apps/%{name}.png
5f538b5
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
5f538b5
%{_mandir}/man6/%{name}.6*
5f538b5
5f538b5
5f538b5
%files data
5f538b5
%license LICENSE.txt
5f538b5
%{_datadir}/%{name}/
5f538b5
%exclude %{_datadir}/%{name}/music
5f538b5
5f538b5
5f538b5
%files music
5f538b5
%license LICENSE.txt
5f538b5
%dir %{_datadir}/%{name}/
5f538b5
%{_datadir}/%{name}/music/
5f538b5
5f538b5
5f538b5
%changelog
ad8b089
* Mon Oct 07 2019 Artur Iwicki <fedora@svgames.pl> - 0.1.12-4
ad8b089
- Make the game always use "Player" as the default player name
ad8b089
  (fixes the game crashing under certain system locale settings)
41888d3
- Rename the .desktop file to match the .appdata.xml file name
ad8b089
8f2c8b4
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.12-3
8f2c8b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
8f2c8b4
2d3fea4
* Sun Feb 24 2019 Artur Iwicki <fedora@svgames.pl> - 0.1.12-2
2d3fea4
- Replace python3 BR with python3-devel
2d3fea4
- Move music files to the fepdkg lookaside cache
2d3fea4
2d3fea4
* Sun Feb 24 2019 Artur Iwicki <fedora@svgames.pl> - 0.1.12-1
1e5b30c
- Update to newest upstream release
1e5b30c
- Drop Patch0 (appdata.xml file) - merged upstream
1e5b30c
- Drop Patch1 (use snprintf() instead of sprintf()) - issue fixed upstream
1e5b30c
- Drop Patch2 (strncpy() fix) - merged upstream
1e5b30c
709f14f
* Sat Feb 02 2019 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-8
709f14f
- Add a patch for strncpy() usages
709f14f
ab5c9d6
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.11.1-8
ab5c9d6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
ab5c9d6
18b47ee
* Mon Nov 19 2018 Miro HronĨok <miro@hroncok.cz> - 0.1.11.1-7
18b47ee
- Use python3 during build instead of python2
18b47ee
5f538b5
* Tue Nov 13 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-6
5f538b5
- Use %%find_lang for .mo files and man pages
5f538b5
5f538b5
* Thu Nov 08 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-5
5f538b5
- Change the Summary: to something more descriptive
5f538b5
- Add a comment on music files
5f538b5
- Preserve timestamps on music files
5f538b5
5f538b5
* Thu Nov 08 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-4
5f538b5
- Add a Requires: for hicolor-icon-theme
5f538b5
- Validate the desktop and appdata file
5f538b5
5f538b5
* Sun Nov 04 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-3
5f538b5
- Fix build failures on F28 and later
5f538b5
5f538b5
* Mon Oct 29 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-2
5f538b5
- Add an Appdata XML file
5f538b5
- Move music into a separate subpackage
5f538b5
5f538b5
* Tue Oct 16 2018 Artur Iwicki <fedora@svgames.pl> - 0.1.11.1-1
5f538b5
- Initial packaging