File simsu.spec of Package simsu

#
# spec file for package simsu
#
# Copyright (c) 2016 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:           simsu
Summary:        Basic Sudoku game
Version:        1.3.3
Release:        1
URL:            https://gottcode.org/%{name}/
Source:         %{name}-%{version}-src.tar.bz2

# Fedora, RHEL, or CentOS
#--------------------------------------------------------------------
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
License:        GPLv3+
Group:          Amusements/Games
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libappstream-glib
BuildRequires:  qt5-qttools-devel
%endif
#--------------------------------------------------------------------

# openSUSE or SLE
#--------------------------------------------------------------------
%if 0%{?suse_version}
License:        GPL-3.0+
Group:          Amusements/Games/Logic
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5Widgets)
Requires(post): hicolor-icon-theme
Requires(post): update-desktop-files
Requires(postun): hicolor-icon-theme
Requires(postun): update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%endif
#--------------------------------------------------------------------

%description
A basic Sudoku game. You can switch between filling in notes (pencil mode),
or filling in answers (pen mode). To make it easier to see where to place
numbers, you can highlight all instances of a number. You can also check
your answers for correctness while playing. The game stores your current
notes and answers, so that you can pick up where you left off the next
time you play.

%prep
%setup -q

# Fedora, RHEL, or CentOS
#--------------------------------------------------------------------
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
%build
%{qmake_qt5} PREFIX=%{_prefix}
make %{?_smp_mflags}

%install
make install INSTALL_ROOT=%{buildroot}

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop || :
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml || :

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
#--------------------------------------------------------------------

# openSUSE or SLE
#--------------------------------------------------------------------
%if 0%{?suse_version}
%build
%qmake5 PREFIX=%{_prefix}
%make_jobs

%install
%qmake5_install
%suse_update_desktop_file %{name}

%post
%desktop_database_post
%icon_theme_cache_post

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

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

%changelog
* Sat Oct 08 2016 Graeme Gott <graeme@gottcode.org> - 1.3.3-1
- Update to 1.3.3

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

* Sat Jan 30 2016 Graeme Gott <graeme@gottcode.org> - 1.3.2-1
- Update to 1.3.2

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

* Sun Jan 25 2015 Graeme Gott <graeme@gottcode.org> - 1.3.1-1
- Update to 1.3.1

* Fri Jan 23 2015 Graeme Gott <graeme@gottcode.org> - 1.3.0-1
- Update to 1.3.0

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

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

* Thu Jan 24 2013 Graeme Gott <graeme@gottcode.org> - 1.2.2-6
- Improve build sections in spec file.

* Wed Jan 23 2013 Graeme Gott <graeme@gottcode.org> - 1.2.2-5
- Attempt to fix build error for SLE.

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

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

* Wed Jan 25 2012 Graeme Gott <graeme@gottcode.org> - 1.2.2-2
- Add ownership of translation files.

* Wed Jan 25 2012 Graeme Gott <graeme@gottcode.org> - 1.2.2-1
- Update to 1.2.2

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

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

* 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.
openSUSE Build Service is sponsored by