File mcontrolcenter.spec of Package mcontrolcenter

#
# spec file for package mcontrolcenter
#
# Copyright (c) 2022 SUSE LLC
#
# 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.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           mcontrolcenter
Version:        0.5.1
Release:        0
Summary:        Application for changing the settings of MSI laptops
License:        GPL-3.0
Group:          System/Management
URL:            https://github.com/dmitry-s93/MControlCenter
Source0:        MControlCenter-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  pkgconfig

# openSUSE
%if 0%{?suse_version}
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  cmake(Qt6Core) >= 6.4
BuildRequires:  cmake(Qt6Widgets) >= 6.4
BuildRequires:  cmake(Qt6LinguistTools) >= 6.4
BuildRequires:  cmake(Qt6DBus) >= 6.4
BuildRequires:  cmake(Qt6Network) >= 6.4
%endif

# Fedora
%if 0%{?fedora}
BuildRequires:  gcc-c++
BuildRequires:  qt6-qtbase-devel
BuildRequires:  qt6-qttools-devel
BuildRequires:  qt6-qttools-static
BuildRequires:  qt6-qtbase-gui
BuildRequires:  hicolor-icon-theme
%endif

# Runtime Requires
%if 0%{?suse_version}
Requires:       libQt6Core6 >= 6.4
Requires:       libQt6Widgets6 >= 6.4
Requires:       libQt6Network6 >= 6.4
Requires:       libQt6DBus6 >= 6.4
%endif

%if 0%{?fedora}
Requires:       qt6-qtbase
Requires:       qt6-qtbase-gui
%endif

%description
An application that allows you to change the settings of MSI laptops running Linux

%prep
%autosetup -p1 -n MControlCenter-%{version}

%build

%cmake
%cmake_build

%install 

%if 0%{?fedora}
install -Dpm0755 %{_vpath_builddir}/mcontrolcenter %{buildroot}%{_bindir}/mcontrolcenter
install -Dpm0755 %{_vpath_builddir}/helper/mcontrolcenter-helper %{buildroot}%{_libexecdir}/mcontrolcenter-helper
%endif

%if 0%{?suse_version}
install -Dpm0755 build/mcontrolcenter %{buildroot}%{_bindir}/mcontrolcenter
install -Dpm0755 build/helper/mcontrolcenter-helper %{buildroot}%{_libexecdir}/mcontrolcenter-helper
%endif

install -Dpm0644 src/helper/mcontrolcenter-helper.conf %{buildroot}%{_datadir}/dbus-1/system.d/mcontrolcenter-helper.conf
install -Dpm0644 src/helper/mcontrolcenter.helper.service %{buildroot}%{_datadir}/dbus-1/system-services/mcontrolcenter.helper.service

install -Dpm0644 resources/mcontrolcenter.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
install -Dpm0644 resources/mcontrolcenter.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dpm0644 resources/mcontrolcenter.appdata.xml %{buildroot}%{_datadir}/metainfo/mcontrolcenter.appdata.xml\

%files
%license LICENSE
%doc README.md
%{_bindir}/mcontrolcenter
%{_libexecdir}/mcontrolcenter-helper
/usr/share/dbus-1/system.d/mcontrolcenter-helper.conf
/usr/share/dbus-1/system-services/mcontrolcenter.helper.service
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/mcontrolcenter.appdata.xml

%changelog
openSUSE Build Service is sponsored by