File corectrl.spec of Package corectl

#
# spec file for package oversteer
#
# Copyright (c) 2020 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/
#
%define __builder ninja
%define _name_archive corectrl-master
%define libname libcorectrl
%define sover   0

Name:           corectrl
Version:        1.4.4-20250425
Release:        0
Summary:        Core control application
License:        GPL-3.0-only
Group:          System/Management
URL:            https://gitlab.com/corectrl/corectrl
Source:         %{_name_archive}-%{version}.tar.gz
Patch1:         corectrl-translations-install.patch
BuildRequires:  cmake
BuildRequires:  ninja
BuildRequires:  polkit
%if 0%{?sle_version} == 150000 || 0%{?sle_version} == 150100 || 0%{?sle_version} == 150200 || 0%{?sle_version} == 150300 || 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500
BuildRequires:  gcc10-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  filesystem
BuildRequires:  libqca-qt5-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  cmake(KF5Archive)
BuildRequires:  cmake(KF5Auth)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(KF5CoreAddons)
BuildRequires:  Botan >= 3.7
BuildRequires:  libbotan-3-7 >= 3.7
BuildRequires:  libbotan-devel >= 3.7
BuildRequires:  libQt5Charts5 >= 5.15
BuildRequires:  libQt5Charts5-devel >= 5.15
BuildRequires:  libQt5DBus5 >= 5.15
BuildRequires:  libQt5DBus-devel >= 5.15
BuildRequires:  libQt5Designer5 >= 5.15
BuildRequires:  libQt5Quick3D5 >= 5.15
BuildRequires:  libQt5QuickControls2-5 >= 5.15
BuildRequires:  libQt5QuickControls2-devel >= 5.15
BuildRequires:  libQt5Svg5 >= 5.15
BuildRequires:  libqt5-qtsvg-devel >= 5.15
BuildRequires:  libQt5X11Extras5 >= 5.15
BuildRequires:  libX11-6
BuildRequires:  libquazip1-qt5-1_5_0
BuildRequires:  quazip-qt5-devel
BuildRequires:  dbus-1
BuildRequires:  dbus-1-devel
BuildRequires:  libpolkit-gobject-1-0
BuildRequires:  polkit-devel
BuildRequires:  libspdlog1_15
BuildRequires:  spdlog-devel
BuildRequires:  libpugixml1
BuildRequires:  pugixml-devel
BuildRequires:  Catch2-2-devel
Requires:       libqt5-qtquickcontrols
Requires:       libQt5QuickControls2-5
Requires:       libqt5-qtcharts-imports
Requires:       libKF5Auth5
Requires:       libqca-qt5
Requires:       sysvinit-tools
Requires:       hwdata
Requires:       Mesa-demo
Requires:       vulkan-tools
Requires:       %{libname}%{sover} = %{version}
Recommends:     %{name}-lang

%description
CoreCtrl is a Free and Open Source GNU/Linux application that allows you to control with ease your computer hardware using application profiles.
It aims to be flexible, comfortable and accessible to regular users.

%package -n %{libname}%{sover}
Summary:        Library for %{name}

%description -n %{libname}%{sover}
%{summary}.

%lang_package

%prep
%setup -q -n %{_name_archive}-%{version}
%patch -P 1 -p1

sed -e 's@DESTINATION lib@DESTINATION %{_lib}@g' -i src/CMakeLists.txt
echo "set_property(TARGET corectrl_lib PROPERTY SOVERSION 0)" >> src/CMakeLists.txt

%build
%if 0%{?sle_version} == 150000 || 0%{?sle_version} == 150100 || 0%{?sle_version} == 150200 || 0%{?sle_version} == 150300 || 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
%endif
%cmake \
 -DBUILD_TESTING=OFF
%cmake_build

%install
%cmake_install

rm %{buildroot}/%{_libdir}/%{libname}.so
%find_lang %{name} --with-qt
find README.md -type f -perm /111 -exec chmod 644 {} \;
find %{buildroot}/%{_datadir}/. -type f -executable -exec chmod -x "{}" \;

%post -n %{libname}%{sover} -p /sbin/ldconfig
%postun -n %{libname}%{sover} -p /sbin/ldconfig

%files
%license COPYING LICENSE
%doc README.md
%{_bindir}/corectrl
%if 0%{?sle_version} == 150000 || 0%{?sle_version} == 150100
%{_sysconfdir}/dbus-1/system.d/*.conf
%endif
%{_datadir}/applications/
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/dbus-1/system.d/*.conf
%{_datadir}//icons/hicolor/
%{_datadir}//icons/hicolor/*/apps/*.svg
%{_datadir}/polkit-1/actions/*.policy
%{_datadir}/metainfo/org.corectrl.CoreCtrl.appdata.xml
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/corectrl_helper
%{_libexecdir}/%{name}/corectrl_helperkiller

%files -n %{libname}%{sover}
%{_libdir}/%{libname}.so.%{sover}

%files lang -f %{name}.lang
%{_datadir}/qt5/

%changelog
openSUSE Build Service is sponsored by