File corectrl.spec of Package corectrl

#
# spec file for package corectrl
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 libname libcorectrl
%define sover   0
Name:           corectrl
Version:        1.4.2
Release:        0
Summary:        Core control application
License:        GPL-3.0-only
Group:          System/Management
URL:            https://gitlab.com/corectrl/corectrl
Source:         %{name}-%{version}.tar.gz
Patch0:         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:  pkgconfig
BuildRequires:  cmake(KF5Archive)
BuildRequires:  cmake(KF5Auth)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(KF5CoreAddons)    
BuildRequires:  pkgconfig(Qt5Charts)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Designer)
BuildRequires:  pkgconfig(Qt5Quick)
BuildRequires:  pkgconfig(Qt5QuickControls2)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(botan-3)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(quazip1-qt5)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(polkit-gobject-1)
BuildRequires:  pkgconfig(spdlog)
BuildRequires:  pkgconfig(pugixml)
BuildRequires:  pkgconfig(catch2)
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
%autosetup -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