Blame colobot.spec

5f538b5
Name:    colobot
1eb33b1
Version: 0.1.12
1eb33b1
Release: 1%{?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
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
3f6251d
BuildRequires: python3
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}
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
3f6251d
%cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{__python3} ..
5f538b5
make %{?_smp_mflags}
5f538b5
5f538b5
5f538b5
%install
5f538b5
pushd build
5f538b5
%make_install
5f538b5
popd
5f538b5
%find_lang %{name} --with-man
5f538b5
5f538b5
5f538b5
%check
5f538b5
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
5f538b5
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml
5f538b5
5f538b5
5f538b5
%files -f %{name}.lang
5f538b5
%license LICENSE.txt
5f538b5
%{_bindir}/%{name}
5f538b5
%{_libdir}/%{name}/
5f538b5
5f538b5
%{_datadir}/applications/%{name}.desktop
5f538b5
%{_datadir}/metainfo/*.appdata.xml
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
1eb33b1
* Sun Feb 24 2019 Artur Iwicki <fedora@svgames.pl> - 0.1.12
1eb33b1
- Update to newest upstream release
1eb33b1
- Drop Patch0 (appdata.xml file) - merged upstream
1eb33b1
- Drop Patch1 (use snprintf() instead of sprintf()) - issue fixed upstream
1eb33b1
3f6251d
* Mon Nov 19 2018 Miro HronĨok <miro@hroncok.cz> - 0.1.11.1-7
3f6251d
- Use python3 during build instead of python2
3f6251d
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