File peg-e.spec of Package peg-e

#
# spec file for package peg-e
#
# Copyright (c) 2025 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:           peg-e
Summary:        Peg solitaire game
Version:        1.3.5
Release:        1
License:        GPL-3.0-or-later
URL:            https://gottcode.org/%{name}/
Source:         %{name}-%{version}.tar.bz2

#--------------------------------------------------------------------
# Fedora
#--------------------------------------------------------------------
%if 0%{?fedora}
Group:          Amusements/Games

BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  libappstream-glib
BuildRequires:  ninja-build
%endif
#--------------------------------------------------------------------
# SUSE
#--------------------------------------------------------------------
%if 0%{?suse_version}
Group:          Amusements/Games/Board/Puzzle
%endif
#--------------------------------------------------------------------
# All
#--------------------------------------------------------------------
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  cmake
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Gui)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6Widgets)
#--------------------------------------------------------------------

%description
A peg solitaire game in which you jump over pieces in order to remove them
from the board, ultimately trying to eliminate all but one. The boards are
randomly generated, with 100 levels of difficulty. The game auto-saves,
and has undo-redo capability. Pieces can move horizontally, vertically,
and diagonally.

%prep
%autosetup -p1

#--------------------------------------------------------------------
# Fedora
#--------------------------------------------------------------------
%if 0%{?fedora}
%build
%cmake_qt6
%cmake_build

%install
%cmake_install

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop || :
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml || :
%endif
#--------------------------------------------------------------------
# SUSE
#--------------------------------------------------------------------
%if 0%{?suse_version}
%build
%cmake_qt6
%{qt6_build}

%install
%{qt6_install}
%endif
#--------------------------------------------------------------------

%files
%defattr(-,root,root,-)
%if 0%{?suse_version}
%{_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
%{_mandir}/man?/%{name}.*

%changelog
* Fri Feb 14 2025 Graeme Gott <graeme@gottcode.org> - 1.3.5-1
- Update to 1.3.5

* Mon Jan 06 2025 Graeme Gott <graeme@gottcode.org> - 1.3.4-1
- Update to 1.3.4

* Tue Jan 16 2024 Graeme Gott <graeme@gottcode.org> - 1.3.3-1
- Update to 1.3.3

* Tue Jan 10 2023 Graeme Gott <graeme@gottcode.org> - 1.3.2-1
- Update to 1.3.2

* Fri Jun 10 2022 Graeme Gott <graeme@gottcode.org> - 1.3.1-2
- Use newer g++ on openSUSE.

* Tue May 03 2022 Graeme Gott <graeme@gottcode.org> - 1.3.1-1
- Update to 1.3.1

* Mon Sep 20 2021 Graeme Gott <graeme@gottcode.org> - 1.3.0-1
- Update to 1.3.0

* Tue Apr 21 2020 Graeme Gott <graeme@gottcode.org> - 1.2.8-1
- Update to 1.2.8

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

* Fri Jul 20 2018 Graeme Gott <graeme@gottcode.org> - 1.2.6-1
- Update to 1.2.6

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

* Wed Dec 27 2017 Graeme Gott <graeme@gottcode.org> - 1.2.4-1
- Update to 1.2.4

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

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

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

* Tue May 05 2015 Graeme Gott <graeme@gottcode.org> - 1.2.1-3
- Remove old manpage reference.

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

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

* Thu Jan 22 2015 Graeme Gott <graeme@gottcode.org> - 1.2.0-1
- Update to 1.2.0

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

* Wed Feb 06 2013 Graeme Gott <graeme@gottcode.org> - 1.1.2-1
- Update to 1.1.2

* Thu Jan 24 2013 Graeme Gott <graeme@gottcode.org> - 1.1.1.1-5
- Add category to desktop file.

* Thu Jan 24 2013 Graeme Gott <graeme@gottcode.org> - 1.1.1.1-4
- Fix build errors on openSUSE and SLE.

* Thu Jan 24 2013 Graeme Gott <graeme@gottcode.org> - 1.1.1.1-3
- Improve spec file.

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

* Sun Jun 10 2012 Graeme Gott <graeme@gottcode.org> - 1.1.1.1-1
- Update to 1.1.1.1

* Sat Jun 09 2012 Graeme Gott <graeme@gottcode.org> - 1.1.1-1
- Update to 1.1.1

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

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

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

* Tue Sep 21 2010 Graeme Gott <graeme@gottcode.org> - 1.1.0-1
- Initial package.
openSUSE Build Service is sponsored by