File tetzle.spec of Package tetzle

#
# spec file for Tetzle
#
# Copyright (c) 2019 Graeme Gott <graeme@gottcode.org>
#
# 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.

Name:           tetzle
Summary:        Jigsaw puzzle with tetromino pieces
Version:        2.1.5
Release:        1
URL:            https://gottcode.org/%{name}/
Source:         %{name}-%{version}-src.tar.bz2

#--------------------------------------------------------------------
# Red Hat
#--------------------------------------------------------------------
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
License:        GPLv3+
Group:          Amusements/Games

BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libappstream-glib
%endif
#--------------------------------------------------------------------
# Mageia
#--------------------------------------------------------------------
%if 0%{?mgaversion}
License:        GPLv3+
Group:          Games/Puzzles
%endif
#--------------------------------------------------------------------
# openSUSE or SLE
#--------------------------------------------------------------------
%if 0%{?suse_version}
License:        GPL-3.0+
Group:          Amusements/Games/Board/Puzzle

BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
Requires(post): hicolor-icon-theme
Requires(post): update-desktop-files
Requires(postun): hicolor-icon-theme
Requires(postun): update-desktop-files
%endif
#--------------------------------------------------------------------
# All
#--------------------------------------------------------------------
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5Widgets)
#--------------------------------------------------------------------

%description
A jigsaw puzzle game that uses tetrominoes for the pieces. Any image can be
imported and used to create puzzles with a wide range of sizes. Games are
saved automatically, and you can select between currently in progress games.

%prep
%setup -q

#--------------------------------------------------------------------
# Red Hat
#--------------------------------------------------------------------
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
%build
%qmake_qt5 PREFIX=%{_prefix}
%make_build

%install
%make_install INSTALL_ROOT=%{buildroot}

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop || :
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml || :
%endif
#--------------------------------------------------------------------
# Mageia
#--------------------------------------------------------------------
%if 0%{?mgaversion}
%build
%qmake_qt5 PREFIX=%{_prefix}
%make_build

%install
%make_install INSTALL_ROOT=%{buildroot}
%endif
#--------------------------------------------------------------------
# SUSE
#--------------------------------------------------------------------
%if 0%{?suse_version}
%build
%qmake5 PREFIX=%{_prefix}
%make_jobs

%install
%qmake5_install
%suse_update_desktop_file %{name}

%if 0%{?suse_version} < 1330
%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif
%endif
#--------------------------------------------------------------------

%files
%defattr(-,root,root,-)
%if 0%{?suse_version}
%dir %{_datadir}/metainfo
%{_datadir}/icons/hicolor/
%endif
%doc ChangeLog COPYING CREDITS README
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/pixmaps/%{name}.xpm
%{_mandir}/man?/%{name}.*

%changelog
* Wed Aug 07 2019 Graeme Gott <graeme@gottcode.org> - 2.1.5-1
- Update to 2.1.5

* Mon Mar 25 2019 Graeme Gott <graeme@gottcode.org> - 2.1.4-1
- Update to 2.1.4

* Tue May 29 2018 Graeme Gott <graeme@gottcode.org> - 2.1.3-1
- Update to 2.1.3

* Thu Dec 28 2017 Graeme Gott <graeme@gottcode.org> - 2.1.2-1
- Update to 2.1.2

* Sat Aug 05 2017 Graeme Gott <graeme@gottcode.org> - 2.1.1-1
- Update to 2.1.1

* Sun Oct 16 2016 Graeme Gott <graeme@gottcode.org> - 2.1.0-1
- Update to 2.1.0

* Sat Aug 27 2016 Graeme Gott <graeme@gottcode.org> - 2.0.3-6
- Fix build failure.

* Tue May 05 2015 Graeme Gott <graeme@gottcode.org> - 2.0.3-5
- Remove reference to nonexistent NEWS file.

* Tue May 05 2015 Graeme Gott <graeme@gottcode.org> - 2.0.3-4
- Remove reference to nonexistent README file.

* Tue May 05 2015 Graeme Gott <graeme@gottcode.org> - 2.0.3-3
- Package for Debian 8.

* Mon May 12 2014 Graeme Gott <graeme@gottcode.org> - 2.0.3-2
- Switch to Qt 5.

* Sun Sep 22 2013 Graeme Gott <graeme@gottcode.org> - 2.0.3-1
- Update to 2.0.3

* Thu Feb 28 2013 Graeme Gott <graeme@gottcode.org> - 2.0.2.1-1
- Update to 2.0.2.1

* Thu Feb 28 2013 Graeme Gott <graeme@gottcode.org> - 2.0.2-1
- Update to 2.0.2

* Wed Jan 23 2013 Graeme Gott <graeme@gottcode.org> - 2.0.1-5
- Actually apply patch to desktop file.

* Wed Jan 23 2013 Graeme Gott <graeme@gottcode.org> - 2.0.1-4
- Fix desktop file categories.

* Wed Jan 23 2013 Graeme Gott <graeme@gottcode.org> - 2.0.1-3
- Improve spec file.

* Tue Jan 22 2013 Graeme Gott <graeme@gottcode.org> - 2.0.1-2
- Add Debian packaging.

* Sat May 19 2012 Graeme Gott <graeme@gottcode.org> - 2.0.1-1
- Update to 2.0.1

* Mon Dec 05 2011 Graeme Gott <graeme@gottcode.org> - 2.0.0-4
- Update MIME database and GNOME icon cache.

* Fri Nov 11 2011 Graeme Gott <graeme@gottcode.org> - 2.0.0-3
- Improve spec file.

* Wed May 18 2011 Graeme Gott <graeme@gottcode.org> - 2.0.0-2
- Add ownership of data files.

* Wed May 18 2011 Graeme Gott <graeme@gottcode.org> - 2.0.0-1
- Update to 2.0.0

* Sat Apr 02 2011 Graeme Gott <graeme@gottcode.org> - 1.2.1-2
- Add dependency on hicolor-icon-theme.

* Tue Sep 21 2010 Graeme Gott <graeme@gottcode.org> - 1.2.1-1
- Initial package.