File optimus-manager-qt.spec of Package optimus-manager-qt
#
# spec file for package optimus-manager-qt
#
# Copyright (c) 2023 by Your Name <your.email@example.com>
#
# 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/
#
%define realname optimus-manager-qt
%define realver 1.6.9
%define realext .tar.gz
%define _with_plasma 0
Name: optimus-manager-qt
Version: 1.6.9
Release: 2
Summary: A Qt interface for Optimus Manager
License: GPL-3.0-only
Group: System/X11/Utilities
URL: https://github.com/Shatur/optimus-manager-qt
Source: https://github.com/Shatur/optimus-manager-qt/archive/refs/tags/%{version}.tar.gz#/%{realname}-%{realver}%{realext}
BuildRequires: cmake
BuildRequires: extra-cmake-modules
BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5X11Extras)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: libqt5-linguist-devel
%if %_with_plasma
BuildRequires: pkgconfig(KF5Config)
BuildRequires: pkgconfig(KF5Notifications)
BuildRequires: pkgconfig(KF5IconThemes)
%endif
ExclusiveArch: x86_64 i586
Requires: optimus-manager >= 1.5
Requires: pkgconfig(Qt5Core)
Requires: pkgconfig(Qt5Svg)
Requires: pkgconfig(Qt5X11Extras)
%description
A Qt interface for Optimus Manager that allows configuring and switching GPUs
on Optimus laptops using the tray menu.
%prep
%setup -q %{realname}-%{realver}.%{srcext}
%build
mkdir -p build
cd build
%if %_with_plasma
cmake \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DWITH_PLASMA=ON ..
%else
cmake \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" ..
%endif
%make_jobs
%install
cd build
%make_install
rm -f %{buildroot}/%{_datadir}/icons/hicolor/icon-theme.cache
mv %{buildroot}/%{_datadir}/Optimus\ Manager %{buildroot}/%{_datadir}/Optimus-Manager
rm -f %{buildroot}/%{_datadir}/icons/hicolor/icon-theme.cache
%files
%{_bindir}/%{name}
%{_datadir}/applications/
%{_datadir}/icons/hicolor/
%{_datadir}/Optimus-Manager/
%changelog
* Tue Nov 06 2023 Jonata Gonçalves <jonatas.sgoncalves@gmail.com> - 1.6.9
- Initial package release