godot/godot.spec
2017-04-15 15:50:53 +02:00

164 lines
4.8 KiB
RPMSpec

# remove when push in contrib
%define debug_package %{nil}
%bcond_without server
%define status stable
%define uversion %{version}-%{status}
%ifarch %{ix86}
%define arch 32
%else
%define arch 64
%endif
Name: godot
Version: 2.1.3
Release: 1
Summary: Multi-platform 2D and 3D game engine with a feature rich editor
Group: Development/Tools
License: MIT
URL: https://godotengine.org
Source0: https://github.com/godotengine/godot/archive/%{uversion}/%{name}-%{uversion}.tar.gz
Source1: https://github.com/godotengine/godot-demo-projects/archive/%{uversion}/godot-demo-projects-%{uversion}.tar.gz
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(opusfile)
BuildRequires: pkgconfig(theora)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisfile)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(zlib)
BuildRequires: scons
Suggests: %{name}-demos
%description
Godot is an advanced, feature packed, multi-platform 2D and 3D game engine.
It provides a huge set of common tools, so you can just focus on making
your game without reinventing the wheel.
Godot is completely free and open source under the very permissive MIT
license. No strings attached, no royalties, nothing. Your game is yours,
down to the last line of engine code.
%files
%doc LICENSE.md README.md
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/hicolor/scalable/apps/%{name}.svg
#----------------------------------------------------------------------
%package demos
Summary: Demo projects to learn how to use Godot Engine
BuildArch: noarch
%description demos
This package contains the official demo projects to help new users to learn
the features of the game engine.
%files demos
%doc godot-demo-projects-2.1.3-stable/*.md
%{_datadir}/%{name}/demos/
#----------------------------------------------------------------------
%if %{with server}
%package server
Summary: Godot headless binary for servers
Group: Games/Other
%description server
This package contains the headless binary for the Godot game engine,
particularly suited for running dedicated servers.
%files server
%doc *.md
%{_bindir}/%{name}-server
%endif
#----------------------------------------------------------------------
%package runner
Summary: Shared binary to play games developed with the Godot engine
Group: Games/Other
%description runner
This package contains a godot-runner binary for the Linux X11 platform,
which can be used to run any game developed with the Godot engine simply
by pointing to the location of the game's data package.
%files runner
%doc LICENSE.md README.md
%{_bindir}/%{name}-runner
#----------------------------------------------------------------------
%prep
%setup -qn %{name}-%{uversion} -a 1
chmod -x scene/main/node.cpp
%build
# Needs to be in %%build so that system_libs stays in scope
system_libs=""
for lib in freetype glew libogg libpng libtheora libvorbis libwebp openssl opus zlib; do
system_libs+="builtin_"$lib"=no "
rm -rf thirdparty/$lib
done
%define _scons %scons CCFLAGS="%{optflags}" LINKFLAGS="%{ldflags}" $system_libs
export BUILD_REVISION="mageia"
# Build graphical editor (tools)
%_scons p=x11 tools=yes target=release_debug
# Build game runner (without tools)
%_scons p=x11 tools=no target=release
%if %{with server}
# Build headless version of the editor
%_scons p=server tools=yes target=release_debug
%endif
%install
install -d %{buildroot}%{_bindir}
install -m0755 bin/%{name}.x11.opt.tools.%{arch} %{buildroot}%{_bindir}/%{name}
install -m0755 bin/%{name}.x11.opt.%{arch} %{buildroot}%{_bindir}/%{name}-runner
%if %{with server}
install -m0755 bin/%{name}_server.server.opt.tools.%{arch} %{buildroot}%{_bindir}/%{name}-server
%endif
install -d %{buildroot}%{_datadir}/%{name}
cp -a godot-demo-projects-%{uversion} %{buildroot}%{_datadir}/%{name}/demos
install -D -m644 icon.svg \
%{buildroot}%{_iconsdir}/hicolor/scalable/apps/%{name}.svg
install -d %{buildroot}%{_datadir}/applications
cat << EOF > %{buildroot}%{_datadir}/applications/%{name}.desktop
[Desktop Entry]
Name=Godot Engine
GenericName=Libre game engine
Comment=Multi-platform 2D and 3D game engine with a feature rich editor
Exec=%{name} -pm
Icon=%{name}
Terminal=false
Type=Application
Categories=Development;IDE;
EOF