File qtmips.spec of Package qtmips

#
# spec file for package qtmips
#
# Copyright (c) 2017-2019 Karel Koci <cynerd@email.cz>
# Copyright (c) 2019-2024 Pavel Pisa <pisa@cmp.felk.cvut.cz>
# Copyright (c) 2020-2024 Jakub Dupak <dev@jakubdupak.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.

# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>
#
# Please submit bugfixes or comments via
#   
# issues tracker.
#


Name:           qtmips
Version:        0.8.1
Release:        0
Summary:        MIPS CPU simulator for education purposes
License:        GPL-3.0-or-later
Group:          System/Emulators/Other
URL:            https://github.com/cvut/qtmips
Source:         qtmips_0.8.1.orig.tar.xz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
%if ! 0%{?suse_version}
BuildRequires:  desktop-file-utils
BuildRequires:  pkgconfig(libelf)
%endif
%if 0%{?suse_version}
BuildRequires:  libelf-devel
BuildRequires:  update-desktop-files
%endif

%description
MIPS CPU simulator for education purposes with pipeline and cache visualization.

%prep
%setup -q

%build
%if 0%{?suse_version}
%cmake -DCMAKE_CXX_FLAGS="-Wno-error" -DCMAKE_C_FLAGS="-Wno-error"
%else
%cmake
%endif
%cmake_build

%install
%cmake_install

#desktop icon
%if 0%{?suse_version}
%suse_update_desktop_file -r -i qtmips 'System Emulator'
%endif

%if 0%{?fedora} || 0%{?rhel} || 0%{?centos}
desktop-file-validate %{buildroot}%{_datadir}/applications/qtmips.desktop
%endif

# TODO: this should be generated from CMake
%files
%{_bindir}/qtmips_gui
%{_bindir}/qtmips_cli
%{_datadir}/icons/hicolor/scalable/apps/qtmips_gui.svg
%{_datadir}/icons/hicolor/48x48/apps/qtmips_gui.png
%{_datadir}/applications/qtmips.desktop

%license LICENSE
%doc README.md

%changelog
openSUSE Build Service is sponsored by