## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           qnetwalk
Version:        1.9.0
Release:        %autorelease
Summary:        Network administration game
License:        GPLv2
URL:            https://github.com/AMDmi3/%{name}/
Source0:        https://github.com/AMDmi3/%{name}/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  cmake >= 3.10
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(Qt5Multimedia)
BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib

Requires:       hicolor-icon-theme

%description
QNetWalk is a game for system administrators.


%prep
%autosetup


%build
# sound is not working with Qt6Multimedia (#3)
%cmake -DUSE_QT6=OFF -DENABLE_SOUND=ON -DENABLE_NLS=ON
%cmake_build


%install
%cmake_install

desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.metainfo.xml


%files
%doc README.md
%license COPYING
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_metainfodir}/%{name}.metainfo.xml
%{_datadir}/%{name}/
%{_datadir}/icons/hicolor/*/apps/qnetwalk.*
%{_datadir}/pixmaps/%{name}.xpm
%{_mandir}/man6/%{name}.6*


%changelog
* Thu Feb 23 2023 John Doe <packager@example.com> - 1.9.0-1
- Uncommitted changes