File 2048-qt.spec of Package 2048-qt
#
# spec file for package 2048-qt
#
# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
#
# 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: 2048-qt
Version: 0.1.6
Release: 0
Summary: Mathematics based puzzle game
License: MIT
Group: Amusements/Games/Strategy/Other
URL: https://github.com/xiaoyong/2048-Qt
#Git-Clone: https://github.com/xiaoyong/2048-Qt.git
Source: https://github.com/xiaoyong/2048-Qt/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: 2048-qt-fix-install-path.patch
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
%description
2048 puzzle is mathematics based puzzle game where you have to slide
tiles on a grid to combine them and create a tile with the number 2048.
You have to merge the similar number tiles (2n) by moving the arrow
keys in four different directions. When two tiles with the same number
touch, they will merge into one.
%prep
%setup -q -n 2048-Qt-%{version}
%patch0 -p1
%build
%qmake5
make %{?_smp_mflags}
%install
%qmake5_install
# icons
for i in 16x16 32x32 48x48 256x256; do
install -D -m0644 res/icons/$i/apps/2048-qt.png %{buildroot}%{_datadir}/icons/hicolor/$i/apps/2048-qt.png
done
install -D -m0644 res/icons/scalable/apps/2048-qt.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/2048-qt.svg
# desktop file
%suse_update_desktop_file -c %{name} %{name} "The 2048 number game implemented in Qt" %{name} %{name} Game LogicGame
# manpage
install -D -m 0644 res/man/2048-qt.6 %{buildroot}%{_mandir}/man6/%{name}.6
%if 0%{?suse_version} < 1330
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif
%files
%doc Changelog.md README.md
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man6/%{name}.6%{?ext_man}
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%changelog