File dustrac.spec of Package dustrac
#
# spec file for package dustrac
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: dustrac
Version: 1.12.0
Release: 0
Summary: Tile-based 2D Racing Game
License: GPL-3.0 and CC-BY-SA-3.0
Group: Amusements/Games/Action/Race
Url: https://github.com/juzzlin/DustRacing2D
Source: https://github.com/juzzlin/DustRacing2D/releases/download/%{version}/dustrac-%{version}.tar.gz
BuildRequires: cmake >= 2.8.7
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: gcc >= 4.6
BuildRequires: hicolor-icon-theme
BuildRequires: libqt5-linguist-devel
BuildRequires: pkg-config
BuildRequires: ubuntu-fonts
BuildRequires: pkgconfig(Qt5OpenGL)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(vorbisfile)
Requires: ubuntu-fonts
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Dust Racing is a tile-based 2D racing game written with Qt (in C++)
and OpenGL. Dust Racing comes with a Qt-based level editor for level
creation. A separate engine, MiniCore, is used for physics modeling.
%prep
%setup -q
%build
export CXXFLAGS="%{optflags}"
./configure -DReleaseBuild=1 -DCMAKE_INSTALL_PREFIX=%{_prefix} -DDATA_PATH=%{_datadir}/%{name} -DDOC_PATH=%{_datadir}/doc/packages/%{name} -DUseQt5=%{qt5}
make %{?_smp_mflags} VERBOSE=1
%install
make DESTDIR=%{buildroot} install
%fdupes -s %{buildroot}
desktop-file-edit --set-generic-name="2D Racing Game" --remove-key Categories \
--add-category=Game --add-category=ArcadeGame \
--set-key=Exec --set-value=dustrac-game \
%{buildroot}%{_datadir}/applications/dustrac-game.desktop
desktop-file-edit --set-generic-name="Racing Track Editor" --remove-key Categories \
--add-category=Game --add-category=ArcadeGame \
--set-key=Exec --set-value=dustrac-editor \
%{buildroot}%{_datadir}/applications/dustrac-editor.desktop
# Use system fonts
rm %{buildroot}%{_datadir}/%{name}/fonts/UbuntuMono-B.ttf
ln -s %{_datadir}/fonts/truetype/UbuntuMono-B.ttf %{buildroot}%{_datadir}/%{name}/fonts/UbuntuMono-B.ttf
rm %{buildroot}%{_datadir}/%{name}/fonts/UbuntuMono-R.ttf
ln -s %{_datadir}/fonts/truetype/UbuntuMono-R.ttf %{buildroot}%{_datadir}/%{name}/fonts/UbuntuMono-R.ttf
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root)
%{_datadir}/doc/packages/%{name}
%{_bindir}/dustrac-game
%{_bindir}/dustrac-editor
%{_datadir}/%{name}/
%{_datadir}/%{name}/images
%{_datadir}/%{name}/levels
%{_datadir}/applications/dustrac-game.desktop
%{_datadir}/applications/dustrac-editor.desktop
%{_datadir}/pixmaps/dustrac-game.png
%{_datadir}/pixmaps/dustrac-editor.png
%{_datadir}/icons/hicolor/64x64/apps/dustrac-game.png
%{_datadir}/icons/hicolor/64x64/apps/dustrac-editor.png
%dir %{_datadir}/appdata/
%{_datadir}/appdata/dustrac.appdata.xml
%changelog